Users - Understanding getRelatedXXX functions

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Users - Understanding getRelatedXXX functions

Vinay Agarwal

Hello,

 

I am getting confused on how do getRelatedXXX functions work. I would appreciate clarification. Part of the UserLogin relations are copied below. Are the following statements correct?

 

  1. getRelatedOne(“Party”) would get the entity in row 1.
  2. getRelated(“Party”) would get both entities in last two rows.

 

Thanks in advance.

Regards,

Vinay Agarwal

 

Relations

for entity UserLogin

Title

Related Entity

Relation Type

FK Name

Key Map

 

Party

one

USER_PARTY

partyId -> partyId

 

Person

one-nofk

 

partyId -> partyId

 

PartyGroup

one-nofk

 

partyId -> partyId

CreatedBy

ContactList

many

 

userLoginId -> createdByUserLogin

LastModifiedBy

ContactList

many

 

userLoginId -> lastModifiedByUserLogin

CreatedBy

Content

many

 

userLoginId -> createdByUserLogin

LastModifiedBy

Content

many

 

userLoginId -> lastModifiedByUserLogin

 

 

 

 

CreatedBy

Party

many

 

userLoginId -> createdByUserLogin

LastModifiedBy

Party

many

 

userLoginId -> lastModifiedByUserLogin

 

 

 

 

 

 


 
_______________________________________________
Users mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Users - Understanding getRelatedXXX functions

David E. Jones

No, as described in the Entity Engine Guide the relationship name  
(used in the getRelated* methods) is the title plus the related  
entity name. The only reason there are getRelatedOne* methods is to  
return a single GenericValue object versus a list (ie do a  
findByPrimaryKey instead of findByAnd).

-David


On Mar 8, 2006, at 5:09 PM, Vinay Agarwal wrote:

> Hello,
>
>
> I am getting confused on how do getRelatedXXX functions work. I  
> would appreciate clarification. Part of the UserLogin relations are  
> copied below. Are the following statements correct?
>
>
> getRelatedOne(“Party”) would get the entity in row 1.
> getRelated(“Party”) would get both entities in last two rows.
>
> Thanks in advance.
>
> Regards,
>
> Vinay Agarwal
>
>
> Relations
> for entity UserLogin
>
> Title
>
> Related Entity
>
> Relation Type
>
> FK Name
>
> Key Map
>
>
> Party
>
> one
>
> USER_PARTY
>
> partyId -> partyId
>
>
> Person
>
> one-nofk
>
>
> partyId -> partyId
>
>
> PartyGroup
>
> one-nofk
>
>
> partyId -> partyId
>
> CreatedBy
>
> ContactList
>
> many
>
>
> userLoginId -> createdByUserLogin
>
> LastModifiedBy
>
> ContactList
>
> many
>
>
> userLoginId -> lastModifiedByUserLogin
>
> CreatedBy
>
> Content
>
> many
>
>
> userLoginId -> createdByUserLogin
>
> LastModifiedBy
>
> Content
>
> many
>
>
> userLoginId -> lastModifiedByUserLogin
>
> …
>
>
>
>
>
> CreatedBy
>
> Party
>
> many
>
>
> userLoginId -> createdByUserLogin
>
> LastModifiedBy
>
> Party
>
> many
>
>
> userLoginId -> lastModifiedByUserLogin
>
>
>
>
>
>
>
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.ofbiz.org/mailman/listinfo/users

 
_______________________________________________
Users mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/users

smime.p7s (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Users - Understanding getRelatedXXX functions

Vinay Agarwal
Thanks David. I had read it before but didn't register it.

-----Original Message-----
From: [hidden email] [mailto:[hidden email]]
On Behalf Of David E. Jones
Sent: Wednesday, March 08, 2006 4:24 PM
To: OFBiz Users / Usage Discussion
Subject: Re: [OFBiz] Users - Understanding getRelatedXXX functions


No, as described in the Entity Engine Guide the relationship name  
(used in the getRelated* methods) is the title plus the related  
entity name. The only reason there are getRelatedOne* methods is to  
return a single GenericValue object versus a list (ie do a  
findByPrimaryKey instead of findByAnd).

-David


On Mar 8, 2006, at 5:09 PM, Vinay Agarwal wrote:

> Hello,
>
>
> I am getting confused on how do getRelatedXXX functions work. I  
> would appreciate clarification. Part of the UserLogin relations are  
> copied below. Are the following statements correct?
>
>
> getRelatedOne("Party") would get the entity in row 1.
> getRelated("Party") would get both entities in last two rows.
>
> Thanks in advance.
>
> Regards,
>
> Vinay Agarwal
>
>
> Relations
> for entity UserLogin
>
> Title
>
> Related Entity
>
> Relation Type
>
> FK Name
>
> Key Map
>
>
> Party
>
> one
>
> USER_PARTY
>
> partyId -> partyId
>
>
> Person
>
> one-nofk
>
>
> partyId -> partyId
>
>
> PartyGroup
>
> one-nofk
>
>
> partyId -> partyId
>
> CreatedBy
>
> ContactList
>
> many
>
>
> userLoginId -> createdByUserLogin
>
> LastModifiedBy
>
> ContactList
>
> many
>
>
> userLoginId -> lastModifiedByUserLogin
>
> CreatedBy
>
> Content
>
> many
>
>
> userLoginId -> createdByUserLogin
>
> LastModifiedBy
>
> Content
>
> many
>
>
> userLoginId -> lastModifiedByUserLogin
>
> .
>
>
>
>
>
> CreatedBy
>
> Party
>
> many
>
>
> userLoginId -> createdByUserLogin
>
> LastModifiedBy
>
> Party
>
> many
>
>
> userLoginId -> lastModifiedByUserLogin
>
>
>
>
>
>
>
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.ofbiz.org/mailman/listinfo/users

 
_______________________________________________
Users mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/users