jungm commented on code in PR #2550:
URL: https://github.com/apache/tomee/pull/2550#discussion_r2940993490


##########
container/openejb-jakarta-data/src/main/java/org/apache/openejb/data/handler/RepositoryInvocationHandler.java:
##########
@@ -529,19 +482,22 @@ private Object handleDeleteAnnotation(final EntityManager 
em, final Method metho
         }
 
         if (hasByAnnotation) {
-            // Build JPQL DELETE with @By conditions
-            final StringBuilder jpql = new StringBuilder("DELETE FROM ")
-                .append(metadata.getEntityClass().getSimpleName()).append(" e 
WHERE ");
-            final List<String> conditions = new ArrayList<>();
-            for (int i = 0; i < params.length; i++) {
-                final jakarta.data.repository.By by = 
params[i].getAnnotation(jakarta.data.repository.By.class);
-                if (by != null) {
-                    conditions.add("e." + by.value() + " = :p" + i);
+            final String jpql = deleteJpqlCache.computeIfAbsent(method, m -> {

Review Comment:
   jpql cache should also be applied to other operations, not just delete



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to