This content has been marked as final.
Show 1 reply
-
1. Re: Question about perfomance in persistence of objects
chochis Jan 19, 2006 6:29 AM (in response to kodaky)You dont have to retrieve the object from the database.
Pretty simple:
create a Country object and insert the pk:
Country country = new Country();
country.setId(2);
Then create the person object and insert the contry object:
Person person = Person();
person.setCountry(country);
....
Then
em.persist(person);
About the load method, with the EntityManager you have to use find
find retrieves the class of the object and the PK;
Regards