Property-ref will be ignored. Maybe it's not implemented for this case. Here i think this is the case we need http://nhjira.koah.net/browse/NH-1220 . I hope it will be implmented soon.
On 30 Jul., 19:04, similitude2009 <[email protected]> wrote: > I am tring to do the same thing using foreign-key and property-ref but > none seems to work. > > Employe > {int id; > string name; > int IdEmployeType; > } > > EmployeType > {int Id; > string EmployeTypeName; > > } > > The data are in 2 tables with a foreign key between > Employe.IdEmployeType and EmployeType.Id > > I want to do this > Employe > {int id; > string name; > string EmployeTypeName; > } > > Then in the mapping of Employe i try > > <?xml version="1.0" encoding="utf-8" ?> > <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" default- > lazy="false"> > <class name="Employe" table="Employe" batch-size="200"> > <id name="Id" column="ID" type="Int32" unsaved-value="0"> > <generator class="native" /> > </id> > <property name="Name" column="Name" type="String" /> > <join table="EmployeType" fetch="select" optional="true"> > <key column="Id" foreign-key="IdEmployeType"/> > <property name="EmployeTypeName" column="EmployeTypeName" > type="String"/> > </join> > </class> > </hibernate-mapping> > > or > > <join table="EmployeType" fetch="select" optional="true"> > <key column="Id" property-ref ="IdEmployeType"/> > <property name="EmployeTypeName" column="EmployeTypeName" > type="String"/> > </join> > > None works. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nhusers?hl=en -~----------~----~----~----~------~----~------~--~---
