Print Page | Close Window

Code Gen Issue - EntityPropertyNames

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2009
Forum Discription: For .NET 3.5
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=1583
Printed Date: 19-Apr-2024 at 12:05pm


Topic: Code Gen Issue - EntityPropertyNames
Posted By: robdrye
Subject: Code Gen Issue - EntityPropertyNames
Date Posted: 12-Dec-2009 at 7:31am
I'm running into an issue after trying to implement an 'Injected Base Type' for an existing Entity Model.  Following the associated code gen the entities inherit from the injected base type as expected however the EntityPropertyNames class is updated to inherit from a class that does not exist.  For example if my injected base type is called 'DataEntityBase' the EntityPropertyNames class inheritance will change from 'IdeaBlade.EntityModel.Entity.EntityPropertyNames' to 'DataEntityBase.EntityPropertyNames'. 
 
I'm on v5.2.3.1.
 
 
 



Replies:
Posted By: GregD
Date Posted: 14-Dec-2009 at 4:50pm
Ah, but DataEntityBase does have a nested EntityPropertyNames class; it's just that it gets it from Entity (which it inherits) which gets it from EntityWrapper (which Entity inherits).
 
If you were explicitly to define an EntityPropertyNames class in DataEntityBase, then that explicitly defined class would shadow the one that DataEntityBase inherits.
 
The idea here is that at any level in your hierarchy where you define properties, you may want also to define corresponding EntityProperyName constants; and you want anything that subclasses your class to get its set of EntityPropertyName constants as well.
 
If you were to define some properties in your DataEntityBase class, then all types that subclass DataEntityBase would get those properties by inheritance. Similarly, if you were to define some constants in your DataEntityBase.EntityPropertyNames class, then all types that subclass DataEntityBase.EntityPropertyNames  would get those constants by inheritance. But that would not be the case if the EntityPropertyNames class associated with your final type didn't inherit from DataEntityBase.EntityPropertyNames.


Posted By: robdrye
Date Posted: 15-Dec-2009 at 5:34am
Thanks for the response Greg.....as I was reading it I had a 'smack the palm of my hand to my forehead' moment when I realized I had overlooked inheriting from Entity in my DataEntityBase class!  That was my issue all along....
 
Thanks again for the quick response.



Print Page | Close Window