How do you define sequence generated primary key in hibernate?

Answer

Using <generator> tag.
Example:-
<id column="CUST_ID" name="id" type="java.lang.Long">
<generator class="sequence">
<param name="table">SEQUENCE_NAME</param>
<generator>
</id>

All hibernate Questions

Ask your interview questions on hibernate

Write Your comment or Questions if you want the answers on hibernate from hibernate Experts
Name* :
Email Id* :
Mob no* :
Question
Or
Comment* :
 





Disclimer: PCDS.CO.IN not responsible for any content, information, data or any feature of website. If you are using this website then its your own responsibility to understand the content of the website

--------- Tutorials ---