Update using Unique Colunm

Posts   
 
    
Anthony
User
Posts: 155
Joined: 04-Oct-2006
# Posted on: 13-Jun-2008 09:05:26   

Is it possible using adapter mode to do adapter.fetchentity(2) using forreign key just like is possible using the self selfing mode.

Using dotnet2,adapter, llblgen v2.5

Walaa avatar
Walaa
Support Team
Posts: 14994
Joined: 21-Aug-2005
# Posted on: 13-Jun-2008 09:20:44   

Your question is not clear, the tilte speaks about Update using a Unique column and the body speaks about fetching an entity using a FK.

Would you please describe your question in more details?

Anthony
User
Posts: 155
Joined: 04-Oct-2006
# Posted on: 13-Jun-2008 09:48:09   

Sorry for my bad explanation.

When using the self-servicing mode you can fetch any entity using a unique index value.

e.g FetchUsingUCReseller as compared with FetchUsingPK

Can you do this is adapter mode. I have been using the Fetchentitycollection with a bucket expression to achieve what i could easily do in self-serving mode.

Hope this is clear!

Walaa avatar
Walaa
Support Team
Posts: 14994
Joined: 21-Aug-2005
# Posted on: 13-Jun-2008 09:53:02   

Yes you can. The following example os copied from the manual:

DataAccessAdapter adapter = new DataAccessAdapter(); CustomerEntity customer = new CustomerEntity(); customer.CompanyName = "Chop-suey Chinese"; adapter.FetchEntityUsingUniqueConstraint(customer, customer.ConstructFilterForUCCompanyName());

Anthony
User
Posts: 155
Joined: 04-Oct-2006
# Posted on: 13-Jun-2008 15:11:42   

thank you! Solution found!