source: trunk/grails-app/domain/dbnp/studycapturing/SamplingEvent.groovy @ 389

Last change on this file since 389 was 359, checked in by duh, 9 years ago
  • set keyword expansion
  • Property svn:keywords set to Date Author Rev
File size: 767 bytes
Line 
1package dbnp.studycapturing
2
3/**
4 * The SamplingEvent class describes a sampling event, an event that also results in one or more samples.
5 *
6 * NOTE: according to documentation, super classes and subclasses share the same table.
7 *       thus, we could merge the sampling with the Event super class and include a boolean
8 *       However, using a separate class makes it more clear in the code that Event and SamplingEvent are treated differently
9 */
10
11class SamplingEvent extends Event {
12
13    static constraints = {
14    }
15
16    def getSamples() {
17
18        def samples = Sample.findAll("from Sample as s where s.parentEvent.id = ${this.id}" )
19        samples.collect{ it.class==SamplingEvent.class }
20        samples.collect{ it!=null }
21        return samples==null ? [] : samples
22    }
23
24}
Note: See TracBrowser for help on using the repository browser.