Skip to content

"Composite Index" not working with inheritance #2099

Closed
@ValResnick

Description

@ValResnick

We want to create an index of multiple columns in our class. This seems not work, when inheritance is involved (in NH 5.2.1).

The base class:

<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
                   auto-import="false"
                   assembly="RADFoundation, Version=2.1.0.0, Culture=neutral, PublicKeyToken=null"
                   namespace="RADFoundation.ProblemDomain">
  <class name="PersistentObject" table="RAD_persistentobject" abstract="true" dynamic-update="true" lazy="true">
	<property name="PDO_Deleted" column="PDO_Deleted" index="INDEX_PDO_DELETED, CF_BASE_COMPOSITE_IDX" access="backfield"/>
  </class>
</hibernate-mapping>

The other class:

<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
                   auto-import="false"
                   assembly="WorkflowEngine, Version=2.1.0.0, Culture=neutral, PublicKeyToken=null"
                   namespace="WorkflowEngine.Model">
  <union-subclass name="WorkflowInstance" table="WFE_workflowinstance" abstract="false" dynamic-update="true" lazy="true" extends="RADFoundation.ProblemDomain.PersistentObject">
	<property name="IsActive" column="IsActive" index="CF_BASE_COMPOSITE_IDX" access="nosetter.camelcase-underscore"/>
	<property name="IsWaiting" column="IsWaiting" index="CF_BASE_COMPOSITE_IDX" access="nosetter.camelcase-underscore"/>
  </union-subclass>
</hibernate-mapping>

The table WFE_workflowinstance contains the index CF_BASE_COMPOSITE_IDX and INDEX_PDO_DELETED as well, but CF_BASE_COMPOSITE_IDX only contains the columns IsActive and IsWaiting and not the inheritated column PDO_Deleted.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions