Yes. I'm working my way through the Hibernate book so I'm not 100% that this is
the correct way - but it works.
You need to explicitly add the PERSON to the Collection of PERSONs in the CITY when doing
the persist. I'm not in front of my normal laptop but the code looks something like
this:
| @Override
| @Transactional
| public String persist() {
| String status = super.persist();
|
| getInstance().getCity().getPersons().add(getInstance());
|
| Contexts.removeFromAllContexts("personHome");
| return status;
| }
|
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4049210#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...