Romaric S (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=712020%...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiY2YzYTViOGQx...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-16957?atlOrigin=eyJpIjoiY2YzYT...
) HHH-16957 (
https://hibernate.atlassian.net/browse/HHH-16957?atlOrigin=eyJpIjoiY2YzYT...
) Embeddable cannot have only one @generated field (
https://hibernate.atlassian.net/browse/HHH-16957?atlOrigin=eyJpIjoiY2YzYT...
)
Issue Type: Bug Affects Versions: 6.2.6 Assignee: Unassigned Attachments:
hibernate-orm-6.zip Created: 20/Jul/2023 03:45 AM Priority: Major Reporter: Romaric S (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=712020%...
)
Using an @Embeddable with a @generated field causes the following error :
org.hibernate.tuple.entity.CompositeValueGenerationException: Property of on-execution
generated embeddable is not generated: child.prop1
Using the following code :
@Entity
public class Parent {
@Id
private String id;
@Embedded
private Child child;
}
@Embeddable
public class Child {
private String prop1;
@Generated(event = {EventType.INSERT, EventType.UPDATE})
private String prop2;
}
Hibernate seems to be expecting all attributes (or none) to be @generated.
This used to work on previous versions (tested OK on 6.1.7).
(
https://hibernate.atlassian.net/browse/HHH-16957#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-16957#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#100232- sha1:1e691fe )