Changes for page WebObjects and Squeryl
Last modified by Ravi Mendis on 2011/04/01 11:14
From version 116.1
edited by Ravi Mendis
on 2010/11/10 06:15
on 2010/11/10 06:15
Change comment:
There is no comment for this version
To version 117.1
edited by Ravi Mendis
on 2010/11/10 02:49
on 2010/11/10 02:49
Change comment:
There is no comment for this version
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -1,31 +1,23 @@ 1 1 = Squeryl ~= //SQL-like// DSL for Scala = 2 2 3 -Advantages of [[Squeryl>>http://squeryl.org/]]over EOF:3 +Advantages of Squeryl over EOF: 4 4 5 5 * Concurrent 6 6 ** Spawns multiple database connections 7 7 ** Issues database transactions concurrently 8 8 * Scala Actor compatible 9 -* *Immutable object model/graph9 +* Immutable object model/graph 10 10 * Strongly-typed 11 -** Better suited for database/business "logic".12 - E.g: Exploit sthe compiler and IDE to catch exceptions at compile time rather than at run-time.11 +** Better suited for business "logic". 12 + E.g: Exploiting the compiler and IDE to catch exceptions at compile time rather than at run-time. 13 13 * Uses Scala (functional) collection classes 14 14 15 15 = Migrating EOF -> Squeryl = 16 16 17 -In contrast to EOF Squeryl maintains its ORM information programmatically - in the classes itself and collectively in a [[schema>>http://squeryl.org/schema-definition.html]]. Inkeeping with the strongly-typed philosophy of Scala, Squeryl has no dynamic component like EOF (i.e an EO model file).17 +In keeping with the strong-typed philosophy of Scala, Squeryl has no dynamic component like EOF (i.e an EO model file). 18 18 19 -EOF has the ability to generate classes in Java (and in Objective-C prior to WebObjects 4.5) becauseenforcing type has become customary in enterprise environments. We may exploit this feature of EOF to generate a Squeryl schema.19 +EOF has the ability to generate classes in Java (and in Objective-C prior to WebObjects 4.5) and enforcing type as has become customary in enterprise environments. We may exploit this feature of EOF to generate a Squeryl schema. 20 20 21 -=== Preparing your EO model === 22 - 23 -* Make sure **all** EO entities have a class name (including abstract many-To-many "join" tables). There's no support for entities marked as ##EOGenericRecord##. 24 -* Mark the abstract many-To-Many join entities as ##Abstract##. 25 -* (Temporary) Ensure all the model entities are in the same package. i.e the package is exclusive to the model. 26 - 27 -=== Generating the Squeryl Schema === 28 - 29 29 1. Create a .eogen file for your EO model as normal. Only set the ##File Names## extension to "scala". 30 30 1. Use the Squeryl EO Templates: 31 31 ... ... @@ -32,15 +32,3 @@ 32 32 * 33 33 ** Entity.eotemplate [[template>>WOL:Squeryl _Entity.eotemplate]] 34 34 ** Entity.eotemplate [[template>>WOL:Squeryl Entity.eotemplate]] 35 - 36 -{{note title="Note"}} 37 - 38 -Any custom business "logic" will have to be manually re-written in Scala 39 - 40 -{{/note}} 41 - 42 -== Differences Between a Squeryl Schema and EOF Classes == 43 - 44 -* Optional attributes (i.e those that ##allowsNull##) are typed as ##OptionT## 45 -* To one relationships that are not mandatory (i.e optional relationships) are also typed as ##OptionT## 46 -* To many relationships are represented as a Squeryl iterable (collection class) as opposed to a ##NSArray##.