Hello Everyone,
I have a table with no primary key. I don't have control over the database. All the fileds in the table can only act as primary key.
When i generate .hbm.xml file by using reverse engineering mechanism provided in eclipse, here is the generated .hbm.xml file.
In this case when i try to update a record in the table, i am not able to update using hibernate.
[u][b]Emp1.hbm.xml[/b][/u]
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated Feb 10, 2006 12:26:48 PM by Hibernate Tools 3.1.0 beta1JBIDERC2 -->
<hibernate-mapping>
<class name="com.adp.es.fsa.test.Emp1" table="EMP1" schema="SCOTT">
<composite-id name="id" class="com.adp.es.fsa.test.Emp1Id">
<key-property name="empno" type="short">
<column name="EMPNO" precision="4" scale="0" />
</key-property>
<key-property name="ename" type="string">
<column name="ENAME" length="10" />
</key-property>
<key-property name="job" type="string">
<column name="JOB" length="9" />
</key-property>
<key-property name="mgr" type="short">
<column name="MGR" precision="4" scale="0" />
</key-property>
<key-property name="hiredate" type="date">
<column name="HIREDATE" length="7" />
</key-property>
<key-property name="sal" type="big_decimal">
<column name="SAL" precision="7" />
</key-property>
<key-property name="comm" type="big_decimal">
<column name="COMM" precision="7" />
</key-property>
<key-property name="deptno" type="byte">
<column name="DEPTNO" precision="2" scale="0" />
</key-property>
</composite-id>
<many-to-one name="dept1" class="com.adp.es.fsa.test.Dept1" update="false" insert="false" fetch="select">
<column name="DEPTNO" precision="2" scale="0" />
</many-to-one>
</class>
</hibernate-mapping>
Please tell me some solution to update a record in this scenario.
Thanks
Ravi
|