Hibernate Interview Question

Moderators: pilkguns, m1963, smoking357

Post Reply
candidjava
Posts: 2
Joined: Mon Jan 02, 2012 6:31 am

Hibernate Interview Question

Post by candidjava »

How do you define sequence generated primary key in hibernate?

Using <generator> tag.



Example:-

<id column=”USER_ID” name=”id” type=”java.lang.Long”>

<generator class=”sequence”>

<param name=”table”>SEQUENCE_NAME</param>

<generator>

</id> <a href="http://candidjava.com/hibernate-interview-question"></a>
Last edited by candidjava on Mon Jan 02, 2012 8:34 am, edited 3 times in total.
candidjava
Posts: 2
Joined: Mon Jan 02, 2012 6:31 am

Hibernate Interview Question

Post by candidjava »

Post Reply