I have a simple Java model where ListHolder contains a list, which in turn can contain ListHolder objects:
public class ListHolder {
private List<ListHolder> list;
}
My approach to the Hibernate mapping file is as follows:
<class name="ListHolder" table="tListHolder">
<id column="id" type="int">
<generator class="native"/>
</id>
<list name="list" access="field" cascade="all">
<key column="parent" not-null="true"/>
<index column="elementIndex"/>
<one-to-many class="ListHolder" />
</list>
</class>
When I use the above with Hibernate 3.0, I get the following exception:
Exception in thread "main" org.hibernate.HibernateException:
Unable to instantiate default tuplizer
[org.hibernate.tuple.entity.PojoEntityTuplizer]
at org.hibernate.tuple.entity.EntityTuplizerFactory.constructTuplizer(
EntityTuplizerFactory.java:110)
Am I doing something wrong in the mapping file? Is there a better way to match lists that work?
Does it make sense to try above with a later version (3.6) of sleep mode?
source
share