0
votes

I am bit new to play framework, I followed all the instructions, given on play website, to create new application.

Actually I am trying to create demo using JPA(Hibernate impl) and I followed whatever is written on this link https://www.playframework.com/documentation/2.3.x/JavaJPA

but there is no play.db.jpa package and I can't use JPA helper class.

Note: I am using 2.3.8 latest play version.

Any help on this would be highly appreciated, for I am stuck for couple of hours in this basic thing.

1
I fixed it myself, I just cleaned the project, re-run "activator eclipse" and imported project again. now able to see this jpa package. Thanks!Javed

1 Answers

-1
votes

You should change your build.sbt librarydependencies change ebean with JavaJpa, and reload, or exit and run again activator to update the project

libraryDependencies ++= Seq(
  javaJdbc,
  javaJpa.exclude("org.hibernate.javax.persistence", "hibernate-jpa-2.0-api"),
  cache,
  filters,
  "com.wordnik"  % "swagger-play2_2.10" % "1.3.2",
  "com.typesafe" % "config" % "1.0.2",
  "joda-time" % "joda-time" % "2.3",
  "mysql" % "mysql-connector-java" % "5.1.30",
  "org.hibernate" % "hibernate-entitymanager" % "4.3.5.Final",
  "org.javassist" % "javassist" % "3.18.1-GA",
  "com.typesafe" % "config" % "1.2.1",
  "org.hibernate" % "hibernate-search-orm" % "4.5.1.Final",
  "org.hibernate" % "hibernate-search-analyzers" % "4.5.1.Final"
  )

play.Project.playJavaSettings

and the exclude if you are going to use hibernate, in this example I Use hibernate 4.3.5, this works for me