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/AssaySample.groovy

    r7 r9  
    1616        String oligoNumber              // Oligonumber used to identify the sample
    1717        String tagSequence              // Tag originally used to identify the sample
     18        String tagName                  // Tag name
    1819
    1920        static belongsTo  = [ assay: Assay, sample: Sample, run: Run ]
     
    2324                numUniqueSequences(nullable: true)
    2425                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                 */
    2552                tagSequence(nullable: true)
     53                tagName(nullable:true)
    2654                run(nullable: true);
    2755        }
     
    150178         */
    151179        public boolean containsData() {
    152                 return tagSequence || oligoNumber || numFiles() > 0;
     180                return tagSequence || tagName || oligoNumber || numFiles() > 0;
    153181        }
    154182       
     
    164192                otherAssaySample.tagSequence = tagSequence;
    165193                otherAssaySample.oligoNumber = oligoNumber;
     194                otherAssaySample.tagName         = tagName;
    166195                otherAssaySample.run         = run;
    167196               
Note: See TracChangeset for help on using the changeset viewer.