-->
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: Community Question :Criteria --adding vs. creating
PostPosted: Thu Aug 12, 2004 10:31 am 
Newbie

Joined: Mon Mar 22, 2004 3:37 pm
Posts: 13
A have a simple Criteria generator that traverses a network of objects rooted in single object implementing an Interface I call QueryObject. The basic algorithm is:

1) Add Criterion for all basic properties.
2) Add Criteria for a non-null composite objects; recurse to 1
3) Add Criteria for all non-null collections recurse to 1

It works great in a captive environment! In the real world it falls down. The problem is that in step 2 and 3 I "add" a Criteria without knowing if that Criteria will have any Criterion. We are using a Spring/JSP front in which likes to have an empty network of objects to bind to, thus the QueryMachine is being passed an QueryObject with composite objects and collections of composite objects which generate no Criterion.

This results an what is basically a "where exists" outer join. So my questions are:

1) Was the ability to add an outer join Criteria added to Hibernate and will that solve my problem?

2) Alternatively, can I create a subordinate Criteria and add them to other Criteria after determining if subordinate Criteria has any Criterion. Something like myCriteria.add(subordinateCriteria)

3) Other suggestions?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 12, 2004 11:24 am 
Newbie

Joined: Mon Mar 22, 2004 3:37 pm
Posts: 13
I think I have solved the problem myself ...hold your applause, please. It appears that it possible to create Criterion without a Criteria and add the Criterion to the Criteria later. I will post back if true.


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.