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} |
|