Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
3.1
Mapping documents:
<list name="values" cascade="all-delete-orphan" lazy="true" inverse="false" >
<key column="scale_id" not-null="true"/>
<list-index column="value_position" />
<one-to-many entity-name="scale_value" />
</list>
The above mapping gives this error:
java.lang.ClassCastException: org.hibernate.property.BackrefPropertyAccessor$1
at org.hibernate.type.LongType.set(LongType.java:42)
at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:83)
at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:65)
at org.hibernate.loader.Loader.bindPositionalParameters(Loader.java:1513)
at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1575)
at org.hibernate.loader.Loader.doQuery(Loader.java:661)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
at org.hibernate.loader.Loader.doList(Loader.java:2144)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2028)
at org.hibernate.loader.Loader.list(Loader.java:2023)
at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:95)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1569)
at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:283)
If I remove the not-null constraint from the <key> element, it works fine.
I am simply retrieving all instances of the value classing using a criteria.
Thanks.