[jboss-user] [EJB 3.0] - Re: @GeneratedValue(strategy=GenerationType.AUTO) for oracle

celle2006 do-not-reply at jboss.com
Tue Jul 15 09:42:36 EDT 2008


Hi rkiran81,

i think the problem is that you cannot use the @GeneratedValue Tag as you do. The oracle database usually works with sequences to create IDs. You can use these Sequences with ejb, too.

Just add the following to your RolesProfileBean EJB.

@Entity
@SequenceGenerator(name="sequenceName",
sequenceName="sequenceNameInDatabase")

and to your ID Column:
@GeneratedValue(strategy=GenerationType.SEQUENCE
,generator="sequenceName")

Greetz celle2006

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

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



More information about the jboss-user mailing list