-->
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: one-to-many with query: isEmpty or element.property is equal
PostPosted: Wed Oct 12, 2005 8:07 am 
Newbie

Joined: Sun Jan 23, 2005 6:49 pm
Posts: 7
Hello,

I have simple set of elements.

Person {
Set<Event> events;
}

Event {
Person person;
String description;
}

I need to do simple query:

Criteria criteria = sesison.createCriteria(Person.class);
criteria.createAlias("events", "event");

criteria.add(Restrictions.or(Restrictions.isEmpty("events"), Restrictions.eq("event.description", "test")));

criteria.list();

With this line:
criteria.createAlias("events", "event");

result is always empty (list size is zero).

What do I do wrong? Isn't it possible to have this OR condition?

Best regards,
Piotrek

_________________
Piotr Bzdyl


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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.