Skip to content

freewind/play2_scala_ebean

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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,才能正常更新。这让代码相当繁琐

About

play2+scala+ebean with issues

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages