Last change
on this file since 378 was
341,
checked in by gav, 15 years ago
|
Add unique constraint to AssetSubItem name.
|
File size:
709 bytes
|
Rev | Line | |
---|
[268] | 1 | class AssetSubItem { |
---|
[121] | 2 | |
---|
[268] | 3 | AssetSubItem parentItem |
---|
| 4 | |
---|
[118] | 5 | String name |
---|
| 6 | String description = "" |
---|
[330] | 7 | String comment = "" |
---|
[118] | 8 | boolean isActive = true |
---|
| 9 | |
---|
[276] | 10 | static hasMany = [assets: Asset, |
---|
| 11 | subItems: AssetSubItem, |
---|
[268] | 12 | maintenanceActions: MaintenanceAction, |
---|
| 13 | assetSubItemExtendedAttributes: AssetSubItemExtendedAttribute] |
---|
[121] | 14 | |
---|
[268] | 15 | static belongsTo = [Asset, AssetSubItem] |
---|
[121] | 16 | |
---|
[268] | 17 | static constraints = { |
---|
[341] | 18 | name(maxSize:50, unique:true, blank:false) |
---|
[330] | 19 | description(maxSize:75) |
---|
| 20 | comment(maxSize:500) |
---|
[268] | 21 | isActive() |
---|
| 22 | parentItem(nullable:true) |
---|
| 23 | } |
---|
[118] | 24 | |
---|
| 25 | String toString() { |
---|
| 26 | "${this.name}" |
---|
| 27 | } |
---|
| 28 | } |
---|
| 29 | |
---|
Note: See
TracBrowser
for help on using the repository browser.