Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
Mellow_
Sep 13, 2010

:frog:
I've been mucking about with the Play framework and am looking for a half decent ORM to use with it. I see it comes with Ebean, anyone have opinions on it?

If it turns out to be junk I might just use spring with jpa.

I also took a look at squeryl but it didn't seem that fantastic.

Adbot
ADBOT LOVES YOU

Mellow_
Sep 13, 2010

:frog:

loinburger posted:

I used Slick up until about six months ago - it may have gotten better since then, but at the time vanilla Slick was reliant on case classes and tuples and all of their attendant restrictions. However, it's got a code generation tool that lets you bypass those restrictions (generating classes instead of case classes to represent rows), and that also saved us a boatload of time in refactoring (this was a startup and so the database kept changing on us) because the code generation tool would read the metadata from the database tables and produce appropriately typed row classes.

Almost all of the database writes were from JSON in POST/PUT requests, and so the code generation tool let us generate code to:
1. Validate the JSON (ensure that each key corresponded to a valid column name)
2. Loop through the JSON, convert its untyped values to the appropriate type (or throw an exception), and update the appropriate row objects
3. Update the appropriate join tables to keep the database consistent (this was done with a hand-coded Map, we were planning on automatically generating this Map using foreign key constraints but then the company more or less went bankrupt)

I can give you some example code if you want. The learning curve was a bit steep, but in the end something like 25% of our back-end code was being generated by Slick.

This is really interesting and I would definitely be interested in viewing some example code.

Thanks for the option, I'll look into it.

EDIT: Wait a minute, if Play and Slick are both made by TypeSafe, why the heck haven't they started using Slick with Play?

Mellow_ fucked around with this message at 03:36 on Jun 5, 2015

  • Locked thread