tprohas wrote:
In regards to custom relations created in the LLBLGen designer, how does LLBLGen know if it's a 1-1 relation?
Quoting the docs:
Physical representation in the data model and LLBLGen Pro entities
The typical hierarchy mentioned above is realized in your datamodel with one table / view per entity. This means that for the hierarchy above you'll get an Employee table / view, a Manager table / view and a BoardMember table / view. The Employee table is the leading table, where you define the primary key for the entity to uniquely identify an entity instance in the database. As ID is a perfect candidate for this (1:1 relation between entity Employee and attribute) this will become the primary key. Manager and BoardMember get this same field, to identity the rows stored in these tables, though they're not new PK values, but have a foreign key constraint defined to the ID of the supertype, so Manager.ID has a foreign key constraint to Employee.ID and BoardMember has a foreign key constraint to Manager.ID. This way, referential integrity rules in the database make sure your data stored in the database is correct, also for derived entities.
And the important note:
Don't use surrogate keys on the subtype tables, it's important the PK of the subtype tables has the foreign key to the supertype's PK.
So, you must make your two entities like:
Supertype
SomeUniqueField (PK)
SomeOtherField
...
SubType
SomeUniqueField (PK)
SomeSpecificField
...
Then you will be able to make your 1:1 relation.