Rev | Line | |
---|
[58] | 1 | class Person { |
---|
| 2 | static transients = ['pass'] |
---|
[59] | 3 | static hasMany = [authorities: Authority, |
---|
| 4 | personGroups: PersonGroup] |
---|
| 5 | // modifications: Modification, |
---|
| 6 | // entries: Entry, |
---|
| 7 | // tasks: Task] |
---|
[58] | 8 | |
---|
[59] | 9 | static belongsTo = [Authority, PersonGroup] |
---|
| 10 | |
---|
[58] | 11 | String loginName |
---|
| 12 | String firstName |
---|
| 13 | String lastName |
---|
| 14 | String employeeID |
---|
| 15 | |
---|
| 16 | /** MD5 Password */ |
---|
| 17 | String password |
---|
| 18 | |
---|
| 19 | /** enabled */ |
---|
| 20 | boolean isActive = true |
---|
| 21 | |
---|
| 22 | String email |
---|
| 23 | boolean emailShow = true |
---|
| 24 | |
---|
| 25 | /** description */ |
---|
| 26 | String description = '' |
---|
| 27 | |
---|
| 28 | /** plain password to create a MD5 password */ |
---|
| 29 | String pass = '[secret]' |
---|
| 30 | |
---|
| 31 | static constraints = { |
---|
[59] | 32 | loginName(blank: false, unique: true)//minSize:7 |
---|
[58] | 33 | firstName(blank: false) |
---|
| 34 | lastName(blank: false) |
---|
[59] | 35 | password(blank: false) //minSize:7 |
---|
[58] | 36 | employeeID(blank: true, nullable:true) |
---|
| 37 | } |
---|
| 38 | |
---|
| 39 | //Overriding the default toString method |
---|
| 40 | String toString() {"${this.firstName} ${this.lastName}"} |
---|
| 41 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.