Quote:
This sounds like changing a DB design to serve an ORM requirements?
In a typical pure relational schema,
you probably would have a boolean or small-int field telling whether the record is a "header" or a "detail".
So in fact also on pure relational schemes, certain fields have the function of a discriminator.
I you don't want discriminator fields, then choose another inheritance strategy.
Q1: session.createQuery("from MemoHeader").list()
will return you also all "details" but they will be returned as concrete MemoDetails instances.
(you can cast them to MemoHeader, but anyway "details" will be returned as MemoDetails instances)
Q2: session.createQuery("from MemoDetails").list();
will return you zero objects
Code:
select memo0_.* from Memo memo0_ where memo0_.DTYPE='Details'
N.B.: In this case (subclass) the discriminator column is implicitly included in the where condition,
indipendently from forcing discriminator or not (@org.hibernate.annotations.ForceDiscriminator)