Package org.hibernate.annotations

Annotation Interface ConcreteProxy


@Target(TYPE)@Retention(RUNTIME)@Incubatingpublic @interfaceConcreteProxy
AnnotatingConcreteProxy 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 bothlazy associations andplain references can safely be used withinstanceof checks and type-casts.

Note that the table(s) of an entitymight need to be accessed to determine the concrete proxy type:

  • Withsingle table inheritance, thediscriminator column value will beleft joined when fetching associations or simply read from the entity table when getting references.
  • When usingjoined inheritance, all subtype tables will need to beleft joined to determine the concrete type. Note however that when using an explicitdiscriminator column, the behavior is the same as for single-table inheritance.
  • Finally, fortable-per-class inheritance, all subtype tables will need to be (union) queried to determine the concrete type.
Since:
6.6