Line | |
---|
1 | class Person { |
---|
2 | String firstName |
---|
3 | String lastName |
---|
4 | Integer employeeID |
---|
5 | boolean isActive = true |
---|
6 | |
---|
7 | static hasMany = [modifications : Modification, |
---|
8 | entries : Entry, |
---|
9 | tasks : Task, |
---|
10 | personGroups : PersonGroup] |
---|
11 | |
---|
12 | static belongsTo = [PersonGroup] |
---|
13 | |
---|
14 | static optionals = ["employeeID"] |
---|
15 | |
---|
16 | static constraints = { |
---|
17 | firstName(maxSize:50,blank:false) |
---|
18 | lastName(maxSize:50,blank:false) |
---|
19 | employeeID(blank:true, nullable:true) |
---|
20 | } |
---|
21 | |
---|
22 | //Overriding the default toString method |
---|
23 | String toString() {"${this.firstName} ${this.lastName}"} |
---|
24 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.