I'm creating a small application for my company in Lift. I'm quite a newbie in Scala/Lift so I'm using this chance to practice. Now, I have a question on what ORM system to use.
On one hand, Mapper is the Lift default. On the other hand, I've read it's not good in certain areas and will be replaced by Record (which is not yet well documented, so hard to follow by a new user like me).
Opposite to Mapper we have JPA: standard Java, tested and robust ORM with trusted implementations like Hibernate, but not quite "scala-ish" and you loose the capabilities provided by default by Mapper due to its integration with Lift.
I've read on the mailing lists some assertions that JPA is becoming the way to go for Lift, but it doesn't seem a widespread opinion. Somebody can bring some light into the matter?
Thanks!
Now I facing the same dilema:) Take into consideration that Mapper/Record are not more Scalish then JPA/Hibernate (E.g. in both Mapper and Record you use mutable entities). Check snippets Use of "immutable" Scala entities with Hibernate and Mapping of scala's Option in Hibernate to see how you can use Hibernate in quite scalish way. So if you already know Hibernate and comfortable with it you'd better go this way. Otherwise for small project you can try Mapper.
It depends on what you need. If you have a model that is heavily using inheritance and one/many-to-many relationships then you might be better off with JPA.
However if you want rapid turnaround, Mapper is the way to go. Mapper/Crudify are a great scaffolding pair, and that power is hard to beat.
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