I have a bidirectional one-to-many between composite keys (legacy schema) that looks something like
OrderKey(customer, orderNumber) OrderRowKey(customer, orderNumber, rowNumber)
I would think this is pretty common.
Is it possible to map the rowNumber as an index column? I know modifying primary keys is not that cool but it would be handy to be able to remove and sort order rows and have the rowNumber automagically synchronized (and preventing primary key clashes if updates are processed before deletes, as I've seen).
The problem arises when I map the @IndexColumn to the rowNumber, I keep getting a "Repeated column in mapping for entity: hib.Child column: childOrder (should be mapped with insert="false" update="false")" even if I follow the advice. If I use another (non-key) property, the list index works as intended...
Is there any way around this?
Thankful for assistance, Nik
|