Ah, I guess I didn't read your code close enough.
If you want to do something like:
| if (existing.size()==0)
| {
| user.setAccount(new Acount(/*initialization params*/));
| em.persist(user);
| log.info("Registered new user #{user.username}");
| return "/registered.xhtml";
| }
|
you need to add cascading to your user model.. i.e.
| @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY )
| @JoinColumn( name = "account_id" )
| public Account getAccount()
| {
| return this.account;
| }
|
|
Hope that helps,
Dustin
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4113103#4113103
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4113103
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user