Hi @all,

I have the following scenario: I´ve got a user-object that gets it´s ID through 
a @SequenceGenerator. Inside this user-object I´ve got an object 
VerificationCode. The ID of the VerificatinCode should be the same as the ID of 
the user, but the problem is, that I receive the id only while persisting, so I 
cannot instantiate the VerificationCode with a User-object and use it´s id with 
my getId()-method. One solution I found was to use the @PrePersist and do a 
MyVerificationObject.setId(myUserObject.getId()) in this method. But is this 
the way to go or is there a more elegant (object-oriented) way?

Thanks
Thomas

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

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

_______________________________________________
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to