-
Notifications
You must be signed in to change notification settings - Fork 2
freewind/play2_scala_ebean
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Play2 + Scala + Ebean ===================================== 该程序用来测试Ebean是否可以在Play2中与Scala一同使用。 models下有一些用Java定义的Ebean model, test下有一些用Scala写成的测试类。 运行play test,将会报以下错误: [info] Cause: java.lang.IllegalStateException: Class [class play.db.ebean.Model] is enhanced and [class models.Question] is not - (you can not mix!!) 根据该帖子的内容:https://groups.google.com/forum/#!topic/play-framework/Lfa6VzNqOVE/discussion 需要在Build.sbt中增加: ebeanEnabled := true 加在这个位置: val main = PlayProject(appName, appVersion, appDependencies, mainLang = SCALA).settings( // Add your own project settings here ebeanEnabled := true ) 现在发现以下问题: 1. 直接调用model中的field,会无法更新值。必须定义getter/setter,并且调用getter/setter,才能正常更新。这让代码相当繁琐