Changeset 783


Ignore:
Timestamp:
Aug 6, 2010, 12:20:25 PM (9 years ago)
Author:
duh
Message:
  • Unified the internal domain identifier
Location:
trunk/grails-app/domain/dbnp/studycapturing
Files:
1 added
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/domain/dbnp/studycapturing/Assay.groovy

    r754 r783  
    66 * this data can be found.
    77 */
    8 class Assay implements Serializable {
     8class Assay extends Identity {
    99
    1010        /** The name of the assay, which should indicate the measurements represented in this assay to the user. */
  • trunk/grails-app/domain/dbnp/studycapturing/AssayModule.groovy

    r754 r783  
    44 * This entity describes actual dbNP submodule instances: what type of data they store, and how to reach them 
    55 */
    6 class AssayModule implements Serializable {
     6class AssayModule extends Identity {
    77       
    88        /** The name of the module, for user-reference purposes  */
  • trunk/grails-app/domain/dbnp/studycapturing/EventGroup.groovy

    r778 r783  
    99 * $Date$
    1010 */
    11 class EventGroup implements Serializable {
     11class EventGroup extends Identity {
    1212        String name
    1313
    14         // keep an internal identifier for use in dynamic forms
    15         private int identifier = 0
    16         static int iterator = 0
    17 
    18         static transients = [ "identifier", "iterator" ]
    1914        static belongsTo = [parent : Study]
    2015        static hasMany = [
     
    2621        static constraints = {
    2722        }
    28 
    29         /**
    30          * Class constructor increments that static iterator
    31          * and sets the object's identifier (used in dynamic webforms)
    32          * @void
    33          */
    34         public EventGroup() {
    35                 if (!identifier) identifier = iterator++
    36         }
    37 
    38         /**
    39          * Return the identifier
    40          * @return int
    41          */
    42         final public int getIdentifier() {
    43                 return identifier
    44         }
    4523}
  • trunk/grails-app/domain/dbnp/studycapturing/Person.groovy

    r754 r783  
    66 * is independent of GSCF usernames and accounts.
    77 */
    8 class Person implements Serializable {
     8class Person extends Identity {
    99        String title
    1010        String gender
  • trunk/grails-app/domain/dbnp/studycapturing/PersonAffiliation.groovy

    r754 r783  
    55 * PersonAffiliation is an independent list of affiliations, and does not neccessarily belong to one Person.
    66 */
    7 class PersonAffiliation implements Serializable {
     7class PersonAffiliation extends Identity {
    88
    99        String institute
  • trunk/grails-app/domain/dbnp/studycapturing/PersonRole.groovy

    r754 r783  
    66 * Generally, there will only be a few PersonRoles such as PI, lab analyst etc.
    77 */
    8 class PersonRole implements Serializable {
     8class PersonRole extends Identity {
    99
    1010        /** The name of the role, such as Project Leader or PI */
  • trunk/grails-app/domain/dbnp/studycapturing/Publication.groovy

    r754 r783  
    77 * and are not connected to Study instances via a cascading relation.
    88 */
    9 class Publication implements Serializable {
     9class Publication extends Identity {
    1010        String title
    1111        String pubMedID
  • trunk/grails-app/domain/dbnp/studycapturing/StudyPerson.groovy

    r754 r783  
    44 * Link table which couples studies with persons and the role they have within the study
    55 */
    6 class StudyPerson implements Serializable {
     6class StudyPerson extends Identity {
    77
    88        // A StudyPerson relation always belongs to one study.
  • trunk/grails-app/domain/dbnp/studycapturing/Template.groovy

    r778 r783  
    1717 * $Date$
    1818 */
    19 class Template implements Serializable {
     19class Template extends Identity {
    2020
    2121        /** The name of the template */
     
    3434        List fields
    3535
    36         // keep an internal identifier for use in dynamic forms
    37         private int identifier = 0
    38         static int iterator = 0
    39 
    40         // set transients
    41         static transients = [ "identifier", "iterator" ]
    42 
    4336        static hasMany = [fields: TemplateField]
    4437
     38        // constraints
    4539        static constraints = {
    46 
    4740                owner(nullable: true, blank: true)
    4841                description(nullable: true, blank: true)
     
    7871                // which can co-exist with the same name. See also TemplateField
    7972                //      name(unique:['entity'])
    80         }
    81 
    82         /**
    83          * Class constructor increments that static iterator
    84          * and sets the object's identifier (used in dynamic webforms)
    85          * @void
    86          */
    87         public Template() {
    88                 if (!identifier) identifier = iterator++
    89                 println ".instantiating [" + this.getClass() + "] ("+ identifier + ")"
    90         }
    91 
    92         /**
    93          * Return the identifier
    94          * @return int
    95          */
    96         final public int getIdentifier() {
    97                 return identifier
    9873        }
    9974
  • trunk/grails-app/domain/dbnp/studycapturing/TemplateEntity.groovy

    r778 r783  
    1717 * $Date$
    1818 */
    19 abstract class TemplateEntity implements Serializable {
     19abstract class TemplateEntity extends Identity {
    2020        /** The actual template of this TemplateEntity instance */
    2121        Template template
Note: See TracChangeset for help on using the changeset viewer.