Scala Play! Using anorm or ORM
Asked Answered
R

2

12

It seems that all the sample applications provided by the Play! framework make use of anorm for persistence. What is the reason for choosing anorm over an ORM? If you are using an ORM, what are you using and why?

Rna answered 8/6, 2012 at 16:4 Comment(0)
A
13

I think most of the arguments for anorm are listed on the corresponding page in the documentation.

For the time being I personally prefer a Scala and Play independent data access layer, thus I am using Ebean (and would be using JPA, if it was the recommended default).

Being able to use the Models without any Play-dependencies is a huge plus, in my opinion. Also Anorm does not seem to offer much database independence, since the queries are expressed in native SQL.

Aquila answered 10/6, 2012 at 20:59 Comment(1)
thank you! Your comment about database independence rings true. Even modifying the samples to use postgres, as opposed to hsql, took time I would rather spend on development...Rna
A
17

anorm is a meta acronym for Anorm is Not an Object Relational Mapper, hence it is not an ORM.

And therein lies the answer--it's for those of us who want to be hands-on with their SQL queries.

Ambrosius answered 9/6, 2012 at 15:20 Comment(0)
A
13

I think most of the arguments for anorm are listed on the corresponding page in the documentation.

For the time being I personally prefer a Scala and Play independent data access layer, thus I am using Ebean (and would be using JPA, if it was the recommended default).

Being able to use the Models without any Play-dependencies is a huge plus, in my opinion. Also Anorm does not seem to offer much database independence, since the queries are expressed in native SQL.

Aquila answered 10/6, 2012 at 20:59 Comment(1)
thank you! Your comment about database independence rings true. Even modifying the samples to use postgres, as opposed to hsql, took time I would rather spend on development...Rna

© 2022 - 2024 — McMap. All rights reserved.