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