This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi, I just play around with the new feature "ClassTableInheritance". I expected that there is a reference from ChildA (PK) to BaseEntity (PK) or did I get the concept wrong? Kind regards, Sörnt |
|
|
We don't create a foreign key from the child table to the base table. We're open to feedback on this if people think it's important/useful to have a FK there, though it will complicate the implementation so no promises! |
|
|
It just makes is more clear when creating a DB diagram that shows up the relations. If it is hard to implement, keep it for an update :-) Are there any known limitations/issues using the "ClassTableInheritance"?
|
|
|
Thanks for the feedback -- we'll take a look at whether this is easy to do. Regarding known limitations/issues: * We believe that designer support is complete. * Runtime support is mostly complete, but there is some further testing yet to do (and if it ain't tested, it ain't done). Specifically, we have not tested class table inheritance with optimistic concurrency checking or soft deletion. We also strongly expect that there are some unknown issues or limitations which our testing has not yet uncovered. Please do let us know when you run into bugs. * We have identified some scope for tuning but are unlikely to ship this in the first drop. * One limitation is that you cannot use the IdentityColumn identity method with class table inheritance. This is because if ID allocation was left to the database, it would result in each "bit" of the entity getting a different ID. |
|
|
Ivan, just to check with you again - when we use the ClassTableInheritance, we're not to create the foreign key between the base and the derived class (with the id)? Just wanted to check because when I look at the generated sql, it seems to be inserting into the derived class first, before it inserts into the base class (causing a foreign key constraint error). This is using the Keytable method for the id. Let me know. Thanks. |
|
|
Correct: don't create a foreign key. At the moment, LightSpeed will typically execute the inserts in most-derived-first order, which is not compatible with a foreign key constraint. (Qualifiers because I wouldn't want anyone to rely on that behaviour!) |
|
|
The name of the PKs in each table within the hierarchy needs to be identical. Otherwise you will get an error saying that a field is missing. LS (3.11) doesn't respect the value of the "Identity Column Name". |
|