spring-attic/grails-data-mapping

Neo4j: Criteria query with 'in' list fails

Closed this issue · 1 comments

A query of the form

    def user = User.get(10) //example
    User.createCriteria().list {
        friends {
            'in' 'id', [user?.id]
        }
    }

fails with the error:
"No signature of method: org.grails.datastore.gorm.neo4j.Neo4jQuery.matchesCriterionAssociationQuery() is applicable for argument types: (java.util.ArrayList)"

Domain class User
class User {
static hasMany = [friends: User]
}

Try removing friends bracket like following:

def user = User.get(10) //example
User.createCriteria().list {
    'in' ('friends', [user?.id])
}