-->
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.  [ 4 posts ] 
Author Message
 Post subject: Equality operator (=) doesn't work composite key?
PostPosted: Tue Apr 13, 2004 1:14 pm 
Beginner
Beginner

Joined: Fri Apr 02, 2004 1:20 pm
Posts: 23
I have a feeling I'm doing something very wrong, this simple query fails to parse:

Code:
select
    b2
from
    Benefit b1,
    Benefit b2
where
    b1.benefitType.code = 'H001' and
    b2 = b1


The error message is "path expression ends in a composite value: benefit1_". My mapping for Benefit is:

Code:
<class name="com.ff.model.life400.core.Benefit" table="LIFE400_VW_BENEFIT">
   
      <composite-id>
         <key-property name="policyNumber" column="CHDRNUM"/>
         <key-property name="lifeKey" column="LIFE"/>
         <key-property name="coverage" column="COVERAGE"/>
         <key-property name="rider" column="RIDER"/>
         <key-property name="jointLifeKey" column="JLIFE"/>
      </composite-id>

      <property name="sumInsured" column="SUMINS"/>
      
      <many-to-one name="riskStatus" column="STATCODE"/>
      
      <many-to-one name="benefitType" column="CRTABLE"/>

   </class>


I tried using a component composite ID and got the same problem. Am I going mad or is this simply not supported?

Thanks

Niall


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 13, 2004 4:50 pm 
Beginner
Beginner

Joined: Thu Feb 05, 2004 9:09 am
Posts: 27
You can


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 13, 2004 6:56 pm 
Beginner
Beginner

Joined: Fri Apr 02, 2004 1:20 pm
Posts: 23
You can actually, the code above would work fine if Benefit had an atomic PK.

I have tried all of the comparisons below but none parse correctly if the types have a composite key.

b1 = b2
b1.id = b2.id
b1.key = b2.key
b1.key.id = b2.key.id


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 14, 2004 6:02 am 
Beginner
Beginner

Joined: Fri Apr 02, 2004 1:20 pm
Posts: 23
Wonderful:

http://opensource.atlassian.com/project ... wse/HB-109


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.