openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fabio Martelli <>
Subject Re: working with slices
Date Mon, 19 Nov 2012 09:26:33 GMT

Il giorno 10/nov/2012, alle ore 17.11, Fabio Martelli ha scritto:

> Hi All,
> I'm working on some extensions around openjpa-slice but I have some difficulties to understand/configure
slice about delete operations.
> I ask for the following operation
> 	entityManager.createQuery("DELETE FROM MPObject p").executeUpdate();
> Since my MPObject exists on one and only one slice I obtain the following error message
> 	Caused by: org.apache.openjpa.lib.jdbc.ReportingSQLException: Invalid object name 'MPObject'.
{prepstmnt 175442873 DELETE FROM MPObject} [code=208, state=S0002]
> Have I missed something? Please, let me know how can I solve my problem.

Hi All,
since I didn't receive any suggestion I have approached the problem by overriding some behaviors.

In fact, I performed the following two changes:
1. modified executeDelete and executeUpdate methods of DistributedSQLStoreQuery and DistributedStoreQuery
classes in order to search for targets like done into the executeQuery method (same locations/classes).
2. overridden deleteAll and updateAll methods in order to use the provided QueryTargetPolicy
implementation to retrieve and set "targets".

Am I wrong? Any suggestions/comments/remarks are welcome.

If you think than my changes can be correct, I can open a new issue and attach the patch.
Please, let me know.

Best regards,

View raw message