Search

9.2. Limitations

download PDF
There are limitations to the "implicit polymorphism" approach to the table per concrete-class mapping strategy. There are somewhat less restrictive limitations to <union-subclass> mappings.
The following list shows the limitations of table per concrete-class mappings, and of implicit polymorphism, in Hibernate.
table per class-heirarchy, table per subclass
  • Polymorphic many-to-one: <many-to-one>
  • Polymorphic one-to-one: <one-to-one>
  • Polymorphic one-to-many: <one-to-many>
  • Polymorphic many-to-many: <many-to-many>
  • Polymorphic load() or get(): s.get(Payment.class, id)
  • Polymorphic queries: from Payment p
  • Polymorphic joins: from Order o join o.payment p
Outer join fetching is supported.
table per concrete-class (union-subclass)
  • Polymorphic many-to-one: <many-to-one>
  • Polymorphic one-to-one: <one-to-one>
  • Polymorphic one-to-many: <one-to-many> (for inverse="true" only)
  • Polymorphic many-to-many: <many-to-many>
  • Polymorphic load() or get(): s.get(Payment.class, id)
  • Polymorphic queries: from Payment p
  • Polymorphic joins: from Order o join o.payment p
Outer join fetching is supported.
table per concrete class (implicit polymorphism
  • Polymorphic many-to-one: <any>
  • Polymorphic many-to-many: <many-to-many>
  • Polymorphic load() or get(): s.createCriteria(Payment.class).add( Restrictions.idEq(id) ).uniqueResult()
  • Polymorphic queries: from Payment p
Polymorphic one-to-one, polymorphic one-to-many, polymorphic joins, and outer join fetching are not supported.
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.