Permalink
Browse files

added first fields and relationships to domain classes

  • Loading branch information...
1 parent e8c88a8 commit 2ed6108b18e6e0164f88849c987e5c6614f18f67 @jettro committed Dec 17, 2009
@@ -1,6 +1,16 @@
+import nl.gridshore.scheduling.Person
+
class BootStrap {
def init = { servletContext ->
+ def jettro = new Person(name:'Jettro',partTimeFactor:1)
+ jettro.save()
+ def roberto = new Person(name:'Roberto',partTimeFactor:1)
+ roberto.save()
+ def allard = new Person(name:'Allard',partTimeFactor:1)
+ allard.save()
+ def bram = new Person(name:'Bram',partTimeFactor:0.8)
+ bram.save()
}
def destroy = {
}
@@ -2,5 +2,5 @@ package nl.gridshore.scheduling
class PersonController {
- def index = { }
+ def scaffold = true
}
@@ -2,5 +2,5 @@ package nl.gridshore.scheduling
class ProjectController {
- def index = { }
+ def scaffold = true
}
@@ -2,5 +2,5 @@ package nl.gridshore.scheduling
class UserController {
- def index = { }
+ def scaffold = true
}
@@ -1,7 +1,13 @@
package nl.gridshore.scheduling
class Person {
+ String name
+ float partTimeFactor
+
+ static hasMany = [projects:Project]
static constraints = {
+ name (blank:false, minSize:2, maxSize:25)
+ partTimeFactor(min:0f,max:1f)
}
}
@@ -1,7 +1,9 @@
package nl.gridshore.scheduling
class Project {
-
+ String name
+
static constraints = {
+ name(blank:false, maxSize:100, minSize:3)
}
}
@@ -1,6 +1,9 @@
package nl.gridshore.scheduling
class User {
+ String username
+ // TODO find out if it is possible to use sha1 encoding of the password
+ String password
static constraints = {
}

0 comments on commit 2ed6108

Please sign in to comment.