QueryDSL and Play Framework

旧时模样 提交于 2019-11-30 16:04:13

I think the experience of Project Lombok with annotation processing in the Play framework will be helpful to you. It is easy to setup APT processing, but very specific. Look at the play-lombok module. Don't ignore the commands.py file and change the org.eclipse.jdt.core-3.6.0.jar reference to match the version used in your version of Play.

I use Querydsl in the Play framework for all my recent projects. I do not use JPA, however. I use my own object models with Querydsl instead of ORM to get a good fit depending on the situation. I haven't had a need for APT with Querydsl.

I have not created any tight integration between Play and Querydsl, but I just use a bit of boilerplate in each controller method. Some day I'll write a proper plugin.

I'm running play with querydsl using eclipse. (see http://blog.mysema.com/2010/10/using-querydsl-in-eclipse.html)

As generated source dir i used app/ which means that the Q classes will be generated in the same dir as the model classes which is not optimal but works.

Added these lines to the dependencies.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 -> *           

Then use play dependencies --sync and play eclipsify and reopen the project in eclipse and it should work

I have no experience with Play, but I know that the following managed to use Querydsl SQL with the Play framework : http://twitter.com/#!/rrmckinley

He might be able to help you. I am not aware of any other integration of Querydsl with Play.

You could check the existing modules that change the Database adaptor (like this one for Mongo) and do something similar to link QueryDSL. Play hot-reloading should be available to it if it's a module.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!