Play! 1.x and JPA entities

Answered

With a Play1 project, and the JPA facet added I get only some of the entities in the Persistence view, and thus validation of JPA entities doesn't work, as well as queries in the JPA console doesn't work.

What could be preventing only some entities from being picked up? How can a re-reading of the entities be forced?

I already tried removing the JPA facet, closing the project, etc.

Could possibly be related to this issue: https://intellij-support.jetbrains.com/hc/en-us/community/posts/206845845-JPQL-Problem-Recognizing-Entities?input_string=Play!%201.x%20and%20JPA%20entities

0
7 comments

How do you configure JPA persistence unit and JPA entities in project? What error do you get?

Can you provide a sample project? See also an Overview of JPA support about JPA configuration in IDE.

0

It is implicitly configured through the use of the Play1 framework, and the odd thing is that it partially works: It does find some of the entities but not all. I cannot see any difference between these entities.

I only have this problem in a huge problem, which is unfortunately not possible to share.

So I am just wondering why some entities are picked up, and others aren't.

 

0

Current IDE versions do not have specific support for Play framework version 1.x (it is supported by the IntelliJ IDEA version 11 only). As for JPA there could be different configuration cases (e.g. via persistence.xml or via Spring JPA and javax.persistence annotations). If you can assemble a sample project please file an issue at https://youtrack.jetbrains.com/issues/IDEA.

0

Ok, that's a shame, since there is still partial support for this Play 1.x situation.

Is there any way to debug this situation, like obtaining the source code that takes care of detecting the entities, in this case where there is no persistence.xml or Spring annotations?

I will see if I can reproduce a small project with the same problem.

0

The source code is proprietary, sorry, as this is included into Ultimate IDE edition.

0

I actually found the problem just now.

Play framework finds entities in package models/** (recursive). Intellij findes entities just in package models, not sub-packages.

Easy workaround: place all entities in models package.

0

Please sign in to leave a comment.