QueryDSL and Play Framework

I have been using QueryDSL with JPA2 for some time, and this is the most powerful combination for ORM that I know. The JPA API is a disaster. With QueryDSL, I also forgot about JPQL.

I would like to use QueryDSL with Play! Everything looks very good on Play, except for the built-in JPQL parts as strings. It reminds me of CakePHP ...

I want to have a refactoring query language query on Play (and some other things :)).

Using QueryDSL would be simple. It is needed only by EntityManager. But QueryDSL has this APT class generator (just like one from Hibernate for the citeria API).

Has anyone managed to get this class generator to work with Play? Can I recreate and reload these classes?

+3
source share
4 answers

I think that the experience of Project Lombok with annotation processing in the Play structure will be useful to you. It's easy to set up APT processing, but very specific. Take a look at the play-lombok module . Do not ignore the commands.py file and change the org.eclipse.jdt.core-3.6.0.jar link to match the version used in your version of Play.

I use Querydsl in the Play framework for all of my latest projects. However, I do not use JPA. I use my own object models with Querydsl instead of ORM to get a good fit depending on the situation. I did not need APT with Querydsl.

Play Querydsl, . - .

+3

querydsl, eclipse. (. http://blog.mysema.com/2010/10/using-querydsl-in-eclipse.html)

dir /, , Q , , , .

.yml

    - com.mysema.querydsl -> querydsl-jpa 2.2.3
    - com.mysema.querydsl -> querydsl-apt 2.2.3
    - log4j -> log4j 1.2.16
    - javassist -> javassist 3.12.1.GA

repositories:
    - queryDSL:
        type: iBiblio
        root: "http://source.mysema.com/maven2/releases/"
        contains:
            - com.mysema -> *           

play dependencies --sync play eclipsify ,

+2

Play, , Querydsl SQL Play: http://twitter.com/#!/rrmckinley

. Querydsl Play.

+1

, (, Mongo) - QueryDSL. , .

0

Source: https://habr.com/ru/post/1535013/


All Articles