New Posts New Posts RSS Feed: Code Gen Issue - EntityPropertyNames
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Code Gen Issue - EntityPropertyNames

 Post Reply Post Reply
Author
robdrye View Drop Down
Newbie
Newbie
Avatar

Joined: 05-Aug-2009
Posts: 22
Post Options Post Options   Quote robdrye Quote  Post ReplyReply Direct Link To This Post Topic: Code Gen Issue - EntityPropertyNames
    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.
 
 
 
Back to Top
GregD View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 374
Post Options Post Options   Quote GregD Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
robdrye View Drop Down
Newbie
Newbie
Avatar

Joined: 05-Aug-2009
Posts: 22
Post Options Post Options   Quote robdrye Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down