With Hibernate, how can I eager fetch related but unmapped entities in one query ?

Solution Verified - Updated -

Issue

Our application uses related entities (Parent, Child) but the association is not mapped, there is not @OneToMany or @ManyToOne

  • the entities are related because there is a foreign from CHILD table to PARENT table that allow to make a join
  • is it possible to retrieve a Parent and its Children in one query of the association is not mapped ?

Environment

  • Hibernate
  • Java Persistence API

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.