The problem is that during a session.commit() it appears as if hibernate changes the order of a list.
DefinitionImpl.types is a property of type java.util.List
A DefinitionImpl has many TypeImpl's (1-n relation).
before the commit : DefinitionImpl.types = [type[java-type(java.util.Date) index(0)], type[java-type(java.lang.Boolean) index(1)]]
after the commit : DefinitionImpl.types = [type[java-type(java.lang.Boolean) index(0)], type[java-type(java.util.Date) index(1)]]
mapping file for class TypeImpl:
...
<property name="index" type="integer" column="index_" />
<many-to-one name="definition" class="org.jbpm.model.definition.impl.DefinitionImpl" cascade="none" />
...
mapping file for DefinitionImpl.types
...
<list name="types" lazy="true" cascade="all">
<key column="definition" />
<index column="index_" />
<one-to-many class="org.jbpm.model.definition.impl.TypeImpl" />
</list>
...
Can anybody see what I'm doing wrong ?
Has anybody got a tip or suggestion on why the commit changes the order and updates the indexes ?
Regards, Tom.
|