问题
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?
回答1:
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.
回答2:
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.
来源:https://stackoverflow.com/questions/10952330/scala-play-using-anorm-or-orm