Laurent Almeras (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiNDE2ZDRkZmY1...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-16641?atlOrigin=eyJpIjoiNDE2ZD...
) HHH-16641 (
https://hibernate.atlassian.net/browse/HHH-16641?atlOrigin=eyJpIjoiNDE2ZD...
) @OrderColumn fails for a generic collection with NPE on XProperty.getMapKey() (
https://hibernate.atlassian.net/browse/HHH-16641?atlOrigin=eyJpIjoiNDE2ZD...
)
Issue Type: Bug Affects Versions: 6.2.3 Assignee: Unassigned Components:
hibernate-entitymanager Created: 19/May/2023 06:15 AM Environment: JVM 17 / Linux / h2 /
postgresql
I think it is environment independant. Priority: Major Reporter: Laurent Almeras (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
)
@OrderColumn on a generic collection type fails at entityManagerFactory startup with a NPE
:
Caused by: java.lang.NullPointerException: Cannot invoke
"org.hibernate.annotations.common.reflection.XClass.getName()" because the
return value of
"org.hibernate.annotations.common.reflection.XProperty.getMapKey()" is null
at
org.hibernate.boot.model.internal.ClassPropertyHolder$1.doSecondPass(ClassPropertyHolder.java:312)
at
org.hibernate.boot.internal.InFlightMetadataCollectorImpl.processSecondPasses(InFlightMetadataCollectorImpl.java:1846)
at
org.hibernate.boot.internal.InFlightMetadataCollectorImpl.processSecondPasses(InFlightMetadataCollectorImpl.java:1803)
Collection declaration :
(in abstract )
...
@OneToMany(mappedBy= "withGeneric" )
@OrderColumn
public List<T> targets;
...
Generic type is setup in concrete class.
This pattern used to work with Hibernate (works for Hibernate 5.6.15, and previous
versions).
A minimal test-case based on
https://github.com/hibernate/hibernate-test-case-templates is
coming.
There is an existing ticket already open with a similar error
https://hibernate.atlassian.net/browse/HHH-16562 but :
* it does not imply a generic collection
* my minimal test case shows that a non-generic @OneToMany collection is OK
I’ll post my github repository with a minimal test-case in a few minutes.
(
https://hibernate.atlassian.net/browse/HHH-16641#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-16641#add-comment?atlOrigin=ey...
)
Get Jira notifications on your phone! Download the Jira Cloud app for Android (
https://play.google.com/store/apps/details?id=com.atlassian.android.jira....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100225- sha1:9dd72a2 )