Re: Further Info : Flattened Many To Many grabbing all objects
Re: Further Info : Flattened Many To Many grabbing all objects
- Subject: Re: Further Info : Flattened Many To Many grabbing all objects
- From: Art Isbell <email@hidden>
- Date: Fri, 18 Jan 2008 09:03:24 -1000
On Jan 17, 2008, at 9:07 PM, Alexander Spohr wrote:
1. never use includeObjectIntoPropertyWithKey if you want to
maintain your object-graph. The otehr side of the relationship will
not know that you changed something.
An exception would be that described by Owen below. From the WO
JavaDoc:
protected void includeObjectIntoPropertyWithKey(Object eo, String key)
Adds to the relationship named key the object eo without affecting
inverse relationships, by directly modifying the property storing the
to-many relationship. This method can be used from inside of methods
of the form addToKey.
Am 18.01.2008 um 06:24 schrieb Owen McKerrow:
I've done some more digging. We recently update our project to use
EOGenerator ( using the standard Template files that come with it )
which as Im sure you all know changes the behavior of adding an
object from a method that looks like this :
public void
addToAssociatedWebsiteDisplays(edu.uow.ris.framework.eo.Publication
object) {
includeObjectIntoPropertyWithKey(object,
"associatedWebsiteDisplays");
}
to one that looks like this :
public void
addToAssociatedWebsiteDisplaysRelationship
(edu.uow.ris.framework.eo.Group object) {
addObjectToBothSidesOfRelationshipWithKey( object,
"associatedWebsiteDisplays" );
}
which is another place where Im seeing the behavior I described in
my first email. If I change the method back to use
includeObjectIntoPropertyWithKey instead of
addObjectToBothSidesOfRelationshipWithKey the load of all the
related objects goes away. So at this stage it seems (?) to be a
better option.
Aloha,
Art
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden