Ignore:
Timestamp:
Jan 28, 2011, 12:30:39 PM (12 years ago)
Author:
robert@…
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/domain/nl/tno/metagenomics/Sample.groovy

    r7 r9  
    88class Sample {
    99        String  sampleToken             // Unique within a study
    10         String  name                   
     10        String  name
     11        String  subject
     12        String  event
    1113       
    1214        static belongsTo    = [ study: Study ]
     
    1820                assaySamples cascade: "all-delete-orphan"
    1921        }
     22        static constraints = {
     23                subject(nullable: true)
     24                event(nullable: true)
     25        }
     26       
     27        public static cloneSample( Sample otherSample, String newSampleToken, Study otherStudy ) {
     28                return new Sample(
     29                        sampleToken: newSampleToken,
     30                        name: otherSample.name,
     31                        subject: otherSample.subject,
     32                        event: otherSample.event,
     33                        study: otherStudy
     34                );
     35        }
    2036}
Note: See TracChangeset for help on using the changeset viewer.