Add inheritance module: SINGLE_TABLE vs JOINED vs TABLE_PER_CLASS on Hibernate 7.4.13.Final
Same payment hierarchy mapped three ways plus @MappedSuperclass, run with plain Hibernate on H2. Tests assert and write the generated DDL, the INSERT/SELECT SQL, row/insert/FK/nullability counts and the three failures (NOT NULL on a SINGLE_TABLE subclass column, IDENTITY with TABLE_PER_CLASS, querying a @MappedSuperclass); Bench writes indicative polymorphic-query timings. No docs folder: depth lives in the post.
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
-- DDL generated by Hibernate 7.4.13.Final for H2, @MappedSuperclass AuditedBase + Invoice + Receipt
|
||||
|
||||
|
||||
create sequence mp_invoice_SEQ start with 1 increment by 50;
|
||||
|
||||
create sequence mp_receipt_SEQ start with 1 increment by 50;
|
||||
|
||||
create table mp_invoice (
|
||||
version integer not null,
|
||||
created_at timestamp(6) with time zone not null,
|
||||
id bigint not null,
|
||||
number varchar(20) not null,
|
||||
primary key (id)
|
||||
);
|
||||
|
||||
create table mp_receipt (
|
||||
version integer not null,
|
||||
created_at timestamp(6) with time zone not null,
|
||||
id bigint not null,
|
||||
note varchar(60),
|
||||
primary key (id)
|
||||
);
|
||||
Reference in New Issue
Block a user