Package org.hibernate.annotations
Annotation Interface ConcreteProxy
Annotating
ConcreteProxy
on the root entity class of an inheritance hierarchy
will allow types of that hierarchy to always produce proxies that resolve to the concrete
subtype class. This means both lazy associations
and plain references can safely be used
with instanceof
checks and type-casts.
Note that the table(s) of an entity might need to be accessed to determine the concrete proxy type:
-
With single table inheritance,
the discriminator column value
will be
left join
ed when fetching associations or simply read from the entity table when getting references. -
When using joined inheritance,
all subtype tables will need to be
left join
ed to determine the concrete type. Note however that when using an explicit discriminator column, the behavior is the same as for single-table inheritance. - Finally, for table-per-class inheritance, all subtype tables will need to be (union) queried to determine the concrete type.
- Since:
- 6.6