Associations without foreign key constraints
Posted: Mon 01 Oct 2012 20:18
Hi, I'm wondering if it is possible to set associations between objects in entity developer even if there is no foreign key constraints in the underlying database. Yeah, I know having no such constraints is bad, but I'm working with an old system and I have to deal with that kind of stuff.
So, here's an example:
Table A contains a list of author and will be mapped to the author object.
Table B contains a list of books and will be mapped to the book object.
There is a logical mapping between the two tables, that is one author is associated with many books. Let's say I have a strange association column: author_name char(4) not nullable in the author table which maps to author_name char(4) nullable in the book table. Only there is no foreign key constraint to enforce this association.
Now I want to load one author in my C# application and I want to have all its book available too. I have to define the association in devart.
Is this possible? If not, any workarounds?
Any help will be appreciated,
Thanks a lot,
So, here's an example:
Table A contains a list of author and will be mapped to the author object.
Table B contains a list of books and will be mapped to the book object.
There is a logical mapping between the two tables, that is one author is associated with many books. Let's say I have a strange association column: author_name char(4) not nullable in the author table which maps to author_name char(4) nullable in the book table. Only there is no foreign key constraint to enforce this association.
Now I want to load one author in my C# application and I want to have all its book available too. I have to define the association in devart.
Is this possible? If not, any workarounds?
Any help will be appreciated,
Thanks a lot,