Changeset 1436 for trunk/src/groovy/dbnp
- Timestamp:
- Jan 24, 2011, 3:48:46 PM (10 years ago)
- Location:
- trunk/src/groovy/dbnp/query
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/groovy/dbnp/query/Criterion.groovy
r1430 r1436 93 93 def classname = fieldValue.class.getName(); 94 94 classname = classname[classname.lastIndexOf( '.' ) + 1..-1].toLowerCase(); 95 95 96 println "Match " + fieldValue + " of class " + classname + " with " + this 97 96 98 try { 97 99 switch( classname ) { … … 238 240 rt = new RelTime( value.toString() ); 239 241 } 240 242 241 243 return compareValues( fieldValue, this.operator, rt ); 242 244 } catch( Exception e ) { -
trunk/src/groovy/dbnp/query/SampleSearch.groovy
r1432 r1436 73 73 if( getEntityCriteria( 'Study' ).size() > 0 ) { 74 74 def studies = Study.findAll(); 75 76 studies = filterOnStudyCriteria( studies ); 77 75 78 if( studies.size() == 0 ) { 76 79 results = []; 77 80 return; 78 81 } 79 studies = filterOnStudyCriteria( studies );80 82 81 83 def c = Sample.createCriteria() … … 92 94 samples = filterOnSamplingEventCriteria( samples ); 93 95 samples = filterOnAssayCriteria( samples ); 94 96 95 97 // Save matches 96 98 results = samples; … … 142 144 */ 143 145 protected List filterOnEventCriteria( List samples ) { 146 println "Event criteria: " + getEntityCriteria( 'Event' ) 144 147 return filterEntityList( samples, getEntityCriteria( 'Event' ), { sample, criterion -> 145 if( !sample || !sample.parentEventGroup || !sample.parentEventGroup.events ?.size())146 return false 147 148 return criterion.matchAny( sample.parentEventGroup.events );148 if( !sample || !sample.parentEventGroup || !sample.parentEventGroup.events || sample.parentEventGroup.events.size() == 0 ) 149 return false 150 151 return criterion.matchAny( sample.parentEventGroup.events.toList() ); 149 152 }); 150 153 } … … 174 177 return []; 175 178 179 if( getEntityCriteria( 'Assay' ).size() == 0 ) 180 return samples 181 176 182 // There is no sample.assays property, so we have to look for assays another way: just find 177 183 // all assays that match the criteria
Note: See TracChangeset
for help on using the changeset viewer.