[jboss-user] [JBoss Seam] - Re: Getting Id of Presisted object.
rhinosystemsinc
do-not-reply at jboss.com
Fri May 11 05:38:09 EDT 2007
Hello, can someone give me some advice on how to setup a generated ID with Oracle, hibernate and SEAM...
I have been trying to do a variety of ways - like "before insert" triggers and coupled with @GeneratedValue(strategy=GenerationType.IDENTITY) or @GeneratedValue(strategy=GenerationType.AUTO), but that didn't work. I have tried going straight to the sequence with:
@Id
@Column(name = "LISTINGTYPE_ID", unique = true, nullable = false, precision = 22, scale = 0)
@SequenceGenerator(name="identifier", sequenceName="LISTINGTYPE_SEQ", allocationSize=1)
@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="identifier")
@NotNull
That didn't work, it kept complaining the sequence didn't exist, although it did exist.
I have read a dozen or more postings and can't get the right recipe working for Oracle. I really appreciate your help.
Thanks!!!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4044919#4044919
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4044919
More information about the jboss-user
mailing list