source: trunk/grails-app/domain/dbnp/studycapturing/Study.groovy @ 189

Last change on this file since 189 was 189, checked in by duh, 9 years ago
  • previous commits broke application bootstrapping:
    • fixed some domain classes where nullable and / or blank were not correctly implemented
    • commented out the PPSH study which is still buggy
  • improved wizard data handeling, error reporting and javascript
  • Property svn:keywords set to
    Date
    Author
    Rev
File size: 1.1 KB
Line 
1package dbnp.studycapturing
2
3/**
4 * Domain class describing the basic entity in the study capture part: the Study class.
5 *
6 * Revision information:
7 * $Rev: 189 $
8 * $Author: duh $
9 * $Date: 2010-02-10 16:35:11 +0000 (wo, 10 feb 2010) $
10 */
11class Study implements Serializable {
12        static searchable = true
13        nimble.User owner
14        String title
15        String code
16        String researchQuestion
17        String description
18        String ecCode
19        Date dateCreated
20        Date lastUpdated
21        Date startDate
22        Template template
23
24        static hasMany = [      editors: nimble.User,
25                        readers: nimble.User,
26                        subjects: Subject,
27                        groups: SubjectGroup,
28                        events: Event,
29                        samplingEvents: SamplingEvent,
30                        assays: Assay,
31            persons: StudyPerson,
32            publications: Publication
33        ]
34
35        static constraints = {
36                owner(nullable: true, blank: true)
37                title(nullable: false, blank: false)
38                template(nullable: true, blank: true)
39        }
40
41        static mapping = {
42                researchQuestion type: 'text'
43                description type: 'text'
44                autoTimestamp true
45        }
46
47        def String toString() {
48                return title;
49        }
50
51        def giveAllFields() {
52                return template.studyFields;
53        }
54
55        def giveSamples() {
56                return samplingEvents*.samples;
57        }
58}
Note: See TracBrowser for help on using the repository browser.