I have 2 classes : Student and Academic.
In Student class i have a private field mAcademicInfo and I actually expose its properties as properties of Student e.g. InstitutionType and Institution
Code:
private Academic mAcademicInfo;
public virtual Academic.InstitutionTypeEnum InstitutionType {
get { return mAcademicInfo.InstitutionType; }
}
public virtual string Institution {
get { return mAcademicInfo.Institution; }
}
The mapping is:
Code:
<many-to-one cascade="none" name="mAcademicInfo" column="SchoolCode" access="field" />
where SchoolCode is the column in Student table that I keep the primary key of the Academic table.
Ok..this is the weird part:
when i fetch a Student I get the following sql :
NHibernate: select student0_.ID as ID2_ ... where student0_.Identifier=@p0); @p0 = '06057786'
NHibernate: SELECT academic0_.SchoolCode as SchoolCode3_0_ ... WHERE academic0_.SchoolCode=@p0; @p0 = '106'
NHibernate: UPDATE Academic SET InstitutionType = @p0, Institution = @p1 ... WHERE SchoolCode = @p5; @p0 = 'AEI', ... , @p5 = '106'
It issues an UPDATE but I cant imagine why!!!!!
Anyone's got a clue??