-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Mapping to the same table
PostPosted: Tue Mar 27, 2012 7:47 am 
Newbie

Joined: Tue Mar 27, 2012 7:30 am
Posts: 1
HI,
I want to create tow entities for the same table without discriminator. Lets sey that my table represent Person and I would like to create 2 entity classes: Person and PersonExt. Person will contain most of the table columns like : name, Age, Adress ext. and the PersonExt class will inharit from the Person class and will contain mappinge to the rest of the columns in the Person Table. I don't want to create an additional mapping file for the PersonExt that will conatin mapping to all the Person filed again - but just mappings for the rest of the columns that I've not mapped to yet. Is it possible with NHibrnate? and if so, can you explain how?

Public Class Person
{
public virtual string Name {get;set;}
public virtual int Age {get;set;}
public virtual string Address{get;set;}
}

Public class PersonExt:Person
{
public virtual int NumOfChildren {get;set;}
public virtual string FamilyStatus {get;set;}
......

}


Thanks!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.