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