Add query bean support
resolve #61
@andrewl102 can you squash the commits?
will this make it into play 2.5?
@oexza it don't need to. :-)
The main benefit to have play-ebean as a separated project is that we can release new versions of it independent of Play lifecycle. By independent I mean that we can later release a new version of play-ebean with query bean support without releasing a new version of Play.
For java what are the flags
ping! @andrewl102 @benmccann :smiley: is this PR still alive?
hello guys, still gonna nag you on this @andrewl102 @benmccann @marcospereira where are we at on this Type safety goodness? why is this stalled? is it abandoned?
As a note the Ebean maven artifacts above have since be renamed and updated so:
"org.avaje.ebeanorm" % "avaje-ebeanorm-typequery-agent" % "1.5.1" "org.avaje.ebeanorm" % "avaje-ebeanorm-typequery-generator" % "1.5.1"
Should ultimately be moved over to: "org.avaje.ebeanorm" % "querybean-agent" % "2.2.1" "org.avaje.ebeanorm" % "finder-generator" % "2.1.2"
The "finder-generator" (renamed from avaje-ebeanorm-typequery-generator) ... generates finders but it also generates query beans by reading the entity bean information from compiled classes. I believe this is used because we can't use Java annotation processing.
Ebean's "querybean-generator" artifact is the Java annotation processor that generates query beans (so as I understand it we can't use it at the moment with sbt).
Cheers, Rob.
@oexza we stopped working on this due to slight changes in tech stack at Connectifier after being acquired. if you'd like to take over I will be happy to review, but we don't have time to implement ourselves
I'd love to see this merged. Or is there any way to use query beans without modifications to play-ebeans?
I have managed to get querybeans generation working by just adding "org.avaje.ebean" % "querybean-generator" % "8.1.1" to my dependencies.
Is there a simple way to enable enhancements?
@aviau Hi,
After adding library dependency "org.avaje.ebean" % "querybean-generator" % "8.1.1"
I am getting compiler warnings saying, "...Could not determine source for class models....."
What other dependency you have added to make it work. I am using Play Framework 2.5.14. Part of my build.sbt contains,
val appDependencies = Seq(
"be.objectify" %% "deadbolt-java" % "2.5.0",
// Comment the next line for local development of the Play Authentication core:
"com.feth" %% "play-authenticate" % "0.8.1",
"org.postgresql" % "postgresql" % "9.4.1212.jre7",
cache,
javaWs,
javaJdbc,
"org.webjars" % "bootstrap" % "3.2.0",
"org.easytesting" % "fest-assert" % "1.4" % "test",
"org.seleniumhq.selenium" % "selenium-java" % "2.52.0" % "test",
"org.yaml" % "snakeyaml" % "1.18",
"org.apache.commons" % "commons-lang3" % "3.5",
"org.avaje.ebean" % "querybean-generator" % "8.1.1"
)
lazy val root = project.in(file("."))
.enablePlugins(PlayJava, PlayEbean)
.settings(
libraryDependencies ++= appDependencies
)
Hi Is there any chance for this pull request to be merged? Thank you.
Hey @AlekseyMko, this needs to be revamped given the last updates and changes made in play-ebean. Right now it is not even mergeable since there are conflicts with the current code.
I'm not sure if @andrewl102 still have time to move this forward, but if not, someone can cherry-pick his commits here, solve the conflicts and submit a new pull request. What do you think?
Hi @marcospereira. I updated code from this pull request and fixed to make it work. But I did it only for 3.1.1 version of play-ebean plugin. 4.0.0 Uses newer version of ebean and code requires much more changes. Also I am very new to Play, sbt and Scala and don't understand how does some thing work yet (especially in sbt). I am starting new project with Play stack.
I worked a bit with my updated plugin and it couses reloading of application after each request as ebean Generator does not care about changes in models and just regenerates finders and query beans every time. This forces sbt to reload application and makes development process unacceptable. Possible I will finish this in the future but now I have no time and knowledges in sbt to finish. I can share my changes if somebody wants to move this forward.
Any news on that?