[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Re: style and idioms for @ManyToMany definition and update
dbatcn
do-not-reply at jboss.com
Mon Jul 24 16:04:51 EDT 2006
Adding a flush between the merge and refresh seems to help a lot.
| group = new Group();
| group.setGroupname( newGroupname() );
| orgmobDatabase.persist( group );
| // User owns the bidirectional many-to-many relationship with Group
| user.getGroups().add( group );
| orgmobDatabase.merge( user );
| orgmobDatabase.flush();
| orgmobDatabase.refresh( group );
Also, after some more reading persistence type PERSIST also seems more appropriate to my needs.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3960509#3960509
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3960509
More information about the jboss-user
mailing list