New NHibernate - Entity Developer user, I just ran the wizard on my existing large database, all entities came in so far so good, then I started the process of adding all the inherited sub classes, since our database has many single table hierarchies, the wizard only brought in the main table - entities, and all the fields and associations are loaded into the base class. I found that I can create the subclasses and copy pasted the fields/properties from the base class over to the sub-classes, great!. However It wont let me do that with the associations (navigation properties) Please tell me there is a simple way because my database is over 150 tables and the object model with inherited classes is huge, and I have many, many hundreds of associations to move down to all the sub classes.
thanks
JAMES
How can I copy/paste associations
Re: How can I copy/paste associations
Entity Developer loads fields and associations into the base model class when the TPH inheritance type is used. We consider that this behaviour is correct.jamesklett wrote:all the fields and associations are loaded into the base class
Re: How can I copy/paste associations
There is a drag&drop functionality which allows to avoid copy/past-ing: http://www.devart.com/entitydeveloper/e ... eloper.chm > NHibernate > Concepts > Working with Inheritances > Table per Hierarchy.jamesklett wrote:I found that I can create the subclasses and copy pasted the fields/properties from the base class over to the sub-classes
Please open Association Editor (right click on the association > Edit) and change the Relation Class property of the corresponding end from the base class to descendant.jamesklett wrote:However It wont let me do that with the associations (navigation properties)
-
- Posts: 7
- Joined: Tue 08 Jan 2013 17:42
Re: How can I copy/paste associations
1. It isn't correct because then all child classes will have acces to relations that don't make sense for them.
2. The edit option does not appear to work. Yes I change the class but the association do not move. It is still in the base class.
3. Drag drop does not work to move the association
thanks
JAMES
2. The edit option does not appear to work. Yes I change the class but the association do not move. It is still in the base class.
3. Drag drop does not work to move the association
thanks
JAMES
Re: How can I copy/paste associations
1. Entity Developer doesn't know about your model logic. That's why it adds an association to the base class of the TPH inheritance. You should modify the association manually.
2. We cannot reproduce the problem. Please send us a test model and specify the steps we should follow.
3. This is a designed behaviour. We are investigating the possibility of moving associations to childs of the TPH inheritance in a more easier way.
2. We cannot reproduce the problem. Please send us a test model and specify the steps we should follow.
3. This is a designed behaviour. We are investigating the possibility of moving associations to childs of the TPH inheritance in a more easier way.