问题描述
我正在尝试按照以下Play框架ebean教程进行操作:
Im trying to follow the play framework ebean tutorial here:
http://www.playframework.com/documentation/2.1.2/JavaEbean
但是,当我尝试包含play.db.ebean.*并尝试进行编译时,找不到该包(没有play.db包).我已经将ebean.default ="models.*"添加到了application.conf
However when I try to include play.db.ebean.* and try to compile, the package is not found (no play.db package). I have added ebean.default="models.*" to my application.conf
我还需要做些其他事情来获取依赖吗?例如,在播放1.2中是否有等效的播放副手?
Is there anything else I need to do to get the dependency? Is there an equivalent to play deps from play 1.2 for example?
跟踪:
[error] /home/nfv/workspace-scala/scims/app/models/Person.scala:3: object db is not a member of package play
[error] import play.db.ebean.Model;
[error] ^
[error] /home/nfv/workspace-scala/scims/app/models/Person.scala:5: not found: type Model
[error] class Person extends Model {
[error] ^
[error] two errors found
[error] (compile:compile) Compilation failed
[error] Total time: 4 s, completed 09-Sep-2013 11:23:00
欢呼NFV
推荐答案
这可能是因为Build.scala
文件中缺少依赖项.
This is probably because of a missing dependency in your Build.scala
file.
要使用Ebean,它应该包括对javaEbean
的依赖.例如:
To use Ebean, it should include a dependency on javaEbean
. Ex :
val appDependencies = Seq(
jdbc,
javaEbean,
...)
添加依赖项后,从播放控制台运行reload
和update
.
After adding the dependency, run reload
and update
from the play console.
这篇关于在播放2.1.3中找不到play.db程序包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!