Files
hibernate-demo/inheritance/output/01-ddl-mapped-superclass.txt
asmhatre 807f681ed1 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.
2026-10-24 10:02:28 +00:00

23 lines
661 B
Plaintext

-- 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)
);