如何配置Play!框架项目使用昆德拉与卡桑德拉



我正在使用Play!2.0版本,并且在尝试使用Cassandra数据库时遇到问题。如何配置application.conf文件的属性以使用像Kundera这样的高级客户端。我必须在conf/META-INF文件夹上创建一个persistence.xml文件吗?

我没有发现有类似问题的人。是否可以使用Play!+昆德拉+卡桑德拉?我该怎么做?

目前,不可能在Play中使用cassandra作为模型(@Model annotation)的后端!2.0.

正在努力为NoSQL模型提供支持!经由锡耶纳(http://www.sienaproject.com/index.html),但模块(https://github.com/mandubian/play-siena)适用于Play 1.x,并且尚未实现对cassandra的支持。

所以,使用Play的唯一方法!2.0+Kundera是将所需的jar放入lib/目录,将persistence.xml放在类路径中的META-INF文件夹中(如"入门"中所述https://github.com/impetus-opensource/Kundera/wiki/Getting-Started-in-5-minutes),并定义您的@Entity类。

然而,您将无法获得对@Model注释或CRUD管理区域的支持。

我试着用Play在Cassandra和MongoDB上运行Kundera!框架,并且它在没有任何主要配置的情况下工作。以下链接将为您提供指导:http://xamry.wordpress.com/2013/07/06/play-nosql-building-nosql-applications-with-play-framework/

您也可以探索Playorm,它同时为Play 1.x和2.x提供插件http://buffalosw.com/wiki/playorm-documentation/

最新更新