I am using Criteria with projections to get a list of tags on my Account domain. Like this:
def tags = Account.createCriteria().list {
projections { property("tags") }
}
My Account domain:
class Account {
static mapWith = "mongo"
List<Tag> tags
...
static embedded = ['tags']
}
BuildConfig.groovy
// using grails 2.3.8
plugins {
runtime ":hibernate:3.6.10.17"
compile ":mongodb:2.0.1"
This worked until I upgraded the MongoDB GORM plugin for grails from 2.0.1 to 3.0.1
compile ":mongodb:3.0.1"
Now I see the following error...
The class [java.util.List] is not a known persistent type.
at org.grails.datastore.mapping.core.AbstractSession.retrieveAll(AbstractSession.java:723)
at org.grails.datastore.mapping.mongo.query.MongoQuery$AggregatedResultList.initializeFully(MongoQuery.java:1601)
at org.grails.datastore.mapping.mongo.query.MongoQuery$AggregatedResultList.size(MongoQuery.java:1764)
Why did this work before but is failing now? I don't want to rewrite all my existing queries to use mongoDB's aggregation framework.