[jboss-user] [EJB 3.0] - Re: CascadeType.PERSIST question
waynebaylor
do-not-reply at jboss.com
Sun Sep 9 13:25:44 EDT 2007
so, it looks like your entity code is OK. you just need to add an extra step when saving:
PartyIsPerson p = new PartyIsPerson();
| p.setUsername("Guest"); //Guest
| p.setPassword("Guest"); //Guest
| p.setForename("Guest"); //Guest
| p.setLastname("Guest"); //Guest
| p.setPartyId(100);
|
| PersonHasCustomization phc = new PersonHasCustomization();
| phc.setPartyidperson(p.getPartyId());
| phc.setLocale("DE_de");
| p.setCustomization(phc);
|
| EntityManager.persist(p)
from the "Java Persistence w/Hibernate" book it says, JPA doesn't include a standard way of dealing with shared primary key generation. So, it's up to you to set it (page 282).
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4082403#4082403
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4082403
More information about the jboss-user
mailing list