Hibernate version: 3.2.6
Name and version of the database you are using: Oracle 10g
Hello,
I’m having trouble with a mapping where I’m not getting the list-index set. The index is always null. Can someone see what is wrong with this mapping: (and I'm only including what what I think is needed because I can't copy/paste--I have to retype this because our development environment is an isolated environment. Let me know if you have an idea but need more.)
Code:
<class name="DummyDataEntity" ... (used generated id called DUMMY_ID)
<list name="smarties" cascade="all, delete-orphan" inverse="true">
<key column="DUMMY_ID" />
<list-index column="SMART_ORDER"/>
<one-to-many class="Smarty"/>
</list>
...
</class>
<class name="Smarty" table="SMARTY">
<composite-id>
<key-many-to-one name="parent" class="DummyDataEntity">
<column name="DUMMY_ID" not-null="true"/>
</key-many-to-one>
<key-property name="uniqueKey" type="string"/>
</composite-id>
</class
After saving a DummyDataEntity object, the data in the database looks like this:
Code:
DummyDataEntity:
DUMMY_ID
653 ............
SMARTY:
DUMMY_ID UNIQUEKEY SMART_ORDER
653 uk1 <null>
653 uk2 <null>
The database structure needs to stay like this where the child SMARTY table's DUMMY_ID is a foreign key to it's parent DummyDataEntity.DUMMY_ID. That's why Smarty doesn't have an id generator of it's own.
So when I try to load the DummyDataEntity, there are problems because the list order(SMART_ORDER) is null.
Thanks.