WebObjects and Squeryl

Version 137.1 by Ravi Mendis on 2010/11/10 02:55

Squeryl = SQL-like DSL for Scala

Advantages of Squeryl over EOF:

  • Concurrent
    • Spawns multiple database connections
    • Issues database transactions concurrently
  • Scala Actor compatible
    • Immutable object model/graph
  • Strongly-typed
    • Better suited for database/business "logic".
             E.g: Exploits the compiler and IDE to catch exceptions at compile time rather than at run-time.
  • Uses Scala (functional) collection classes

Migrating EOF -> Squeryl

In keeping with the strong-typed philosophy of Scala, Squeryl has no dynamic component like EOF (i.e an EO model file).

EOF has the ability to generate classes in Java (and in Objective-C prior to WebObjects 4.5) as enforcing type has become customary in enterprise environments. We may exploit this feature of EOF to generate a Squeryl schema.

  1. Create a .eogen file for your EO model as normal. Only set the File Names extension to "scala".
  2. Use the Squeryl EO Templates: