-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
JPA-Annotation @AttributeOverride at type level is not evaluated properly when also using orm.xml #19867
Comments
I just gave it a try on Quarkus 2.2.3.Final, and it works for me... Are you using the latest version of Quarkus, 2.2.3.Final? If not, which one? Are you sure you're using Are you using Panache? Can you provide a simple reproducer? |
I will try to strip down my current project so that I can extract a reproducer. |
I found out what is triggering the faulty-behaviour: |
@yrodiere
|
Thanks @fkeichfe . It seems to be a bug in Hibernate ORM; I filed a ticket upstream: https://hibernate.atlassian.net/browse/HHH-14827 . I will see what needs to be fixed in Hibernate ORM. |
This will get fixed in ORM 5.6.0.Beta2/5.5.8.Final. |
Describe the bug
I have an application with Quarkus using JPA, which has the following problem since I migrated from Quarkus 1.x to 2.x.
There exists a MappedSuperclass named BaseClass, with the following field, which is mapped by default to the database-column 'name':
Now I have another class named DerivedClass, where I want to map the field to another db-column 'custom_name'.
But apperently the AttributeOverride-Annotation is ignored at runtime, as the application tries to read the (not existing) db-column 'name' - and not the column 'custom_name', as required by the annotation.
I managed to fix the problem via the following entry in the orm.xml-file, but I wonder why the AttributeOverride-Annotation is broken since Quarkus 2.x
Expected behavior
Expected behaviour is that the database column custom_name is read.
Actual behavior
2021-09-02 14:51:52,332 WARN [org.hib.eng.jdb.spi.SqlExceptionHelper] (executor-thread-0) SQL Error: 0, SQLState: 42703
2021-09-02 14:51:52,333 ERROR [org.hib.eng.jdb.spi.SqlExceptionHelper] (executor-thread-0) ERROR: column derivedclass2_.name does not exist
How to Reproduce?
No response
Output of
uname -a
orver
No response
Output of
java -version
openjdk version "11.0.10" 2021-01-19 LTS
GraalVM version (if different from Java)
No response
Quarkus version or git rev
2.2.1.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
)Maven 3.8.1
Additional information
No response
The text was updated successfully, but these errors were encountered: