-->
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.  [ 2 posts ] 
Author Message
 Post subject: path expression ends in a composite value ?
PostPosted: Tue Dec 28, 2004 7:11 am 
Newbie

Joined: Thu Jun 10, 2004 5:37 am
Posts: 19
Hi,

I have a problem with the use of composite-id in a query :


Hibernate version:
Hibernate 2

Mapping documents:
<class name="vdm.admepo.dao.hbbean.HbEleCandidat" table="ELE_CANDIDAT">
<meta attribute="implements">sopra.twork.dao.hibernate.HbBeanVdm</meta>
<meta attribute="extends">sopra.twork.dao.hibernate.HbBean</meta>
<composite-id>
<key-property name="idIndividu" column="ID_INDIVIDU" type="java.lang.Long"/>
<key-property name="idListeCandidate" column="ID_LISTE_CANDIDATE" type="java.lang.Long"/>
</composite-id>

<version name="optimistLock" column="OPTIMIST_LOCK" type="java.lang.Long"/>

<property name="numOrdre" column="NUM_ORDRE" type="java.lang.Long" not-null="true"/>
<property name="zzzDcrEng" column="ZZZ_DCR_ENG" type="timestamp" length="7"/>
<property name="zzzIdUtiCree" column="ZZZ_ID_UTI_CREE" type="java.lang.Long" length="22"/>
<property name="zzzDmoEng" column="ZZZ_DMO_ENG" type="timestamp" length="7"/>
<property name="zzzIdUtiModi" column="ZZZ_ID_UTI_MODI" type="java.lang.Long" length="22"/>
<property name="zzzDsuEng" column="ZZZ_DSU_ENG" type="timestamp" length="7"/>
<property name="zzzIdUtiSupp" column="ZZZ_ID_UTI_SUPP" type="java.lang.Long" length="22"/>
</class>

Full stack trace of any exception that occurs:
path expression ends in a composite value: hbelecandi0_ [SELECT count(cand) FROM vdm.admepo.dao.hbbean.HbEleCandidat cand WHERE cand.idIndividu = 6851 AND cand.idListeCandidate = 1241 AND cand.zzzDsuEng IS NULL]



Name and version of the database I'm using:
Oracle 9i





Thanks for your help



Nico


Top
 Profile  
 
 Post subject: Solution
PostPosted: Tue Dec 28, 2004 1:03 pm 
Newbie

Joined: Thu Jun 10, 2004 5:37 am
Posts: 19
By the way I've found myself how to solve the problem. I don't know why, but I have to use the function count on a property of the table mapped (for example idIndividu) and not on the whole table.

Then I must do :
SELECT count(cand.idIndividu) FROM HbEleCandidat cand


And not :
SELECT count(cand) FROM HbEleCandidat cand


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

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.