Yoann Rodière (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiZWM1MDA2Y2Jj...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-15505?atlOrigin=eyJpIjoiZWM1MD...
) HHH-15505 (
https://hibernate.atlassian.net/browse/HHH-15505?atlOrigin=eyJpIjoiZWM1MD...
) Getter of loaded entity returns null when using bytecode enhancement on entity whose
field is defined both in mapped superclass and concrete entity (
https://hibernate.atlassian.net/browse/HHH-15505?atlOrigin=eyJpIjoiZWM1MD...
)
Issue Type: Bug Affects Versions: 6.2.0, 5.6.11, 6.1.3 Assignee: Yoann Rodière (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) Components: bytecode-enhancement Created: 13/Sep/2022 07:51 AM Fix Versions:
5.6-backlog, 6.2.0 Priority: Major Reporter: Yoann Rodière (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
)
See also
https://github.com/quarkusio/quarkus/issues/27893 (
https://github.com/quarkusio/quarkus/issues/27893 )
In short, the following model doesn’t work with bytecode enhancement; the data will be
loaded correctly, but calling getName on a loaded entity will always return null for some
reason:
@MappedSuperclass
public class AbstractEntity {
@Column(length = 40, unique = true)
private String name;
}
@Entity
@Table(name = "known_fruits")
public class Fruit extends AbstractEntity {
@Id
private Integer id;
@Column(length = 40, unique = true)
private String name;
public Fruit() {
}
public Fruit(String name) {
this.name = name;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
(
https://hibernate.atlassian.net/browse/HHH-15505#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-15505#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#100206- sha1:821f494 )