Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Hibernate Annotations for Primary Key  RSS feed

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

My appliction is on Spring with tomcat-5.5 server. I am using hibernate annotation for generating primary key as auto as
@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 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
Boost this thread!