-->
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: Complex criteria query on to Associations
PostPosted: Thu Mar 31, 2005 7:28 pm 
Newbie

Joined: Thu Mar 31, 2005 7:12 pm
Posts: 1
Hi all

I have a model structure like this:

Companies whose have many managers whose have many benefits

benefits has a name and a value (eg 'laptop' as name and 'acer' as value)

I would like to make a criteria query to know which companies has managers with 'acer'- 'laptop' and 'ericson' - 'cellphone'

simple adding Criterion to a Criteria like this

Criteria c = session.createCriteria(Company.class).createCriteria("managers").createCriteria("benefits");

give no results since hibernate tryies to find a benefit that has name 'laptop' and 'cellphone'

I tried using disjunction to agregate criterions before adding them to the criteria but hibernate gave me back all the companies that has a manager with at least one of the benefits

Sadly all the maping file and the properties are in italian and are almost unreadable... but they work great for the all aplication...


thanks folks!

Sammy


Hibernate version: 3


[/b]


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.