I have a database relationship of two objects. The tables/objects are Company 
and Contact. 

Company has a foreign key relationship with Contact. Therefore Contact has a 
company property. This field is required, or not nullable.

What I am trying to do is create a contact from scratch, populate the company 
property with a new company (minus the @Id primary key fields) and submit them 
to the entity manager.. Hoping that it will create new records in each table 
and build the relationship between the two.

is this possibly by using em.persist(contact); ? Or do I need to persist them 
both individually and create the relationship manually?

Thanks
Dan

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

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


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to