You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Christopher Snow <sn...@coralms.com> on 2007/03/13 09:52:56 UTC

entity engine getRelated()

When setting up related entities using the java services, is it the
developers responsibility to creating the relationships by using the id
field values, e.g.

delegator.create("EntityOne", UtilMisc.toMap("entityOneId", "1"));

delegator.create("EntityTwo", UtilMisc.toMap("entityTwoId", "2",
"entityOneId", "1"));

Is there a setRelated() way of doing things equivalent to getRelated()?,
e.g.

entity1 = delegator.create("EntityOne", ...);
entity2 = delegator.create("EntityTwo", ...);
entity2.setRelated(entity1);

Many thanks,

Chris

Re: entity engine getRelated()

Posted by Christopher Snow <sn...@coralms.com>.
Ireally just wanted to make sure I was doing things right by setting the
relationships manually.

Many thanks,

Chris



On Tue, 2007-03-13 at 03:02 -0600, David E. Jones wrote:
> I guess the simple answer is: nope, but I guess something like that  
> could be created.
> 
> -David
> 
> 
> On Mar 13, 2007, at 2:52 AM, Christopher Snow wrote:
> 
> > When setting up related entities using the java services, is it the
> > developers responsibility to creating the relationships by using  
> > the id
> > field values, e.g.
> >
> > delegator.create("EntityOne", UtilMisc.toMap("entityOneId", "1"));
> >
> > delegator.create("EntityTwo", UtilMisc.toMap("entityTwoId", "2",
> > "entityOneId", "1"));
> >
> > Is there a setRelated() way of doing things equivalent to getRelated 
> > ()?,
> > e.g.
> >
> > entity1 = delegator.create("EntityOne", ...);
> > entity2 = delegator.create("EntityTwo", ...);
> > entity2.setRelated(entity1);
> >
> > Many thanks,
> >
> > Chris
> 

Re: entity engine getRelated()

Posted by "David E. Jones" <jo...@hotwaxmedia.com>.
I guess the simple answer is: nope, but I guess something like that  
could be created.

-David


On Mar 13, 2007, at 2:52 AM, Christopher Snow wrote:

> When setting up related entities using the java services, is it the
> developers responsibility to creating the relationships by using  
> the id
> field values, e.g.
>
> delegator.create("EntityOne", UtilMisc.toMap("entityOneId", "1"));
>
> delegator.create("EntityTwo", UtilMisc.toMap("entityTwoId", "2",
> "entityOneId", "1"));
>
> Is there a setRelated() way of doing things equivalent to getRelated 
> ()?,
> e.g.
>
> entity1 = delegator.create("EntityOne", ...);
> entity2 = delegator.create("EntityTwo", ...);
> entity2.setRelated(entity1);
>
> Many thanks,
>
> Chris