I am currently working on a web service backed by Neo4j (v2.1.2, hosted on GrapheneDB) and Play (v2.3) using Scala (2.11.1) (hosted on Heroku).
Until now AnormCypher connects the Play app with the Neo4J instance and all things are working as expected.
However using AnormCypher doesn't feel quite right. I have to write a lot boiler plate code to convert the results I get from AnormCypher to the Scala classes which are used for the business logic. I would prefer using something similar to Spring Data Neo4j.
The code in the examples looks very clean to me and I want to try it in project.
All these technologies are new to me so I need some help:
I apologize for a somewhat incomplete answer but I thought I'd chime in.
I think there's some room for an ORM-like thing in scala, and I was hoping to make the case class conversion from a stream of results automatic (in AnormCypher), but was never able to make it as performant as .map()
with a case class constructor inside (and also it didn't work for inner case classes, and a few other caveats). I'd love to put some effort into making it more like Mongo's Salat so it has better case class conversion support.
I was dreaming of syntax like this:
scala> Cypher("RETURN "foo" as foo, "bar" as bar")()[MyCaseClass]
res0: Stream[MyCaseClass](...)
In any case, to your main point, a while back I saw someone at cake solutions figure out how to get spring data neo4j to work in scala: http://www.cakesolutions.net/teamblogs/2012/03/29/neo4j-spring-data-scala
The post is a bit old but may get you started, and give you an idea about how it may be somewhat annoying. I found the @annotation syntax to be unidiomatic in scala.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With