Author: danhaywood
Date: Thu Mar 27 09:16:21 2014
New Revision: 1582227
URL: http://svn.apache.org/r1582227
Log:
updating bidir page
Modified:
isis/site/trunk/content/components/objectstores/jdo/managed-1-to-m-relationships.md
Modified:
isis/site/trunk/content/components/objectstores/jdo/managed-1-to-m-relationships.md
URL:
http://svn.apache.org/viewvc/isis/site/trunk/content/components/objectstores/jdo/managed-1-to-m-relationships.md?rev=1582227&r1=1582226&r2=1582227&view=diff
==============================================================================
---
isis/site/trunk/content/components/objectstores/jdo/managed-1-to-m-relationships.md
(original)
+++
isis/site/trunk/content/components/objectstores/jdo/managed-1-to-m-relationships.md
Thu Mar 27 09:16:21 2014
@@ -28,9 +28,11 @@ and
public void setDepartment(Department department) { ... }
...
}
-
+
Contrast the above with the programmatic maintenance described in the
[how-to](../../../more-advanced-topics/how-to-04-060-How-to-set-up-and-maintain-bidirectional-relationships.html).
+If you use Eclipse as your IDE, then these [editor
templates](../../../intro/resources/editor-templates.html) include a set
(prefixed `isjd`) to help write such code.
+
> **Note**
>
In fact, not only do you not need to manually maintain the relationship, we
have noted on at least [one
occasion](http://markmail.org/message/agnwmzocvdfht32f) a subtle error if the
code is programmatically added.
@@ -38,4 +40,3 @@ In fact, not only do you not need to man
The error in that case was that the same object was contained in the parents
collection. This of course should not happen for a `TreeSet`. However,
JDO/DataNucleus replaces the `TreeSet` with its own implementation, and (either
by design or otherwise) this does not enforce `Set` semantics.
>
The upshot is that you should NEVER programmatically add the child object to
the parent's collection if using JDO Objectstore.
-