openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aroche <>
Subject Deleting based on CriteriaQuery
Date Thu, 07 Feb 2013 10:26:51 GMT
We are using a 3rd party tool for displaying table lists on screen
(specifically Vaadin CriteriaContainer though it probably doesn't matter
here). It uses CriteriaQueries for filtering data in the table.

One of the use cases is to delete all items that match the filter (which is
basically a CriteriaQuery).

I'm looking for the cleanest way in OpenJPA to convert a CriteriaQuery
JPA 2.1 introduces this functionality but obviously that is some way off in
the future.

So one solution I'm thinking about is to get the QueryImpl from the typed
ie. org.apache.openjpa.persistence.QueryImpl query =

Then to get the Select query and do wrap in a delete and bind the parameters
etc to perform the delete.

Would this work?
Is there a neater way to do this? ie. using QueryImpl, or TypedQuery etc.?

Thanks for any advice!

View this message in context:
Sent from the OpenJPA Users mailing list archive at

View raw message