play-ebean icon indicating copy to clipboard operation
play-ebean copied to clipboard

Add query bean support

Open andrewl102 opened this issue 10 years ago • 15 comments

resolve #61

andrewl102 avatar Nov 18 '15 06:11 andrewl102

@andrewl102 can you squash the commits?

benmccann avatar Nov 29 '15 01:11 benmccann

will this make it into play 2.5?

oexza avatar Mar 01 '16 18:03 oexza

@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.

marcospereira avatar Mar 02 '16 03:03 marcospereira

For java what are the flags

talachutla avatar Mar 06 '16 17:03 talachutla

ping! @andrewl102 @benmccann :smiley: is this PR still alive?

oexza avatar Apr 11 '16 11:04 oexza

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?

oexza avatar Jun 17 '16 09:06 oexza

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.

rbygrave avatar Jun 17 '16 10:06 rbygrave

@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

benmccann avatar Jun 23 '16 22:06 benmccann

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 avatar Feb 20 '17 16:02 aviau

@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
  )

aprasadh avatar May 03 '17 09:05 aprasadh

Hi Is there any chance for this pull request to be merged? Thank you.

AlekseyMko avatar May 12 '17 08:05 AlekseyMko

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?

marcospereira avatar May 15 '17 18:05 marcospereira

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.

AlekseyMko avatar May 19 '17 14:05 AlekseyMko

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.

AlekseyMko avatar May 26 '17 08:05 AlekseyMko

Any news on that?

Flo354 avatar Feb 01 '19 15:02 Flo354