find-by-primary-key vs find-by-and vs entity-condition

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

find-by-primary-key vs find-by-and vs entity-condition

david.cuenca
Hello list,
I know that the most logical method for obtaining an entity instance
having its primary keys must be "use find-by-primary-key!", but are
find-by-and and entity-condition as efficient as find-by-primary-key
with the same conditions?

Regards,
David Cuenca
Reply | Threaded
Open this post in threaded view
|

Re: find-by-primary-key vs find-by-and vs entity-condition

Jacques Le Roux
Administrator
Strange question, quick answer.

I guess by nature it can't be as efficient (you may have a look at SQL generated), and with by-and you get a list not an entity...

Jacques

De : "David Cuenca" <[hidden email]>
> Hello list,
> I know that the most logical method for obtaining an entity instance
> having its primary keys must be "use find-by-primary-key!", but are
> find-by-and and entity-condition as efficient as find-by-primary-key
> with the same conditions?
>
> Regards,
> David Cuenca
Reply | Threaded
Open this post in threaded view
|

Re: find-by-primary-key vs find-by-and vs entity-condition

david.cuenca
The core of the matter is if there is any difference in the SQL
generated, and then, the only little difference between any of this
methods would be if they construct or not a list (thing that should be
nearly instantaneous).  So, I will try to look at the SQL generated.

Thanks for your reply,
David

Jacques Le Roux wrote:

> Strange question, quick answer.
>
> I guess by nature it can't be as efficient (you may have a look at SQL generated), and with by-and you get a list not an entity...
>
> Jacques
>
> De : "David Cuenca" <[hidden email]>
>  
>> Hello list,
>> I know that the most logical method for obtaining an entity instance
>> having its primary keys must be "use find-by-primary-key!", but are
>> find-by-and and entity-condition as efficient as find-by-primary-key
>> with the same conditions?
>>
>> Regards,
>> David Cuenca
>>