SelectOne in 2.0?

Posts   
 
    
Wingnut
User
Posts: 8
Joined: 20-Apr-2005
# Posted on: 20-Apr-2005 22:29:54   

I am just getting around to converting a project from llbl 1.0 to 2.0. I made extensive use of the SelectOneWXXXXLogic method in the old classes. Is there an equivilant way to load a record based on a unique foriegn key?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 20-Apr-2005 23:22:57   

You mean from LLBLGen 1.x dal generator to LLBLGen Pro ? The code is completely different. TO load an entity using a unique constraint, you have to use the proper methods to do so which differ in selfservicing or adapter. Which are you using?

Frans Bouma | Lead developer LLBLGen Pro
Wingnut
User
Posts: 8
Joined: 20-Apr-2005
# Posted on: 21-Apr-2005 00:55:47   

I am using the Adapter configuration. Here is the code I use in DAL 1.0

Dim sr As New ld_masterLLBL.clsLd_ins_submission sr.iResident_id = (SqlTypes.SqlInt32.Parse(resident_id)) sr.SelectOneWresident_idLogic()

My entity (ins_submission) has a unique PK which is essentially a autonumber field and a FK (resident_Id) which has a unique index.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 21-Apr-2005 09:13:07   

Wingnut wrote:

I am using the Adapter configuration. Here is the code I use in DAL 1.0

Dim sr As New ld_masterLLBL.clsLd_ins_submission sr.iResident_id = (SqlTypes.SqlInt32.Parse(resident_id)) sr.SelectOneWresident_idLogic()

My entity (ins_submission) has a unique PK which is essentially a autonumber field and a FK (resident_Id) which has a unique index.

I'd suggest you to read the section in the manual: Using the generated code -> Adapter -> Using the entity classes, in which this is discussed.

Ins_submission is = new Ins_submission(resident_id); DataAccessAdapter adapter = new DataAccessAdapter(); adapter.FetchEntity(is);

Frans Bouma | Lead developer LLBLGen Pro