- Timestamp:
- Jan 28, 2011, 12:30:39 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/domain/nl/tno/metagenomics/AssaySample.groovy
r7 r9 16 16 String oligoNumber // Oligonumber used to identify the sample 17 17 String tagSequence // Tag originally used to identify the sample 18 String tagName // Tag name 18 19 19 20 static belongsTo = [ assay: Assay, sample: Sample, run: Run ] … … 23 24 numUniqueSequences(nullable: true) 24 25 oligoNumber(nullable: true) 26 27 /* 28 , validator: { value, obj, errors -> 29 // When one oligoNumber is used in different assaysamples, 30 // they must also have the same tagSequences and tagNames 31 32 // Check whether this oligoNumber exists in the database 33 def otherAssaySamples = AssaySample.findAllByOligoNumber( value ) 34 if( !otherAssaySamples || otherAssaySamples.size() == 0 ) { 35 return true; 36 } 37 38 // Loop through the other assaysamples with this oligonumber 39 otherAssaySamples.each { otherAS -> 40 // Only check other objects, don't compare with itself (because that 41 // way it wouldn't be possible anymore to edit an object) 42 if( otherAS.id != obj.id ) { 43 if( otherAS.tagSequence != obj.tagSequence || otherAS.tagName != obj.tagName ) { 44 return false; 45 } 46 } 47 } 48 49 return true 50 } 51 */ 25 52 tagSequence(nullable: true) 53 tagName(nullable:true) 26 54 run(nullable: true); 27 55 } … … 150 178 */ 151 179 public boolean containsData() { 152 return tagSequence || oligoNumber || numFiles() > 0;180 return tagSequence || tagName || oligoNumber || numFiles() > 0; 153 181 } 154 182 … … 164 192 otherAssaySample.tagSequence = tagSequence; 165 193 otherAssaySample.oligoNumber = oligoNumber; 194 otherAssaySample.tagName = tagName; 166 195 otherAssaySample.run = run; 167 196
Note: See TracChangeset
for help on using the changeset viewer.