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, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content