Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quarkus 3 -> PanacheRepoqueries SemanticException #35812

Closed
dennan94 opened this issue Sep 8, 2023 · 2 comments · Fixed by #39264
Closed

Quarkus 3 -> PanacheRepoqueries SemanticException #35812

dennan94 opened this issue Sep 8, 2023 · 2 comments · Fixed by #39264
Labels
area/hibernate-orm Hibernate ORM area/panache kind/bug Something isn't working
Milestone

Comments

@dennan94
Copy link

dennan94 commented Sep 8, 2023

Describe the bug

When using the chars "fk" in a package name where entities are located all queries will give:

Unexpected exception thrown: java.lang.IllegalArgumentException: org.hibernate.query.SemanticException: A query exception occurred [FROM org.fk.test.test.entity.Test WHERE id= ?1]

I've tested most versions from 3.0.0.Final to 3.3.2.

Same issue when using FK in class name.

The issue occured when updating from Quarkus 2 to 3.

Expected behavior

Entity with populated data or null

Actual behavior

Unexpected exception thrown: java.lang.IllegalArgumentException: org.hibernate.query.SemanticException: A query exception occurred [FROM org.fk.test..entity.FooEntity]

How to Reproduce?

Create a package structure with fk in:
org.fk.test..entity;

Create an entity

@Entity public class FooEntity extends PanacheEntity { private String test; }

Create a test:

@Test
@TestTransaction
void findAll() {
    assertDoesNotThrow(() -> FooEntity.findAll().firstResult());
}

Unexpected exception thrown: java.lang.IllegalArgumentException: org.hibernate.query.SemanticException: A query exception occurred [FROM org.fk.test..entity.FooEntity]
org.opentest4j.AssertionFailedError: Unexpected exception thrown: java.lang.IllegalArgumentException: org.hibernate.query.SemanticException: A query exception occurred [FROM org.fk.test..entity.FooEntity]

Output of uname -a or ver

No response

Output of java -version

17

GraalVM version (if different from Java)

No response

Quarkus version or git rev

3.3.2

Build tool (ie. output of mvnw --version or gradlew --version)

gradlew 8.3

Additional information

No response

@dennan94 dennan94 added the kind/bug Something isn't working label Sep 8, 2023
@quarkus-bot
Copy link

quarkus-bot bot commented Sep 8, 2023

/cc @FroMage (panache), @loicmathieu (panache)

@marko-bekhta
Copy link
Contributor

Hey, thanks for reporting this. In this case, probably both ORM (https://hibernate.atlassian.net/browse/HHH-17823) and Panache could've been more forgiving to "keywords" in the package name 😃

@quarkus-bot quarkus-bot bot added this to the 3.9 - main milestone Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/hibernate-orm Hibernate ORM area/panache kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants