Can I reuse component mapping in a projection?
Here is the mapping for the Vendor object:
<class name="Vendor" table="vendor">
...
<property name="Name" column="Name" />
<component name="Address" class="MyProject.Address, MyAssembly" >
<property name="Street" column="street" />
<property name="City" column="City" />
</component>
</class>
For the report, I would like to get these providers in the data transfer object, but reuse the Address component (since there are many fields and some formatting utility).
public class VendorDTO
{
public string Name;
public Address Address;
}
public class Address
{
public string Street;
public string City;
public string SomeUsefulBehavour();
}
Is this possible without splitting the address into its own table?
Thanks!
source
share