Playframework 2.1找不到javax.persistence和play.db
我在使用Play框架(版本2.1)创建实体的Scala教程中遇到问题.我正在尝试:
I have a problem with the Scala tutorial for creating an Entity with the play framework (Version 2.1). I'm trying to do:
import java.util._
import javax.persistence._
import play.db.jpa._
但是当我编译它时,它告诉我javax.persistence不存在,而play.db都不存在.
But when I compile it tells me that javax.persistence dosen't exist and play.db neither.
我认为这是版本问题,因为在我看来,实际的yabe教程有点旧.您知道哪个网站提供了很好的解释和示例吗?
I suppose it's a problem of version because it seems to me that the actual yabe-tutorial is a bit old. Do you know any website who has good explanations and examples?
感谢您的帮助!
在使用Scala时,您可以看看Slick,它似乎是Play的未来数据库持久性框架,并在您的教程中放弃了.
As you use Scala you could take a look at Slick which seems to be the future db persistence framework for Play and abandon the one in your tutorial.
如果有jdbc
作为依赖项,请查看Build.scala.
Look in your Build.scala if you have jdbc
as a dependancy.
这是我的依赖
val appDependencies = Seq(
jdbc,
"mysql" % "mysql-connector-java" % "5.1.22",
"com.typesafe" % "slick_2.10.0-RC1" % "0.11.2",
"org.mindrot" % "jbcrypt" % "0.3m"
)