I am trying to create a play 2.3.4 application with Spring Data JPA. This tutorial says it is good practice to let my model class inherit from play.db.jpa.Model
. Therefore I added import play.db.jpa.*
to my code and let my model class to extend from Model
, However, when I reloaded the application, I got an error message, that Model
is an unknown symbol. Anybody
knows how to inherit from Model
?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
play.db.jpa.Model
does not exists in Play2 (there is only a Model class for Ebean ORM). So dont extend that class. In fact for what I can tell, even on Ebean, extending it does not bring any improvement.
Also check that you have in your libraryDependencies
(build.sbt file) the following entries
javaJpa,
"org.hibernate" % "hibernate-entitymanager" % "4.3.6.Final"
(you can replace the second with a different implementation/version if you need). After that you can run activator update
in the terminal.
Using Play1 instructions in Play2 will not work in many cases. Play1 and Play2 are two very different frameworks. The page you are looking for is probably this.