PanacheEntityBase.delete(String query, Parameters params) doesn't work with SQL prefix - java.lang.IllegalArgumentException: org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected token: DELETE #18502
Labels
Milestone
Describe the bug
If I pass the SQL DELETE prefix command to the
String query
of thePanacheEntityBase.delete(String query, Parameters params)
, I receive the following error:Example of
String query
:If I omit the SQL prefix as below, everything works fine:
Command:
I don't know if this is a bug or I misunderstood the
String query
parameter.The
find(String query, Parameters params)
andupdate(String query, Parameters params)
methods work perfectly with or without the SQL prefix.Expected behavior
PanacheEntityBase.delete(String query, Parameters params) should work with or without the SQL DELETE prefix.
Actual behavior
PanacheEntityBase.delete(String query, Parameters params) don't work with the SQL DELETE prefix.
To Reproduce
Access
http://localhost:8080/q/swagger-ui
.Here you can test the find(), update() and delete() methods with or without the SQL prefix:
Each endpoint has a Query Parameter named
useSqlPrefix
where you can choose if you will or not use the SQL prefix:Configuration
Environment (please complete the following information):
Output of
uname -a
orver
inux machine 5.8.0-59-generic #66~20.04.1-Ubuntu SMP Thu Jun 17 11:14:10 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Output of
java -version
openjdk version "11.0.11" 2021-04-20
OpenJDK Runtime Environment (build 11.0.11+9-Ubuntu-0ubuntu2.20.04)
OpenJDK 64-Bit Server VM (build 11.0.11+9-Ubuntu-0ubuntu2.20.04, mixed mode, sharing)
Quarkus version or git rev
2.0.1.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
)Apache Maven 3.8.1 (05c21c65bdfed0f71a2f2ada8b84da59348c4c5d)
Maven home: /home/helesto/.m2/wrapper/dists/apache-maven-3.8.1-bin/2l5mhf2pq2clrde7f7qp1rdt5m/apache-maven-3.8.1
Java version: 11.0.11, vendor: Ubuntu, runtime: /usr/lib/jvm/java-11-openjdk-amd64
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "5.8.0-59-generic", arch: "amd64", family: "unix"
The text was updated successfully, but these errors were encountered: