Wiki source code of WebObjects and Squeryl
Version 138.1 by Ravi Mendis on 2010/11/10 02:55
Hide last authors
| author | version | line-number | content |
|---|---|---|---|
| |
81.1 | 1 | = Squeryl ~= //SQL-like// DSL for Scala = |
| |
54.1 | 2 | |
| |
117.1 | 3 | Advantages of Squeryl over EOF: |
| |
54.1 | 4 | |
| 5 | * Concurrent | ||
| 6 | ** Spawns multiple database connections | ||
| 7 | ** Issues database transactions concurrently | ||
| 8 | * Scala Actor compatible | ||
| |
131.1 | 9 | ** Immutable object model/graph |
| |
81.1 | 10 | * Strongly-typed |
| |
131.1 | 11 | ** Better suited for database/business "logic". |
| 12 | E.g: Exploits the compiler and IDE to catch exceptions at compile time rather than at run-time. | ||
| |
115.1 | 13 | * Uses Scala (functional) collection classes |
| |
54.1 | 14 | |
| 15 | = Migrating EOF -> Squeryl = | ||
| 16 | |||
| |
117.1 | 17 | In keeping with the strong-typed philosophy of Scala, Squeryl has no dynamic component like EOF (i.e an EO model file). |
| |
54.1 | 18 | |
| |
131.1 | 19 | 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. |
| |
54.1 | 20 | |
| |
129.1 | 21 | 1. Create a .eogen file for your EO model as normal. Only set the ##File Names## extension to "scala". |
| 22 | 1. Use the Squeryl EO Templates: | ||
| |
54.1 | 23 | |
| |
129.1 | 24 | * |
| |
54.1 | 25 | ** Entity.eotemplate [[template>>WOL:Squeryl _Entity.eotemplate]] |
| 26 | ** Entity.eotemplate [[template>>WOL:Squeryl Entity.eotemplate]] |