Rok Marinsek (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=63ee251...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiMjE2NWQwMzJi...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-16188?atlOrigin=eyJpIjoiMjE2NW...
) HHH-16188 (
https://hibernate.atlassian.net/browse/HHH-16188?atlOrigin=eyJpIjoiMjE2NW...
) Exception when find by field of generic @EmbeddedId with @MappedSuperclass (
https://hibernate.atlassian.net/browse/HHH-16188?atlOrigin=eyJpIjoiMjE2NW...
)
Issue Type: Bug Affects Versions: 6.1.1, 6.2.0.CR1, 6.2.0.CR2, 6.1.2, 6.1.3, 6.1.4, 6.1.5,
6.1.6, 6.1.7 Assignee: Unassigned Created: 16/Feb/2023 05:45 AM Priority: Major Reporter:
Rok Marinsek (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=63ee251...
)
We have the following abstract base classes:
@Embeddable
@MappedSuperclass
public abstract class DomainEntityId implements Serializable {
private final Long domainId;
protected DomainEntityId() {
Random random = new Random();
this.domainId = random.nextLong();
}
...
}
@MappedSuperclass
public abstract class DomainEntityModel<ID extends DomainEntityId> {
@EmbeddedId
@NonNull
private ID id;
protected DomainEntityModel(ID id) {
this.id = id;
}
...
}
and the concrete class:
@Entity
public class Customer extends DomainEntityModel<Customer.CustomerId> {
private Integer code;
private String name;
@Embeddable
public static class CustomerId extends DomainEntityId {
private int someDomainField;
public CustomerId() {
super ();
this.someDomainField = new Random().nextInt();
}
public int getSomeDomainField() {
return someDomainField;
}
}
public Customer( Integer code, String name) {
this ();
this.code = code;
this.name = name;
}
protected Customer() {
super ( new CustomerId());
}
...
}
(
https://hibernate.atlassian.net/browse/HHH-16188#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-16188#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#100216- sha1:a0b8fe5 )