Changeset 1904 for trunk


Ignore:
Timestamp:
May 31, 2011, 12:25:51 PM (8 years ago)
Author:
robert@…
Message:

Fixed a bug for case-insensitive search in 'complex' fields

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

Legend:

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

    r1902 r1904  
    485485                def condition = "exists ( FROM " + objectToSearchIn + "." + collection + " as " + uniquePrefix + "_" + collection + " WHERE %s )";
    486486
    487                 return extendWhereClause( condition, uniquePrefix + "_" + collection + "." + searchField, uniquePrefix, "STRING", value );
     487                return extendWhereClause( condition, uniquePrefix + "_" + collection + "." + searchField, uniquePrefix, "String", value );
    488488        }
    489489
  • trunk/src/groovy/dbnp/query/Search.groovy

    r1903 r1904  
    337337                        def hqlQuery = entityHQL.from + " WHERE " + whereClauses.join( searchMode == SearchMode.and ? " AND " : " OR " );                       
    338338                        def entities = entityClass.findAll( hqlQuery, entityHQL.parameters )
    339                        
     339
    340340                        // If there are entities matching these criteria, put a where clause in the full HQL query
    341341                        if( entities ) {
     
    593593        protected filterForComplexCriteria( def entities, def entityCriteria ) {
    594594                def complexCriteria = entityCriteria.findAll { it.isComplexCriterion() }
    595 
     595               
    596596                if( complexCriteria ) {
    597597                        def checkCallback = { entity, criterion ->
    598598                                def value = criterion.getFieldValue( entity )
    599 
     599                               
    600600                                if( value == null ) {
    601601                                        return false
     
    608608                                }
    609609                        }
    610 
     610                       
    611611                        entities = filterEntityList( entities, complexCriteria, checkCallback );
    612612                }
Note: See TracChangeset for help on using the changeset viewer.