10.5. Polymorphic Queries
Prev | Chapter 10. JPA Query | Next

## 10.5. Polymorphic Queries

All JPQL queries are polymorphic, which means the `from` clause of a query includes not only instances of the specific entity class to which it refers, but all subclasses of that class as well. The instances returned by a query include instances of the subclasses that satisfy the query conditions. For example, the following query may return instances of `Magazine`, as well as `Tabloid` and `Digest` instances, where `Tabloid` and `Digest` are `Magazine` subclasses.

    select x from Magazine x where x.price < 5

Prev | Up | Next
10.4. JPQL Functions | Home | 10.6. Query Parameters