I am using list for one-to-many bi-directional mapping in hibernate..
following is my code for list:
<list name="fEvents" table="FTP_SCAN_EVENTS" cascade="save-update" access="field">
<key column="LOCATION_ID" />
<list-index column="idx" />
<one-to-many class="FtpScanEvents" />
</list>
the column idx in the table is not generating..Do I have to have it as a property in my class? any suggestion on generating this Id…?
Try to chnage to index instead of list-index.
You dont need property for the index.
Hibernate calc it based on position in the list. You can also define base to start the position from another base than 0
In addtional check this – Bidirectional list