On-execution generated values, like the GenerationType.IDENTITY strategy, are not supported for composite identifiers. I did a quick test and even in Hibernate 5 this caused an exception. A better error message will be introduced in Hibernate 6.3 thanks to the change in https://hibernate.atlassian.net/browse/HHH-16692. |