getRelated vs. findByAnd

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

getRelated vs. findByAnd

Justin Dagostino
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
Reply | Threaded
Open this post in threaded view
|

Re: getRelated vs. findByAnd

Harsha Chadhar
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: [hidden email]
Website: http://www.tcs.com
____________________________________________
Experience certainty.   IT Services
                        Business Solutions
                        Consulting
____________________________________________



From:
Justin Dagostino <[hidden email]>
To:
[hidden email]
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


Reply | Threaded
Open this post in threaded view
|

Re: getRelated vs. findByAnd

Justin Dagostino
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 <[hidden email]>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: [hidden email]
> Website: http://www.tcs.com
> ____________________________________________
> Experience certainty.   IT Services
>                         Business Solutions
>                         Consulting
> ____________________________________________
>
>
>
> From:
> Justin Dagostino <[hidden email]>
> To:
> [hidden email]
> 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
>
>
>