Jones (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiOTk2OTBhYjhm...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-16309?atlOrigin=eyJpIjoiOTk2OT...
) HHH-16309 (
https://hibernate.atlassian.net/browse/HHH-16309?atlOrigin=eyJpIjoiOTk2OT...
) Envers misses columns of hierarchical Embeddables with MappedSuperClass (
https://hibernate.atlassian.net/browse/HHH-16309?atlOrigin=eyJpIjoiOTk2OT...
)
Issue Type: Bug Affects Versions: 6.1.7, 6.2.0.CR3 Assignee: Chris Cranford (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) Components: hibernate-envers Created: 15/Mar/2023 00:11 AM Priority: Major Reporter:
Jones (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
)
Given:
* Entity with embedded
* Embeddable with abstract parent class defining 1 or more properties and annotated with
MappedSuperClass
When:
* generate ddl
Then:
* entity tables have all columns correctly created
* Generated aud table misses columns from parent class of the embeddable component
@Audited
@Entity
@Table(name = "MY_TABLE" )
public class MyEntity {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "ID" )
private Integer id;
@Embedded
@AttributeOverride(name = "parentEmbeddableProp" , column = @Column(name =
"PARENT_EMBEDDABLE_COLUMN" ))
@AttributeOverride(name = "myEmbeddableProp" , column = @Column(name =
"MY_EMBEDDABLE_COLUMN" ))
private MyEmbeddable myEmbeddable = new MyEmbeddable();
}
@Embeddable
@MappedSuperclass
public abstract class AbstractEmbeddable {
@Column(length = 123)
private String parentEmbeddableProp;
}
@Embeddable
public class MyEmbeddable extends AbstractEmbeddable {
@Column(length = 456)
private String myEmbeddableProp;
}
Hibernate:
create table MY_TABLE (
ID integer not null,
MY_EMBEDDABLE_COLUMN varchar(255),
PARENT_EMBEDDABLE_COLUMN varchar(255),
primary key (ID)
)
Hibernate:
create table MY_TABLE_AUD (
ID integer not null,
REV integer not null,
REVTYPE tinyint,
MY_EMBEDDABLE_COLUMN varchar(255),
primary key (REV, ID)
)
the non-aud table seems fine
The aud table misses columns.
Reproducible test case to be attached
(
https://hibernate.atlassian.net/browse/HHH-16309#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-16309#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#100217- sha1:fd7c927 )