You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by OBender <os...@hotmail.com> on 2009/11/28 15:57:07 UTC

constructor mapping and primitive types - bug or feature?

Hi All,

 

There is one very strange issue. If there is a constructor with primitive
argument, say long and you have a mapping with:

<resultMap type="T1" id="T1Result">

        <constructor>

            <arg column="xxx" javaType="long" />

        </constructor>

    </resultMap>

 

---

public class T1

{

                final private long xxx;

 

                public T1( long xxx )  {

                                this.xxx = xxx;

                }

}

---

 

The execution fails trying to find constructor with java.lang.Long type
instead of primitive long type.

 

Is this a bug or constructors with primitive types are not supported?

 

Thanks.