From: Andy J. (JIRA) <web...@jp...> - 2007-09-03 09:51:40
|
[ http://www.jpox.org/servlet/jira/browse/CORE-3238?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Andy Jefferson updated CORE-3238: --------------------------------- Summary: Managed Relationships : bidirectional relations should be made consistent by JPOX, in the datastore and in memory (was: Managed Relationships : Use of mappedBy should imply that non-owner side of a bidirectional relation doesnt need setting) Description: JPA1 and JDO2.1 spec both imply that if you have a bidir relation (with mapped-by) that you could only set one side of the relation (the owning side) and the relation will be persisted to the datastore. Means that the non-owning side field value should never be persisted as such (since it is stored at the other side). Current JPOX behaviour is to persist all fields regardless of whether they have mapped-by set hence leading to indeterminate results. In addition JPOX doesn't necessarily align in-memory bidirectional relations. (was: JPA and JDO2 spec both imply that if you have a bidir relation (with mapped-by) that you can only set one side of the relation (the owning side) and the relation will be persisted to the datastore. Means that the non-owning side field value should never be persisted. Current JPOX behaviour is to persist all fields regardless of whether they have mapped-by set. Current JPOX behaviour where the user has set just one side of a bidir is undefined because it may find the side with the value set first, persist it, and then find the other side with the field unset and hence unset it (delete it) again) > Managed Relationships : bidirectional relations should be made consistent by JPOX, in the datastore and in memory > ----------------------------------------------------------------------------------------------------------------- > > Key: CORE-3238 > URL: http://www.jpox.org/servlet/jira/browse/CORE-3238 > Project: Core > Issue Type: New Feature > Components: Datastore Support : RDBMS, JDO, JPA > Affects Versions: 1.2.0-beta-2 > Reporter: Andy Jefferson > Assigned To: Andy Jefferson > Fix For: 1.2.0-rc-1 > > > JPA1 and JDO2.1 spec both imply that if you have a bidir relation (with mapped-by) that you could only set one side of the relation (the owning side) and the relation will be persisted to the datastore. Means that the non-owning side field value should never be persisted as such (since it is stored at the other side). Current JPOX behaviour is to persist all fields regardless of whether they have mapped-by set hence leading to indeterminate results. In addition JPOX doesn't necessarily align in-memory bidirectional relations. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://www.jpox.org/servlet/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |