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
-~----------~----~----~----~------~----~------~--~---