December 31, 2013

Join example for JPA finder


The JPA finder for play 2 works with joins as well.

Imagine you have a Task model with a creator:

referenced to a User model with a name:

You can write a method to get all Task for a creator username by joining on creator and access the user fields with the creator.field syntax:

The source code for this example with unit tests is pushed to Play4Jpa


Java, join, JPA, Play Framework, Play4JPA

You may also like

Leave a Reply

Your email address will not be published. Required fields are marked

Information about Data protection

This site uses Akismet to reduce spam. Learn how your comment data is processed.

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}