Hibernate Tip: How to select a specific subclass from an inheritance hierarchy

preview_player
Показать описание

When you model an inheritance hierarchy in your domain model, you sooner or later want to use it in a query. That’s when I often get a question like the following one: I have a many-to-many association to the superclass of an inheritance hierarchy. How can I select only a certain subclass from that hierarchy?
You can use a TYPE expression in your JPQL query to limit your query result to one or more subclasses.

If you like this video, please give me your thumbs up and share it with your friends and co-workers.

Like my channel? Subscribe!

Join the free Member Library:

Want to connect with me?
#Hibernate #JPA #HibernateTips #JPQL
Рекомендации по теме
welcome to shbcf.ru