Query by Criteria

View: New views
3 Messages — Rating Filter:   Alert me  

Query by Criteria

by Kevin Roll :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Are there any plans to add Query by Criteria to the JDO standard? I'm  
referring to a programmatic API to build queries, similar to what  
Hibernate already has and JPA is planning to add.

If not, does anyone know of another route to achieving this  
functionality? Are there any libraries that can be layered over JDO to  
get this? Should I write my own?

Thanks for any insight.


Re: Query by Criteria

by Andy Jefferson-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> Are there any plans to add Query by Criteria to the JDO standard? I'm
> referring to a programmatic API to build queries, similar to what
> Hibernate already has and JPA is planning to add.
>
> If not, does anyone know of another route to achieving this
> functionality? Are there any libraries that can be layered over JDO to
> get this? Should I write my own?

QueryDSL already does that for JDOQL
http://source.mysema.com/display/querydsl/Querydsl
I'm sure the guys who wrote it would love to hear feedback ;-)

--
Andy
DataNucleus (http://www.datanucleus.org)

Re: Query by Criteria

by Kevin Roll :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Jul 1, 2009, at 12:22 PM, Andy Jefferson wrote:

>> QueryDSL already does that for JDOQL
> http://source.mysema.com/display/querydsl/Querydsl

Thanks for the pointer, Andy. QueryDSL looks cool but I'm not certain  
it's exactly what I'm looking for. In fact, their type-safe objects  
may be too extreme for my purposes.

My general use case is that I present a GUI to the user with a large  
number of potential search criteria. When they hit the search criteria  
I want to build a query based upon what they have entered/selected.  
This query may involve complex nesting of ands and ors, which is one  
of the main problems I am trying to solve. I have hacked together  
something that generally works and is able to translate into a JDOQL  
query, but I was hoping that better minds had looked at the issue.  
Usually I am building the query on the fly - I rarely do preassembled  
queries based upon a specific query class.