-->
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: Criteria using component property
PostPosted: Tue Oct 07, 2003 8:13 am 
Beginner
Beginner

Joined: Tue Oct 07, 2003 4:41 am
Posts: 21
Hi,

this might be a stupid question...

I have a mapping ...

Code:
<hibernate-mapping>
   <class name="ims.domain.model.Common.Patient" table="SID"  >
      <id name="id" column="pkey" type="long">
         <generator class="increment" >
         </generator>
      </id>
      <component name="currentName" class="ims.domain.model.Common.Name" >
         <property name="surname" column="snm" />
         <property name="forename" column="fnm1" />
         <many-to-one name="title" class="ims.domain.model.Lookup" column="titl"/>
      </component>
      <property name="dob" column="dob" />
      <property name="dod" column="dod"/>
      <many-to-one name="sex" class="ims.domain.model.Lookup" column="sex"/>
      <one-to-one name="currentAddress" class = "ims.domain.model.Common.Address" />
   </class>
</hibernate-mapping>


and I want to use the Criteria class to retrieve Patients based on a "surname" search. My question is, what should I put into the Expression in order to search on the "surname" property which is in the "currentName" component?

TIA

John


Top
 Profile  
 
 Post subject: Criteria using component property
PostPosted: Tue Oct 07, 2003 9:24 am 
Beginner
Beginner

Joined: Tue Oct 07, 2003 4:41 am
Posts: 21
Sorry, it was a stupid question.
I founf the solution.
I simply have to use "<component name>.<property name>" as the first arg to the Expression.eq(...) call.

John


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.