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