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

Last change on this file since 397 was 397, checked in by duh, 10 years ago
  • reformatted source code
  • added mega huge big ASCII comments to UNDOCUMMENTED of not properly DOCUMENTED classess... we have agreed many many MANY times that everyone should document their code according to JavaDoc? style... but why does nobody do it, or just keep SLACKING! /annoyed modus
  • Property svn:keywords set to Date Author Rev
File size: 2.8 KB
Line 
1package dbnp.studycapturing
2
3/**
4 * 888       888 888    888 8888888888 8888888b.  8888888888
5 * 888   o   888 888    888 888        888   Y88b 888
6 * 888  d8b  888 888    888 888        888    888 888
7 * 888 d888b 888 8888888888 8888888    888   d88P 8888888
8 * 888d88888b888 888    888 888        8888888P"  888
9 * 88888P Y88888 888    888 888        888 T88b   888
10 * 8888P   Y8888 888    888 888        888  T88b  888
11 * 888P     Y888 888    888 8888888888 888   T88b 8888888888
12 *
13 * 8888888 .d8888b.     88888888888 888    888 8888888888
14 *   888  d88P  Y88b        888     888    888 888
15 *   888  Y88b.             888     888    888 888
16 *   888   "Y888b.          888     8888888888 8888888
17 *   888      "Y88b.        888     888    888 888
18 *   888        "888        888     888    888 888
19 *   888  Y88b  d88P        888     888    888 888
20 * 8888888 "Y8888P"         888     888    888 8888888888
21 *
22 *   888888        d8888 888     888     d8888 8888888b.   .d88888b.   .d8888b.
23 *     "88b       d88888 888     888    d88888 888  "Y88b d88P" "Y88b d88P  Y88b
24 *      888      d88P888 888     888   d88P888 888    888 888     888 888    888
25 *      888     d88P 888 Y88b   d88P  d88P 888 888    888 888     888 888
26 *      888    d88P  888  Y88b d88P  d88P  888 888    888 888     888 888
27 *      888   d88P   888   Y88o88P  d88P   888 888    888 888     888 888    888
28 *      88P  d8888888888    Y888P  d8888888888 888  .d88P Y88b. .d88P Y88b  d88P
29 *      888 d88P     888     Y8P  d88P     888 8888888P"   "Y88888P"   "Y8888P"
30 *    .d88P
31 *  .d88P"
32 * 888P"
33 *
34 *  .d8888b.  888  .d8888b.  888  .d8888b.  888
35 * d88P  Y88b 888 d88P  Y88b 888 d88P  Y88b 888
36 *      .d88P 888      .d88P 888      .d88P 888
37 *    .d88P"  888    .d88P"  888    .d88P"  888
38 *    888"    888    888"    888    888"    888
39 *    888     Y8P    888     Y8P    888     Y8P
40 *             "              "              "
41 *    888     888    888     888    888     888
42 *
43 *
44 * TODO: add PROPER class and method documentation, just like have
45 *       agreed upon hundreds of times!!!!
46 */
47
48/**
49 * The SamplingEvent class describes a sampling event, an event that also results in one or more samples.
50 *
51 * NOTE: according to documentation, super classes and subclasses share the same table.
52 *       thus, we could merge the sampling with the Event super class and include a boolean
53 *       However, using a separate class makes it more clear in the code that Event and SamplingEvent are treated differently
54 */
55
56class SamplingEvent extends Event {
57
58    static constraints = {
59    }
60
61    def getSamples() {
62
63        def samples = Sample.findAll("from Sample as s where s.parentEvent.id = ${this.id}" )
64        samples.collect{ it.class==SamplingEvent.class }
65        samples.collect{ it!=null }
66        return samples==null ? [] : samples
67    }
68
69}
Note: See TracBrowser for help on using the repository browser.