Joined: Sat Dec 11, 2010 8:49 am Posts: 19
|
Hello,
I have class Operator with basic data and set of bosses which are operators also. So this is many-to-many relation because each operator can have one or more bosses and also one or more employees. I create additional table OperatorHierarchy with BossID and EmployeeID columns. In mapping files i define sets like this: <set name="bosses" inverse="true" lazy="true" table="operatorhierarchy" fetch="select"> <key> <column name="EmployeeID" not-null="true" /> </key> <many-to-many column="BossID" class="operator" /> </set>
Everything works ok except i cannot propagate optimistic locking on these sets. E.g. if one application user delete boss from operator and other user in meantime add boss to same operator in database i want to StaleObjectStateException be thrown. However i cannot accomplish these. I set optimistic-lock="all" dynamic-update="true" on both operator and operatorhierarchy mapping files.
Can someone help me about this.
|
|