source: trunk/grails-app/domain/dbnp/studycapturing/Subject.groovy @ 640

Last change on this file since 640 was 640, checked in by vinlud, 11 years ago

Setting Searchable only to search in known string fields

  • Property svn:keywords set to Date Rev Author
File size: 948 bytes
Line 
1package dbnp.studycapturing
2
3import dbnp.data.Term
4import dbnp.data.Ontology
5
6/**
7 * This domain class describes the subjects in a study.
8 *
9 * Revision information:
10 * $Rev: 640 $
11 * $Author: vinlud $
12 * $Date: 2010-07-02 07:38:49 +0000 (vr, 02 jul 2010) $
13 */
14class Subject extends TemplateEntity implements Serializable {
15    static searchable = {
16           [only: ['name']]
17    }
18        String name
19        Term species
20
21        /**
22         * return the domain fields for this domain class
23         * @return List
24         */
25        static List<TemplateField> giveDomainFields() { return Subject.domainFields; }
26
27        static List<TemplateField> domainFields = [
28                new TemplateField(
29                        name: 'name',
30                        type: TemplateFieldType.STRING,
31                        preferredIdentifier: true,
32                        comment: 'Use the local subject name or the pre-defined name'),
33                new TemplateField(
34                        name: 'species',
35                        type: TemplateFieldType.ONTOLOGYTERM,
36                        comment: "The species name is based on the NEWT ontology; if a species is missing, please add it to the ontology using 'add more'")
37        ]
38}
Note: See TracBrowser for help on using the repository browser.