source: branches/features/taskProcedureRework/grails-app/domain/TaskProcedure.groovy @ 772

Last change on this file since 772 was 772, checked in by gav, 13 years ago

Domain change, add TaskProcedure updated and created fields.

File size: 926 bytes
Line 
1import org.apache.commons.collections.list.LazyList
2import org.apache.commons.collections.FactoryUtils
3
4class TaskProcedure {
5
6    Task linkedTask
7    Person createdBy
8    Person lastUpdatedBy
9    Date dateCreated = new Date() // autoTimestamp
10    Date lastUpdated = new Date() // autoTimestamp
11
12    def getDescription() { linkedTask.description }
13    def getAsset() { linkedTask.primaryAsset }
14
15    List maintenanceActions = new ArrayList()
16
17    static hasMany = [tasks: Task, maintenanceActions: MaintenanceAction]
18
19    def getMaintenanceActionLazyList() {
20        return LazyList.decorate(maintenanceActions, FactoryUtils.instantiateFactory(MaintenanceAction.class))
21    }
22
23    static mappedBy = [tasks:"taskProcedure"]
24
25    static mapping = {
26        maintenanceActions cascade:"all-delete-orphan"
27    }
28
29//     static belongsTo = []
30
31    static constraints = {
32    }
33
34    String toString() {
35        "${this.id}"
36    }
37}
Note: See TracBrowser for help on using the repository browser.