Limitations by R4R Team

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 table shows the limitations of table per concrete-class mappings, and of implicit polymorphism, in Hibernate.

Here in the below table we can see the inheritance mappings:

Inheritance strategy

Polymorphic many-to-one

Polymorphic one-to-one

Polymorphic one-to-many

Polymorphic many-to-many

Polymorphic load()/get()

Polymorphic queries

Polymorphic joins

Outer join fetching

table per class-hierarchy

<many-to-one>

<one-to-one>

<one-to-many>

<many-to-many>

s.get(Payment.class, id)

from Payment p

from Order o join o.payment p

Supported

table per subclass

<many-to-one>

<one-to-one>

<one-to-many>

<many-to-many>

s.get(Payment.class, id)

from Payment p

from Order o join o.payment p

Supported

table per concrete-class (union-subclass)

<many-to-one>

<one-to-one>

<one-to-many> (for inverse="true" only)

<many-to-many>

s.get(Payment.class, id)

from Payment p

from Order o join o.payment p

Supported

table per concrete class (implicit polymorphism)

<any>

not supported

not supported

<many-to-any>

s.createCriteria(Payment.class).add( Restrictions.idEq(id) ).uniqueResult()

from Payment p

not supported

not supported

Leave a Comment:
Search
Categories
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!