playframework « Development « JPA Q&A

1. Informix XA Driver in Play! Framework application

I am trying to use Informix database with a Play! Framework application. I am new to Informix. I have Informix 11.70 installed on my windows machine and I am running Play ...

2. JPA and Threads in play framework

I'm trying to create a multithreading server. The problem is that I get the following error: play.exceptions.JPAException: The JPA context is not initialized. JPA Entity Manager automatically start when one or more ...

3. Basic JPA issue: "Could not determine type for: java.util.Set"

I'm just getting started building my JPA schema in a Play Framework web app. I have a reasonable understanding of SQL, but I'm a JPA newbie, and I'm being tripped ...

4. Menu Tree with Hibernate in Play!

My first project with Hibernate/JPA and Play!, I've got a menu that once working, will support changes (i.e. easily add nodes to the tree). Struggling (in the >5 hours sense) just ...

5. Tree with JPA[/Hibernate]

Grrrrrr, trying to implement a very simple tree. It doesn't need to be bidirectional (since traversals are only top-down), so I assume it would be better (i.e. more space efficient) if ...

6. combine entityManeger methods with standard play methods

I need extend delete() action from playframework Model class and I have to use EntityManager and nativeQuery. I have not figured out yet what playframework does exactly with a session (i ...

7. PersistenceException from a simple CRUD for a simple class

Using the in-memory database (db=mem), I'm simply trying to insert a new object into the database using CRUD. The class is as follows:

public class ActivityModel extends Model {

8. Do you need JPA when using MongoDB?

I'm quite confused between those two. I'm looking at the Play! java framework and it says it uses JPA. I'm thinking about using Play! and MongoDB for the first time in ...

9. Can Play be used without JPA, swapping in your own CRUD implementation?

I am evaluating play for usage as an admin system over a family of applications in an SOA environment. Each application has their own persistence, and the various CRUD operations can be ...

10. JPAException occur when trying to access to any page after Secure login

On my website using Play!, I have an Admin part. All Admin controllers have a @With and a @Check annotation. When disconnected, everything goes fine. When connected, each time I load a page ...

11. OrderedColumn in combination playframework gives me for all entries 0 as index

I have the following model (playframework):

public class Album extends Model{

    public Album(){
        this.creationDate = new Date();


12. Why is my ConstraintViolationException not being caught?

I'm using Play Framework, and have the following code:

import org.hibernate.exception.ConstraintViolationException;

public class AuthorService extends Controller


    public static void delete(Long id)  

13. Play! not shutting down H2 correctly

I'm using Play to write a webapp which is deployed in Tomcat. Because the app won't be processing very much data I'm using the default H2 database with Hibernate. ...

14. Private members in Model

I'm working with play. I defined a private member in my model, hoping that JPA wouldn't try to handle it. For some reason I get this error : A JPA error occurred (Unable to build ...

15. How to get the most occured set of objects?

I have two objects.

class Person extends Model {

    Category category;

class Category extends Model {
I ...

16. QueryDSL and Play Framework

I'm using QueryDSL with JPA2 for some time, and it's the most powerful combination for ORM I know. JPA Criteria API is a disaster. With QueryDSL I've forgotten about JPQL too. I'd ...

17. Display EmbeddedId in view (Hibernate/PlayFramework)

I have a class model which is inherits GenericModel. In this class there is an EmbeddedId. My model class :

@Table(name = "serviceItem")
public class ServiceItem extends GenericModel {

public ServiceItemPK serviceItemId;

public int pointPosition;
My ...

18. Is there a way to use MyBatis with the Play! framework?

First of all, Kudos \m/ on selecting the best Java web framework... Since we have good Oracle PL/SQL developers, we want to ditch the default JPA plugin and use MyBatis instead. I ...

19. JPA.getJPAConfig method not found on Play's API

I'm using the most recent version of Play (v.1.2.3) and my system need to read data from one database and persist it to another one. I found on Play documentation there's a ...

20. How do I create an object with nested objects using Hibernate?

I'm getting the following exception:

Referential integrity constraint violation: "FK779B6FDFD4D56C1: PUBLIC.LOG_TAG FOREIGN KEY(PEOPLE_ID) REFERENCES PUBLIC.TAG(ID)";
Here's what I'm trying to do:
Set<String> tagList = getTags();
Log log = new Log(content, user);
I think understand the error ...