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
|
I try to use concrete table inheritance scheme for entities. In my case both base and inherited class will be instantiated, so I don't use abstract base class. Unfortunately Lightspeed crashes in this case with LightSpeedException : "Descendent type [Mindscape.LightSpeed.Tests.LSModel.EntityHInherited] of type [Mindscape.LightSpeed.Tests.LSModel.EntityHBase] is not discriminated." AFAIK concrete inheritance doesn't require discriminators and DB scheme editor doesn't show discriminator field in this case. I haven't checked whether it works for abstract base class. I attach our Lightspeed test project with appropriate test added: Entitiesshouldsupportconcretetable_inheritance in file LightSpeedTests1.cs. |
|
|
If you are using Concrete table inheritance there is no EntityHBase entity type, it is purely a base class, so the act of trying to work with it is what is triggering the exception. We strongly recommend these base classes are marked abstract to avoid confusion around trying to instantiate and operate against them directly. See http://www.mindscapehq.com/documentation/lightspeed/Domain-Modelling-Techniques/Inheritance for details on this - in particular note the comment about "you cannot have associations to a base class or perform queries for a base class". In your test if you remove the code associated with instantiating a new EntityHBase and the enumerator of UnitOfWork.EntityHBases (which is not generated if its marked as abstract btw) then the test will pass.
|
|
|
OK, I get it. Thank you for the explanation! :-) |
|