-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Problem with criteria on joined-subclass
PostPosted: Fri Dec 02, 2011 11:56 am 
Newbie

Joined: Fri Dec 02, 2011 11:25 am
Posts: 1
Hi,

I have the following mapping:

<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="GestionCaissesInfo" namespace="GestionCaissesInfo">

<class name="CaisseBase" table="`CaisseBase`" lazy="true">

<id name="IdCaisseBase" column="`idCaisseBase`" type="int">
<generator class="native" />
</id>

<property type="string" not-null="true" length="100" name="Nom" column="`nom`" />
<property type="string" not-null="true" length="3" name="Institution" column="`institution`" />
<property type="string" not-null="true" length="7" name="Transit" column="`transit`" />


<joined-subclass name="CaisseDeveloppement" extends="CaisseBase" table="CaisseDeveloppement" >
<key column="fk_idCaisseBase"/>

<property type="int" name="NombreFolio" column="`nombreFolio`" />
<property type="Boolean" name="Supportldap" column="`supportLDAP`" />
<property type="Boolean" name="EstObligatoire" column="`estObligatoire`" />omaineDomino`" />

</joined-subclass>


</class>
</hibernate-mapping>

I try to apply this criteria:

ICriteria critereCaisseBase = Session.CreateCriteria(typeof(CaisseBase));

ICriteria critereCaisseDeveloppement = critereCaisseBase.CreateCriteria("CaisseDeveloppement", NHibernate.SqlCommand.JoinType.LeftOuterJoin);

critereCaisseDeveloppement.Restrictions.Add(Restrictions.IsNull("IdCaisseBase"));

critereCaisseBase.List();

I've got the following error:

"could not resolve property: CaisseDeveloppement of: GestionCaissesInfo.CaisseBase"

How could I do a left join on CaisseDeveloppement? I don't want to use a subquery because, in some situation, I need to do something like: critereCaisseDeveloppement.AddOrder(...

I use nHibernate 2.0.1.4000 because the plateforme is .NET 2.0.

Thank you,


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.