|
Last change
on this file since 767 was
762,
checked in by gav, 15 years ago
|
|
Domain change on TaskProcedure and MaintenanceAction, continue task procedure rework.
|
|
File size:
778 bytes
|
| Line | |
|---|
| 1 | import org.apache.commons.collections.list.LazyList |
|---|
| 2 | import org.apache.commons.collections.FactoryUtils |
|---|
| 3 | |
|---|
| 4 | class TaskProcedure { |
|---|
| 5 | |
|---|
| 6 | Task linkedTask |
|---|
| 7 | |
|---|
| 8 | def getDescription() { linkedTask.description } |
|---|
| 9 | def getAsset() { linkedTask.primaryAsset } |
|---|
| 10 | |
|---|
| 11 | List maintenanceActions = new ArrayList() |
|---|
| 12 | |
|---|
| 13 | static hasMany = [tasks: Task, maintenanceActions: MaintenanceAction] |
|---|
| 14 | |
|---|
| 15 | def getMaintenanceActionLazyList() { |
|---|
| 16 | return LazyList.decorate(maintenanceActions, FactoryUtils.instantiateFactory(MaintenanceAction.class)) |
|---|
| 17 | } |
|---|
| 18 | |
|---|
| 19 | static mappedBy = [tasks:"taskProcedure"] |
|---|
| 20 | |
|---|
| 21 | static mapping = { |
|---|
| 22 | maintenanceActions cascade:"all-delete-orphan" |
|---|
| 23 | } |
|---|
| 24 | |
|---|
| 25 | // static belongsTo = [] |
|---|
| 26 | |
|---|
| 27 | static constraints = { |
|---|
| 28 | } |
|---|
| 29 | |
|---|
| 30 | String toString() { |
|---|
| 31 | "${this.id}" |
|---|
| 32 | } |
|---|
| 33 | } |
|---|
Note: See
TracBrowser
for help on using the repository browser.