Fetching Data - quick question

Posts   
 
    
Posts: 11
Joined: 23-Oct-2007
# Posted on: 25-Oct-2007 01:00:27   

Hi All

Regarding entities :

I know its possible to fetch from the PK Field.... But it it possible to fetch using another field? If yes, please tell me how.

For example:

If my table was Order and my primary key was OrderID, but I wanted to populate the entity from another field, like transactionID. Instead of using Order.FetchUsingPK - what other method could I use, and how would I implement it?

Thanks again...

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 25-Oct-2007 05:51:34   

Hi Michael,

The fetch entity routine have to guarantee that will be only one resulset from DB, then it can fill your Entity. This is only possible vía PK (primary keys) or UC (unique constraints). Otherwise you have to fetch an entitycollection an extract the entity in you need.

David Elizondo | LLBLGen Support Team