openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kevin Sutter <>
Subject Re: multiple search parameter
Date Thu, 15 Apr 2010 13:25:43 GMT
I'm assuming you are talking about allowing a user to select which fields to
search on and provide values for these search parameters.  If that's
correct, then this seems like a good example for the Criteria API in our
OpenJPA 2.0.x release.  The Criteria API is new for JPA 2.  This allows a
programmatic aspect to query generation.  Pinaki has written a nice white
paper on the Criteria API [1] to get you started.  You can also reference
the JPA 2 spec [2], but that gets a bit dry.  Another reference is the Pro
JPA 2 book [3] that was recently released.  Mike Keith, one of the authors,
was on the JPA expert group with Pinaki and myself and provides an
easy-to-understand view of the JPA 2 spec.

If you can't move to JPA 2 yet, then you could still use the JPQL
capabilities in JPA 1.  But, you will be required to do massive string
manipulation.  Especially since you are attempting to provide a flexible
interface for the queries.

Hope this helps,


On Wed, Apr 14, 2010 at 10:14 PM, sp reddy <> wrote:

> I have a scenerio where I have more than 15 fields to search from. Any
> combination should be valid.
> What is the best approach to accomplish this. Eg, user can search from
> entering 2 fields or all 15.
> Thanks in advance......
> --
> View this message in context:
> Sent from the OpenJPA Developers mailing list archive at

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message