Hi, I'm trying to make a set with special needs and I have read a lot of page without luck.
Lets suppose that I have a mapping of a Sql View
<class name="Namespace.ViewName, Assembly" table="ViewName">
<id name="MyColumnIdOfThisView" column="[MyColumnIdOfThisView]" type="System.Guid"> <generator class="assigned"/> </id> <property name="AForeignKey" column="[AForeignKey]" access="field.pascalcase-underscore" not-null="true" type="System.Guid"/> </class>
And lets suppose that I have other mapping like this:
<class name="Namespace.MyClassName, MyAssembly" table="MyClassName" >
<id name="Id" column="MyClassIdColumnName" type="System.Guid"><generator class="guid"/></id> <property name="AForeignKey" column="AForeignKey" access="field.pascalcase-underscore" not-null="false" type="System.Guid" insert="true" update="true"/>
</class>
Where AForeignKey from view and AForeignKey from class store the same values, so we can make a inner join but are named different. For example: CaseID, AssociatedID
What I want to do is a mapping of set using this foreign keys. Something like this (in the view)
<set name="MyClassNameList" cascade="none" inverse="true" lazy="true" access="field.pascalcase-underscore"> <Source key> <column name="CaseID" /> </Source key> <Target key> <column name="AssociatedID"/> </Target key> <one-to-many class="MyNamespace.MyClassName, GIOFACT_DAL"/> </set>
Is this possible? A lot of thanks in advance!
Best,
|