• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate Annotations for Primary Key

 
Kalpesh Rawal
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

My appliction is on Spring with tomcat-5.5 server. I am using hibernate annotation for generating primary key as auto as
@Id
@GeneratedValue(strategy = GenerationType.AUTO,generator="test_sequence")
@SequenceGenerator(name = "test_sequence",sequenceName="TEST_SEQ")
@Column(name = "ID", unique = true, nullable = false)

I want to know what generator class should i use in my test.hbm.xml if i use GenerationType.AUTO stratagy in Test.java file.Currently i am using Increment generator classin Test.hbm.xml file.

Also i have created a sequence call TEST_SEQ in my database ORACLE-9i.

Please help me.
Thanks in advance.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic