Changeset 1902 for trunk


Ignore:
Timestamp:
May 31, 2011, 10:09:18 AM (8 years ago)
Author:
robert@…
Message:

Resolving issues with searching (#446)

Location:
trunk/src/groovy/dbnp/query
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/groovy/dbnp/query/Criterion.groovy

    r1866 r1902  
    313313                        if(
    314314                                ( fieldName == "template" ) ||
    315                                 ( objectToSearchIn == "subject" && fieldName == "species" ) ||
    316                                 ( objectToSearchIn == "sample" && fieldName == "material" ) ||
    317                                 ( objectToSearchIn == "assay" && fieldName == "module" ) ||
    318                                 ( objectToSearchIn == "samplingEvent" && fieldName == "sampleTemplate" ) ) {
     315                                ( objectToSearchIn.toLowerCase() == "subject" && fieldName.toLowerCase() == "species" ) ||
     316                                ( objectToSearchIn.toLowerCase() == "sample" && fieldName.toLowerCase() == "material" ) ||
     317                                ( objectToSearchIn.toLowerCase() == "assay" && fieldName.toLowerCase() == "module" ) ||
     318                                ( objectToSearchIn.toLowerCase() == "samplingevent" && fieldName.toLowerCase() == "sampletemplate" ) ) {
    319319                                fieldName += ".name"
    320320                        }
  • trunk/src/groovy/dbnp/query/Search.groovy

    r1850 r1902  
    339339                       
    340340                        // If there are entities matching these criteria, put a where clause in the full HQL query
    341                         if( entities ) {
     341                        if( entities && entities.findAll { it } ) {
    342342                                // Find criteria that match one or more 'complex' fields
    343343                                // These criteria must be checked extra, since they are not correctly handled
Note: See TracChangeset for help on using the changeset viewer.