I’m about to write a Scala command-line application that relies on a MySQL database. I’ve been looking around for ORMs, and am having trouble finding one that will work well.
The Lift ORM looks nice, but I’m not sure it can be decoupled from the entire Lift web framework. ActiveObjects also looks OK, but the author says that it may not work well with Scala.
I’m not coming to Scala from Java, so I don’t know all the options. Has anyone used an ORM with Scala, and if so, what did you use and how well did it work?
There are several reasons why JPA-oriented frameworks (Hibernate, for instance) do not fit into idiomatic Scala applications elegantly:
@JoinTable->@JoinColumn);PersistentCollections, for example);There are more reasons, I’m sure. That’s why we have started the Circumflex ORM project. This pure-Scala ORM tries it’s best to eliminate the nightmares of classic Java ORMs. Specifically, you define your entities in pretty much way you would do this with classic DDL statements:
As you can see, these declarations are a bit more verbose, than classic JPA POJOs. But in fact there are several concepts that are assembled together:
The only things Circumflex ORM lacks are:
P.S. I hope this post will not be considered an advertisement. It isn’t so, really — I was trying to be as objective as possible.