Java Mailing List Archive

Home » JBoss User »

[jboss-user] [JBoss Seam] - Re: Creating several objects in one


Author LoginPost Reply
Easiest is to add the persons to a list you store in the bean.


private Person person;
| private List<Person> list=new ArrayList<Person>();
| void add() {
|   list.add(person);
|  person = new Person();
| )

Then in your commit method, iterate the list and call em.persist for each element.
No need to use Flushmode.manual for this kind of interaction.
Also, the transaction is tied to a single method call (= a good thing).

View the original post :

Reply to the post :
jboss-user mailing list
©2008 - Jax Systems, LLC, U.S.A.