-->
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: CreateCriteria Filtering on Child Property
PostPosted: Tue Dec 06, 2005 8:02 am 
Newbie

Joined: Tue Jun 21, 2005 5:37 am
Posts: 2
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:2.1.6

I have implemented some filtering of data using CreateCriteria which works fine for the first level objects:

crit = session.createCriteria(PortfolioList.class);

crit.createCriteria(EmployeeTeam).add(Expression.ilike(
"status", "A",
MatchMode.ANYWHERE));

How can I provide filtering when the data provided refers to a lower level. In the above case where EmployeeTeam is a mapping object mapping employees to teams I would want to filter based on say a team description
something like:

crit = session.createCriteria(PortfolioList.class);

crit.createCriteria(EmployeeTeam).add(Expression.ilike(
"team.description", "UK",
MatchMode.ANYWHERE));

However this does not work. Am i going about this completely the wrong way?

_________________
ptc


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.