You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Justin Dagostino <ju...@thecools.com> on 2014/01/27 23:35:40 UTC

getRelated vs. findByAnd

Is there any difference between issuing a getRelated call on a GenericValue
object vs. using the delegator's findByAnd method?


virtualProduct.getRelated("ProductPrice", whereClause, null, true);

VS.

delegator.findByAnd("ProductPrice", whereClause, null, true);


Thanks.


---
Justin

Re: getRelated vs. findByAnd

Posted by Justin Dagostino <ju...@thecools.com>.
Thank you for your reply.

How about any difference in terms of performance or what's happening behind
the scenes?


/JD

---
*Justin Dagostino*
Director Of Engineering
TheCools.com


On Tue, Jan 28, 2014 at 3:00 AM, Harsha Chadhar <ha...@tcs.com>wrote:

> Hi,
>     The difference is,
>
> 1.  findByAnd() :  finds Generic Entity records with given specific fields
> of the named entity(ProductPrice) and returns a list of GenericValues that
> match the query
>
> 2. getRelated() : returns a list of related entity instance according to
> the specifed relation name (here its ProductPrice).
>
>
> Regards
> Harsha Chadhar
> Tata Consultancy Services
> Mailto: harsha.chadhar@tcs.com
> Website: http://www.tcs.com
> ____________________________________________
> Experience certainty.   IT Services
>                         Business Solutions
>                         Consulting
> ____________________________________________
>
>
>
> From:
> Justin Dagostino <ju...@thecools.com>
> To:
> user@ofbiz.apache.org
> Date:
> 01/28/2014 04:06 AM
> Subject:
> getRelated vs. findByAnd
>
>
>
> Is there any difference between issuing a getRelated call on a
> GenericValue
> object vs. using the delegator's findByAnd method?
>
>
> virtualProduct.getRelated("ProductPrice", whereClause, null, true);
>
> VS.
>
> delegator.findByAnd("ProductPrice", whereClause, null, true);
>
>
> Thanks.
>
>
> ---
> Justin
>
>
> =====-----=====-----=====
> Notice: The information contained in this e-mail
> message and/or attachments to it may contain
> confidential or privileged information. If you are
> not the intended recipient, any dissemination, use,
> review, distribution, printing or copying of the
> information contained in this e-mail message
> and/or attachments to it are strictly prohibited. If
> you have received this communication in error,
> please notify us by reply e-mail or telephone and
> immediately and permanently delete the message
> and any attachments. Thank you
>
>
>

Re: getRelated vs. findByAnd

Posted by Harsha Chadhar <ha...@tcs.com>.
Hi,
    The difference is, 

1.  findByAnd() :  finds Generic Entity records with given specific fields 
of the named entity(ProductPrice) and returns a list of GenericValues that 
match the query

2. getRelated() : returns a list of related entity instance according to 
the specifed relation name (here its ProductPrice).


Regards
Harsha Chadhar
Tata Consultancy Services
Mailto: harsha.chadhar@tcs.com
Website: http://www.tcs.com
____________________________________________
Experience certainty.   IT Services
                        Business Solutions
                        Consulting
____________________________________________



From:
Justin Dagostino <ju...@thecools.com>
To:
user@ofbiz.apache.org
Date:
01/28/2014 04:06 AM
Subject:
getRelated vs. findByAnd



Is there any difference between issuing a getRelated call on a 
GenericValue
object vs. using the delegator's findByAnd method?


virtualProduct.getRelated("ProductPrice", whereClause, null, true);

VS.

delegator.findByAnd("ProductPrice", whereClause, null, true);


Thanks.


---
Justin


=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain 
confidential or privileged information. If you are 
not the intended recipient, any dissemination, use, 
review, distribution, printing or copying of the 
information contained in this e-mail message 
and/or attachments to it are strictly prohibited. If 
you have received this communication in error, 
please notify us by reply e-mail or telephone and 
immediately and permanently delete the message 
and any attachments. Thank you