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: Criteria API is great but could be even greater
PostPosted: Tue Jun 01, 2004 8:16 am 
Beginner
Beginner

Joined: Wed Nov 05, 2003 7:51 am
Posts: 22
Hi All,

I was wondering why the Criteria API is so restricted at some places. It was such a good idea to create it and it could be used much more flexibly.
Some ideas:

1) It is a pity that the expressions once created cannot be examined at all. There is no getXXX() method for any of the attributes of the Expression subclasses and no access for the expressions stored in the Criteria object.
I could use the Criteria API for completely Hibernate independent purposes (now I have to write something very similar to the Criteria API).

2) It would be nice if I could render HQL WHERE parts with it (this way I could simply render the criteria and include it into the WHERE part of an HQL query). Of course this would raise the issue of separating the rendering functionality from the Expression classes since they currently seem to host the SQL rendering functionality. It would make more sense to create separate renderer classes which would traverse the expression tree and generate something (e.g. one HQLRenderer could render an HQL WHERE clause, an SQLRenderer could render the direct SQL WHERE clause...etc). Of course traversing needs solving problem 1.

Of course, I am aware that the Criteria API was primarily created for simple cases where the user needs to execute a Hibernate query but it could be used much more flexibly.

Andras


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.