HI All,
I am getting below ClassCastException only for particular data.It is working fine with other data.I could not able to understand whats wrong with my mapping files.If anyone cameacrross these types of problems please help me.I am using Hibernate 2.1.1
1.The Mapping for that coloumn in my hbm file is like below
<property
name="assetNum"
type="long"
column="ASSET_NUM"
not-null="true"
length="15"
/>
2. The Exception that i am getting is,
java.lang.ClassCastException: java.lang.Long incompatible with java.lang.Short
at net.sf.hibernate.type.ShortType.set(ShortType.java:30)
at net.sf.hibernate.type.NullableType.nullSafeSet(NullableType.java:48)
at net.sf.hibernate.type.NullableType.nullSafeSet(NullableType.java:35)
at net.sf.hibernate.loader.Loader.bindPositionalParameters(Loader.java:673)
at net.sf.hibernate.loader.Loader.prepareQueryStatement(Loader.java:712)
at net.sf.hibernate.loader.Loader.doQuery(Loader.java:184)
at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:132)
at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:830)
at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:850)
at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:57)
at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:49)
at net.sf.hibernate.persister.EntityPersister.load(EntityPersister.java:420)
at net.sf.hibernate.impl.SessionImpl.doLoad(SessionImpl.java:2044)
at net.sf.hibernate.impl.SessionImpl.doLoadByClass(SessionImpl.java:1918)
at net.sf.hibernate.impl.SessionImpl.internalLoadOneToOne(SessionImpl.java:1872)
at net.sf.hibernate.type.OneToOneType.resolveIdentifier
Thnaks,
Gundeti.
I am getting below ClassCastException only for particular data.It is working fine with other data.I could not able to understand whats wrong with my mapping files.If anyone cameacrross these types of problems please help me.I am using Hibernate 2.1.1
1.The Mapping for that coloumn in my hbm file is like below
<property
name="assetNum"
type="long"
column="ASSET_NUM"
not-null="true"
length="15"
/>
2. The Exception that i am getting is,
java.lang.ClassCastException: java.lang.Long incompatible with java.lang.Short
at net.sf.hibernate.type.ShortType.set(ShortType.java:30)
at net.sf.hibernate.type.NullableType.nullSafeSet(NullableType.java:48)
at net.sf.hibernate.type.NullableType.nullSafeSet(NullableType.java:35)
at net.sf.hibernate.loader.Loader.bindPositionalParameters(Loader.java:673)
at net.sf.hibernate.loader.Loader.prepareQueryStatement(Loader.java:712)
at net.sf.hibernate.loader.Loader.doQuery(Loader.java:184)
at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:132)
at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:830)
at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:850)
at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:57)
at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:49)
at net.sf.hibernate.persister.EntityPersister.load(EntityPersister.java:420)
at net.sf.hibernate.impl.SessionImpl.doLoad(SessionImpl.java:2044)
at net.sf.hibernate.impl.SessionImpl.doLoadByClass(SessionImpl.java:1918)
at net.sf.hibernate.impl.SessionImpl.internalLoadOneToOne(SessionImpl.java:1872)
at net.sf.hibernate.type.OneToOneType.resolveIdentifier
Thnaks,
Gundeti.