source: trunk/grails-app/domain/AssetSubItem.groovy @ 421

Last change on this file since 421 was 341, checked in by gav, 15 years ago

Add unique constraint to AssetSubItem name.

File size: 709 bytes
Line 
1class AssetSubItem {
2
3    AssetSubItem parentItem
4
5    String name
6    String description = ""
7    String comment = ""
8    boolean isActive = true
9
10    static hasMany = [assets: Asset,
11                                subItems: AssetSubItem,
12                                maintenanceActions: MaintenanceAction,
13                                assetSubItemExtendedAttributes: AssetSubItemExtendedAttribute]
14
15    static belongsTo = [Asset, AssetSubItem]
16
17    static constraints = {
18        name(maxSize:50, unique:true, blank:false)
19        description(maxSize:75)
20        comment(maxSize:500)
21        isActive()
22        parentItem(nullable:true)
23    }
24
25    String toString() {
26        "${this.name}"
27    }
28}
29
Note: See TracBrowser for help on using the repository browser.