[jboss-user] [EJB 3.0] - Entitymanager Persistent

poyge394 do-not-reply at jboss.com
Thu May 3 09:53:54 EDT 2007


i have 2 entity bean, Rollingstock and Schedule.
Hear is some code:

  | rollingstock = new Rollingstock();
  | rollingstock.setNextRoute( "STH" );
  | rollingstock.setRoute( "HALL" );
  | schedule = new Schedule();
  | rollingstock.setSchedule( schedule );

So now i whant to persist the entitys, i thought that i just neded to do:
then bouth rollingstock and schedule would be persist, but i get a exception when i do that.
i must do this to get both persist:

  | manager.persist(rollingstock);
  | manager.persist(schedule);

is thair any better way to persist entitys, Because in my Rollingstock entity i have a lot off relations, so when i get a Rollingstock i just whant to run persist(rollingstocko);
now i must take out evrything and do persist on each entity.

any clarification ?

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

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

More information about the jboss-user mailing list