Hello
There is something i don't understand in the generated code about the 1-to-many relationship.
Maybe it's due to a lack of knowledge in this kind of tools, so I hope you could help me.
I have a table A with a primary key a_id, so A(a_id), and a table B with a primary key b_id and a foreign key a_id, so B( b_id, a_id ).
I think this is the good way to say "A owns several B but each B is owned by only one A".
So, the first time I looked into the generated code, I thought I would find something as :
class A { BCollection bs; }
class B { A a; }
I found the A class I expected, but the B class was different :
class B { Guid a_id; }
So, if I want to define a method which required information about B and A, but mainly about B, I would like be able to have only one parameter, which would be B, and get the matching A directly from B.
But in this case, i need to define two arguments, A and B.
An other sample case : If i retrieve an instance of B from the database, when i need to have the A instance which maps to this B instance, i can't store the instance of A in the B class, so i need to store the B class in the Bcollection of the A class.
What I would like is to create the link which are in the database in the class structure, so from the A class I would be able to get the B class and from the B class I would be able to get the A class.
Actually, only one of this two link is here.
So, could explain me the reason of a such class structure when there is a such 1-to-many relationship between two tables please ?
Why the 'many' part of the relationship is generated but not the '1' part ?
Thanks in advance.
Regards,