[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - How to use @Id @GeneratedValue(strategy=GenerationType.AUTO)

tonylmai do-not-reply at jboss.com
Thu Mar 1 12:57:49 EST 2007


How does the id get generated?

Say I have a simple entity bean with 2 attributes id and desc. Attribute id is tagged with @Id @GeneratedValue(strategy=GenerationType.AUTO).

Can I create a new object of this class with just the desc and let Hibernate create the id? In the database end, do I create the table for this entity with column id declared as bigint?

Thanks in advance for your help.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4024395#4024395

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4024395



More information about the jboss-user mailing list