how do we fetch entity based on non-unique value

Posts   
 
    
youkebb
User
Posts: 14
Joined: 14-May-2009
# Posted on: 19-Jun-2009 19:32:47   

hi I have a customer table. I am able to fetch entity based on the customer ID, something like following:

UserEntity users = new UserEntity(userID); adapter.FetchEntity(...);

My question is how do we fetch entity based on a non-unique value? say we have a LastName column, and we want to fetch all user whose last name is "Johnson"? thanks

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 20-Jun-2009 07:10:43   

youkebb wrote:

My question is how do we fetch entity based on a non-unique value? say we have a LastName column, and we want to fetch all user whose last name is "Johnson"? thanks

Yes. The thing is: suppose there are 50 "Johnson"s. Which one of them do you want to fetch? So, yes, you have to reduce your filter, and maybe with sortExpression and Limit, you can reduce the fetch.

David Elizondo | LLBLGen Support Team