Nhibernate joined subclass and orderby by base class

Hi Ive got a subclass and I am using this subclass on the bag however I want to use the order from the base class. But when I put the order to Nhibernate, use a subclass. Does anyone know how to do this, Ive put the mappings below.

If I run that sql does ordeby PersonDocument.Name but it should be Document.Name

Thank...

  <bag name="Documents" cascade="all" order-by="Name" >
    <key column="PersonId"/>
    <one-to-many class="PersonDocument" />
  </bag>


<?xml version="1.0" encoding="utf-8" ?>

      

                                           

  <many-to-one name="Type" class="DocumentType" column="DocumentTypeId" not-null="false" cascade="all" />


  <joined-subclass table="PersonDocument"  name="PersonDocument">
    <key column="DocumentId"/>
    <many-to-one name="EventGroupType" class="EventGroupType" column="EventGroupTypeId" not-null="false" cascade="all" />
  </joined-subclass>

</class>

      

+2
nhibernate


source to share


No one has answered this question yet

Check out similar questions:

nine
NHibernate Many-To-One on connected subclass with filter
6
NHibernate Discriminated Subclasses of Attached Subclass
3
NHibernate merged subclass
2
Many to many, like a map in fluent Nhibernate
2
Subclass Automation in Fluent NHibernate
2
nhibernate: concatenate tables for ordering
2
LINQ to NHibernate does not subclass, whereas QueryOver does
1
nhibernate is orphaned many-to-many as an individual class
1
NHibernate - exclude subclass using criteria with nested subclass
1
NHibernate 2.1.2 unsaved random instance



All Articles
Loading...
X
Show
Funny
Dev
Pics