Aagh - I need help!

Posts   
 
    
Rushmore
User
Posts: 125
Joined: 27-Jan-2005
# Posted on: 01-Nov-2006 12:06:20   

I have problems create relations within the designer.

Example:

I have 2 tables Doctor and Address.

Doctor DoctorId (PK) AddressId (FK)

Address AddressId (PK)

If I add a new relation, the relations are generated (build) like this:

Address Relations Address - Doctor (1:n) Address.AddressId (1:n) Doctor.AddressId

Doctor Relations Doctor - Address (m:1) Doctor.AddressId (m:1) Address.AddressId

If I generate the code, I can´t access or prefech the Address from the DoctorEntity.

Ex. Doctor.Address.Name (because the Address property/collection isn´t generated)

But I can access the Doctor from the AddressEntity.

Ex. Address.Doctor.Faculty.

What does the m:1 mean? What´s wrong?

Regards, Carlo

LLBLGen Pro 2.0.0.0 (Sep, 13th 2006), latest runtime and templates (I hope)

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 01-Nov-2006 14:14:10   

(m:1) means many to one relation. Nothing wrong in this statement.

Please go to the LLBLGen Pro Designer, go to the Doctor Entity Properties. Then the "Fields on relation" tab. You will find a list of relations and their corresponding field names. Look for the "Doctor.AddressId (m:1)" relation, make sure it's not "Hidden" (Is Hidden = false), and find out what the corresponding "field name" is.

If the relation is Hidden you can un-Hide it by un-checking the "Hide" checkbox down the list.

Rushmore
User
Posts: 125
Joined: 27-Jan-2005
# Posted on: 02-Nov-2006 01:55:34   

Hello Walaa

after your reply, I have found that the name for the relation is not correct. I have changed the name, generated the code and it works! Thank you for the hint!

Regards, Carlo