Im finding a way to generate key for table and it needed to be increment one by one. like we did earlier in hibernate mapping file: like
Code:
<class name="com.Employee" table="Employee">
<id name="empid" type="long" column="id" >
<generator class="increment"/>
</id>
<property name="empname">
<column name="name" />
</property>
</class>
I want do this in my application and then insert incremented value to the table.
I tried this option:
@GeneratedValue(strategy=GenerationType.IDENTITY)
@GeneratedValue(strategy=GenerationType.AUTO)
but it doesn't work.
Please help....
regards,
Dil.