I am using NHibernate with a stored procedure but I am having trouble populating a complex type.
When not using a stored proc I would set up the mapping like this…
<property name="RoleEndDate"
type="Mdl.Common.Persistence.EndDateUserType, Mdl.Common.Persistence">
<column name="DateEnd"/>
<column name="DateEndAssumed"/>
</property>
However when I try the same thing with sql-query mapping my EndDateUserType class fails as the column names passed to it are not found in the data reader. The names are the NHibernate generated names (eg. DateEnd14_0_) rather than the actual column names (DateEnd).
Is is possible to map to complex types when running with a stored proc?
You need to map the columns in the sql-query part of the mapping file too, like this…