or in namedQueries in Grails 2.3.8: AbstractMethod

2019-03-06 11:56发布

问题:

After upgrading from Grails 2.2.4 to 2.3.8 I'm getting

java.lang.AbstractMethodError: grails.orm.HibernateCriteriaBuilder.or(Lgroovy/lang/Closure;)Lorg/grails/datastore/mapping/query/api/Criteria;

in a query

class Trip {
    TripParticipant driver, passenger

    static namedQueries = {
        byParticipant { UserAccount ua, name = null ->
            or {
                for( n in ( name ? [ name ] : [ 'driver', 'passenger' ] ) ) {
                    eq "${n}.account", ua
                }
            }
        }  
    }
}

class TripParticipant {
    UserAccount account

    boolean rated = false
}

any ideas?

TIA

UPDATE

http://www.file-upload.net/download-8906460/dependency-report.txt.html is the output of dependency-report

回答1:

I found the problem.

when I downdraded mongo-db plugin from

compile ':mongodb:3.0.1'

to

compile ':mongodb:3.0.0'

it worked like charm again.



回答2:

Rather than downgrade mongodb try and upgrade the version of hibernate you are using to the latest version to make sure the 2 project’s dependencies are in sync



标签: grails gorm