Can someone please help. I have read multiple post on this subject and tried to find relief in the reference manual, but nothing helps.
I'm getting this error.
There was 1 error:
1) testInsertHighestDegreeList(org.ihets.ims.dao.hibernate.HibernateInquiryListsDaoTest)java.lang.ClassCastException
at net.sf.hibernate.type.LongType.set(LongType.java:32)
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:674)
at net.sf.hibernate.loader.Loader.prepareQueryStatement(Loader.java:713)
at net.sf.hibernate.loader.Loader.doQuery(Loader.java:185)
at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:133)
at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:836)
at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:856)
at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:59)
at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:51)
at net.sf.hibernate.persister.EntityPersister.load(EntityPersister.java:419)
at net.sf.hibernate.impl.SessionImpl.doLoad(SessionImpl.java:2113)
at net.sf.hibernate.impl.SessionImpl.doLoadByClass(SessionImpl.java:1987)
at net.sf.hibernate.impl.SessionImpl.load(SessionImpl.java:1916)
at org.springframework.orm.hibernate.HibernateTemplate$3.doInHibernate(HibernateTemplate.java:198)
at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:150)
at org.springframework.orm.hibernate.HibernateTemplate.load(HibernateTemplate.java:196)
at org.ihets.ims.dao.hibernate.HibernateInquiryListsDao.insertHighestDegreeList(Unknown Source)
at org.ihets.ims.dao.hibernate.HibernateInquiryListsDaoTest.testInsertHighestDegreeList(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
This is my mapping:
<class name="org.ihets.ims.HighestDegree" table="HighestDegree">
<id name="pk" type="long" column="pk">
<generator class="sequence">
<param name="sequence">highestDegree_pk_seq</param>
</generator>
</id>
<property name="value" column="value" type="string"/>
</class>
This is my class:
public class HighestDegree implements Serializable {
/** identifier field */
private Long pk;
/** nullable persistent field */
private String value;
/** full constructor */
public HighestDegree(String value) {
this.value = value;
}
/** default constructor */
public HighestDegree() {
}
public Long getPk() {
return this.pk;
}
public void setPk(Long pk) {
this.pk = pk;
}
public String getValue() {
return this.value;
}
public void setValue(String value) {
this.value = value;
}
public String toString() {
return new ToStringBuilder(this)
.append("pk", getPk())
.toString();
}
}
|