I have the following mappings:

  <class name="Person" table="`Person`">
    <id name="ID" column="`ID`" unsaved-value="0">
      <generator class="native" />
    </id>

    <property name="Name" column="`Name`" not-null="true" />

    <bag name="AuditLogs" lazy="true">
      <key column="`ParentID`" />
    </bag>
  </class>

  <class name="AuditLog" table="`AuditLog`">
    <id name="AuditID" column="`AuditID`" unsaved-value="0">
      <generator class="native" />
    </id>

    <discriminator column="`EntityName`" not-null="true" />

    <property name="OperationHost" column="`OperationHost`" not-
null="true" update="false" />
    <property name="OperationTime" column="`OperationTime`" not-
null="true" update="false" />
    <property name="OperationType" column="`OperationType`" not-
null="true" update="false" />
  </class>

  <subclass name="PersonAudit" extends="AuditLog" discriminator-
value="Person">
    <join table="`PersonAudit`">
      <key column="`AuditID`" />

      <property name="Name" column="`Name`" not-null="true"
update="false" />

      <many-to-one name="Person" cascade="none" not-null="true" outer-
join="auto" update="false">
        <column name="`ParentID`" />
      </many-to-one>
    </join>
  </subclass>


I was expecting that when I access Person.AuditLogs, I would see WHERE
PersonAudit.ParentID = ? in the SQL query.  However, I see a WHERE
AuditLog.ParentID = ?, which fails.

Is there a way to force NHibernate to generate a SQL query with WHERE
PersonAudit.ParentID = ? ?

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to