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
|
This should hopefully be a pretty trivial question to answer. I have a model which uses classtable inheritance between a 'Person' table and an 'Athlete' table. When I add new Athletes to my repository and call SaveChanges on the UnitOfWork, I get the error: "Can't use IdentityColumn identity method with class table inheritance" What IdentityMethod should I be using for tables which are involved in classtable inheritance relationships? Cheers, B |
|
|
You can use any method where the ID is assigned by LightSpeed rather than retrieved from the database after insert -- which at the moment means any method other than IdentityColumn. (The reason being that class table inheritance relies on the same ID being inserted in each of the tables in the hierarchy, which you can't guarantee if the database is allocating the IDs.) For numeric IDs, we recommend KeyTable. You can also use Sequence or MultiSequence on Oracle or PostgreSQL (but KeyTable is preferred because it is easier to tune). For GUID IDs, use Guid. You can also use GuidComb if you concerned about indexing performance. |
|