posted 13 years ago
Hi I have scenario where
operation 1: 2 user read data from table1 and table2
table3 is a link table for table1 and table2 which has foreign keys of table1 and table2.
operation2: the first user has inserted a new record in table3
operation3: later the second user is also inserting a new record in table3 which is not aware already a record is inserted
I am using hibernate mapping but we are not using hibernate version check ....................
How to prevent multiple record in table3?
in mapping files or for every insertion I have to check already a record in table3?
How should be the mappings file declared?
I just changed the names of mapping ..........
<hibernate-mapping>
<class name=" " table="table3_LINK">
<meta attribute="extends" inherit="false">BaseModel</meta>
<meta attribute="class-code" inherit="false">private static final long serialVersionUID = 1L;</meta>
<id name="id" type="java.lang.Long">
<column name="table3_ID" precision="15" scale="0" />
<generator class="identity"></generator>
</id>
<many-to-one name="Employer" class=".model.businessobject.table1" fetch="select">
<column name="FK_table1_ID" precision="15" scale="0" not-null="true" />
</many-to-one>
<many-to-one name="rc" class=".model.businessobject.table2" fetch="select">
<column name="FK_table2_ID" precision="15" scale="0" not-null="true" />
</many-to-one>
<property name="intPartyInd" type=".model.hibernateext.TrimmedString">
<column name="column3_table3" length="1" not-null="true" />
</property>
<property name="mailto1Ind" type=".model.hibernateext.TrimmedString">
<column name="Column4_table4" length="1" not-null="true">
</column>
</property>