Hi Forum,
i've got an class like:
class Category {
private List<Category> subcategories = new ArrayList<Category>();
// get - setter usw
}
So i try to map this list with this:
<list name="subcategories" table="CATEGORIE_CATEGORIES"
lazy="true" cascade="all-delete-orphan">
<key column="CATEGORIE_ID"></key>
<index column="SUBCATEGORIE_ID" />
<one-to-many
class="mein.package.Category" />
</list>
but this ends in:
(util.JDBCExceptionReporter 71 ) SQL Error: 0, SQLState: null
(util.JDBCExceptionReporter 72 ) failed batch
(def.AbstractFlushingEventListener 299 ) Could not synchronize
database state with session
So i read in the Documentation:
"5.3. Mapping a class more than once"
But this is not really what i need. I need a real rekursiev mapping.
Categorie that can have Categories, where each contains Categories, and so on.
In this example, they declare only one parent-child situation.
What's the solution for my problem?
Tanks for help, and sorry for my english ;)
|