Skip to content

Commit

Permalink
Use the proper PU for executeUpdate on entityClass
Browse files Browse the repository at this point in the history
Fixes #42314
Introduced by #41547

(cherry picked from commit cf5f6bb)
  • Loading branch information
gsmet committed Aug 8, 2024
1 parent bd2ab14 commit da7f588
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ public int executeUpdate(Class<?> entityClass, String panacheQuery, Object... pa

try {
String updateQuery = PanacheJpaUtil.createUpdateQuery(entityClass, panacheQuery, paramCount(params));
return bindParameters(getSession(DEFAULT_PERSISTENCE_UNIT_NAME).createMutationQuery(updateQuery), params)
return bindParameters(getSession(entityClass).createMutationQuery(updateQuery), params)
.executeUpdate();
} catch (RuntimeException x) {
throw NamedQueryUtil.checkForNamedQueryMistake(x, panacheQuery);
Expand Down

0 comments on commit da7f588

Please sign in to comment.