Hi!
I'm trying to map a "result" class to be used in a SQL statement (not HQL, that is, I'm using
CreateSQLQuery) using NHibernate mapping attributes, but I had no success so far. Previously, using XML files I used the <import> inside a <hibernate-mapping>, like this:
Code:
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0" assembly="srvengine">
<import class="lcslink.ServerEngine.AlarmValue, srvengine"/>
<joined-subclass name="lcslink.ServerEngine.AlarmSample" lazy="true" table="event_sample" extends="lcslink.ServerEngine.Sample">
<key column="oid" />
<property name="Active" column="active" not-null="true" />
<property name="DownTimestamp" column="down_timestamp" not-null="true" />
<property name="AcknowledgedTimestamp" column="acknowledged_timestamp" not-null="true" />
<property name="AcknowledgedFlag" column="ack_flag" not-null="true" />
<many-to-one name="User" column="login_id" not-null="false" />
</joined-subclass>
</hibernate-mapping>
I thought that when using mapping attributes, it would be just a matter of adding an Import to a class like this:
Code:
<Import()> _
Public Class Item
Public Value As String
Public MeasureQuality As String
End Class
But the attribute must be attached to a Field or Property... What am I missing here?
Has anyone done this? :-)
Thanks for any help!
NHibernate.Mapping.Attributes version: 1.0.2.0