4

I am using Play! 2.0 and have problems trying to use Cassandra database. How can I configure the properties of application.conf file to use a high level client like Kundera. Do I have to create a persistence.xml file on the conf/META-INF folder?

I have not found anyone with similar problems. Is it possible to use Play! + Kundera + Cassandra? How do I do that?

Crowie
  • 3,220
  • 7
  • 28
  • 48
guilhermerama
  • 750
  • 9
  • 21

3 Answers3

3

At the moment, it's not possible to use cassandra as a backend for your models (@Model annotation) in Play! 2.0.

There is an effort to provide support for NoSQL Models in Play! via Siena ( http://www.sienaproject.com/index.html ), but the module ( https://github.com/mandubian/play-siena ) is for Play 1.x and cassandra support is not implemented yet.

So, the only way to use Play! 2.0+Kundera is to drop required jars into your lib/ directory, put persistence.xml in META-INF folder anywhere in your classpath (as described in 'Getting started' https://github.com/impetus-opensource/Kundera/wiki/Getting-Started-in-5-minutes), and define your @Entity classes.

However, you won't get support for @Model annotation or CRUD admin area.

Wildfire
  • 6,358
  • 2
  • 34
  • 50
  • @Wildfire I tried putting persistence.xml in PlayProject/WEB-INF/classes/META-INF but when I tried running, it said Exception in thread "main" javax.persistence.PersistenceException: No Persistence provider for EntityManager named cassandra_pu... DO u have any idea why ? – Xitrum Oct 09 '12 at 22:16
  • @Aptos: There's something wrong with classpath, but I don't have specific ideas. Futhermore, I won't recommend you to go this way; I've got some experience with play in production. It's like rails: everything's fine as long as you use it straight. Step right or step left => fail. If you're sure that sql db won't work for you, look at something instead of play. For example vert.x is really good. – Wildfire Oct 10 '12 at 17:56
2

I tried running Kundera on Cassandra and MongoDB with Play! framework and it works without any major configuration. Below link would guide you: http://xamry.wordpress.com/2013/07/06/play-nosql-building-nosql-applications-with-play-framework/

Amresh
  • 478
  • 1
  • 6
  • 28
-1

You may explore Playorm too which has plugins for both Play 1.x and 2.x http://buffalosw.com/wiki/playorm-documentation/

Easility
  • 716
  • 2
  • 8
  • 19