Can I configure an NHibernate named procedure to skip certain properties
when loading objects? These are not columns in the table that I want to
ignore; they are properties on the object that don't correspond to columns,
and I want to leave them as null when using the named procedure. (There are
other situations where I do want to populate these properties).
Details: I have an Inspection object which has many properties read from a
SQL table, and one property computed using a formula:
...
<property name="InspectionDate" type="DateTime" not-null="false" />
<property name="LastCompletedDate" type="DateTime" not-null="false"
formula="(select max(.....long formula.....)"/>
...
This works fine when NHibernate loads an inspection. The problem comes when
I use a stored procedure to get a list of Inspections:
<sql-query name="GetOverdueInspection">
<return class="Inspection" />
exec dbo.usp_GetOverdueInspection :dueDate
</sql-query>
This throws an exception trying to load the Inspection objects. *Can I tell
NHibernate to simply leave
this property blank when using the named query?*
More detail in my original question at
stackoverflow.com<http://stackoverflow.com/questions/16286729/nhibernate-named-query-how-can-i-ignore-properties-whose-mappings-are-defined>
.
--
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/nhusers?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.