root/trunk/grails-app/domain/dbnp/studycapturing/Sample.groovy @ 397

Revision 397, 1.0 KB (checked in by duh, 4 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
Line 
1package dbnp.studycapturing
2
3import dbnp.data.Term
4import dbnp.data.Ontology
5
6/**
7 * The Sample class describes an actual sample which results from a SamplingEvent.
8 */
9class Sample extends TemplateEntity {
10        static searchable = true
11        Subject parentSubject
12        SamplingEvent parentEvent
13
14        //String name   // should be unique with respect to the parent study (which can be inferred)
15        //Term material // a member that describes the quantity of the sample? --> should be in the templates
16
17        /**
18         * return the domain fields for this domain class
19         * @return List
20         */
21        List<TemplateField> giveDomainFields() {
22                [
23                        new TemplateField(
24                                name: 'name',
25                                type: TemplateFieldType.STRING),
26                        new TemplateField(
27                                name: 'material',
28                                type: TemplateFieldType.ONTOLOGYTERM,
29                                ontologies: [Ontology.findByNcboId(1005)])
30                ]
31        }
32
33        static constraints = {
34                parentSubject(nullable:true)
35        }
36
37        static getSamplesFor( event ) {
38            return  Sample.findAll( 'from Sample s where s.parentEvent =:event', [event:event] )
39        }
40
41}
Note: See TracBrowser for help on using the browser.