pWestrich (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *updated* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiNWFlM2YzZDU0...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-16664?atlOrigin=eyJpIjoiNWFlM2...
) HHH-16664 (
https://hibernate.atlassian.net/browse/HHH-16664?atlOrigin=eyJpIjoiNWFlM2...
) NPE in MappingMetamodelImpl if inheritence is used in IdClass (
https://hibernate.atlassian.net/browse/HHH-16664?atlOrigin=eyJpIjoiNWFlM2...
)
Change By: pWestrich (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
)
In Hibernate-Core 6.1.7 we could use inheritance in IdClasses like so:
{code:java}@Data
@NoArgsConstructor
@AllArgsConstructor
public class ParentPrimaryKey implements Serializable {
private UUID parentId;
}
@Data
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
public class ChildPrimaryKey extends ParentPrimaryKey {
private UUID childId;
}
{code}
But since 6.2.x this will raise a cryptic NPE:
{noformat}jakarta.persistence.PersistenceException: [PersistenceUnit: default] Unable to
build Hibernate SessionFactory; nested exception is java.lang.NullPointerException: Cannot
invoke
"org.hibernate.metamodel.mapping.EmbeddableValuedModelPart.getNavigableRole()"
because "mappingModelPart" is null{noformat}
h4. Expected Behavior
Instead of an NPE, I would expect a more helpfull message, i.e.:
{quote}Illegal embeddable valued model definition: com.example.PK.class. {quote}
(
https://hibernate.atlassian.net/browse/HHH-16664#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-16664#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:bbd69a1 )