0

Using Grails 2.3.0: According to the documentation: http://grails.org/doc/latest/ref/Domain%20Classes/createCriteria.html

One can create case-insensitive Eq criterions, using a third argument [ignoreCase: true]. Like this:

eq(field, string, [ignoreCase: true])

However this throws an error:

No signature of method: grails.gorm.DetachedCriteria.eq() is applicable for argument types: (java.lang.String, java.lang.String, java.util.LinkedHashMap) values: [xx, yy, [ignoreCase:true]]
Possible solutions: eq(java.lang.String, java.lang.Object), get(), grep(), any(), ge(java.lang.String, java.lang.Object), gt(java.lang.String, java.lang.Object). Stacktrace follows:

This Jira states an issue with MongoDB. I am using Oracle 11G and I am experiencing the exact same thing.

Is the operation in the documentation actually supported at all (looking through the code, it doesn't seem like it...)? Should this not work for DetachedCriterias as well (can't find otherwise in the docs...)?.

Codesnippet:

public DetachedCriteria createCriteriaForArbejdssted(SoegeCommand command, DetachedCriteria criteria) {
    criteria = criteria.build {
        if(command.harArbejdsstedskriterier()) {
            'arbejdsstedsPerioder' {
                'arbejdssted' {
                    if(command.arbejdsstedsnavn) { eq('navn', command.arbejdsstedsnavn, [ignoreCase: true])}
                }
            }
        }
    }
Hoof
  • 1,738
  • 2
  • 17
  • 39

0 Answers0