Hi all,
I have an indexed collection mapped (as part of another entity) like this:
Code:
<list name="tournamentSamples" table="USER_TOURNAMENT_SAMPLES">
<key column="USER_ID"/>
<list-index column="SAMPLE_INDEX"/>
<one-to-many class="prt.TournamentSample"/>
</list>
When the collection is updated in a new session after several changes (add, remove, modify) have been made to it while it's in the detached state,
ALL the database records of the collection are updated to make the index column a progression of consecutive integers starting with 1.
Is it how it is supposed to work? or am I doing something wrong?
I am new to Hibernate. The DOC says indexed collections are fast.
What is the purpose of the index column? If one would write the (functionally equivalent) schema by hand, in plain SQL, he/she would not need index column at all.
BTW, I can't use a set instead of a list because there is no unique"business" key exist for samples.
Thank you,
Joe