Uploaded image for project: 'Spring Data MongoDB'
  1. Spring Data MongoDB
  2. DATAMONGO-1063

IllegalStateException using any().in()

    XMLWordPrintable

    Details

      Description

      I am using 1.6.0.RELEASE with querydsl 3.4.3.

      When doing a Predicate based search using

      entity.listType.any().in(someString)
      

      I am getting IllegalStateException (see below)

      It looks like the following issue/commit in querydsl is causing this issue:
      https://github.com/querydsl/querydsl/issues/512
      https://github.com/querydsl/querydsl/commit/7e934bed158702392086e200cd6ddb17634c5ce6

      Caused by: java.lang.IllegalStateException: name property not available for path of type COLLECTION_ANY. Use getElement() to access the generic path element.
      	at com.mysema.query.types.PathMetadata.getName(PathMetadata.java:73) ~[querydsl-core-3.4.3.jar:na]
      	at org.springframework.data.mongodb.repository.support.SpringDataMongodbSerializer.getPropertyFor(SpringDataMongodbSerializer.java:146) ~[spring-data-mongodb-1.6.0.RELEASE-onshape.jar:na]
      	at org.springframework.data.mongodb.repository.support.SpringDataMongodbSerializer.isReference(SpringDataMongodbSerializer.java:103) ~[spring-data-mongodb-1.6.0.RELEASE-onshape.jar:na]
      	at com.mysema.query.mongodb.MongodbSerializer.isReference(MongodbSerializer.java:296) ~[querydsl-mongodb-3.4.3.jar:na]
      	at com.mysema.query.mongodb.MongodbSerializer.visit(MongodbSerializer.java:113) ~[querydsl-mongodb-3.4.3.jar:na]
      	at com.mysema.query.mongodb.MongodbSerializer.visit(MongodbSerializer.java:52) ~[querydsl-mongodb-3.4.3.jar:na]
      	at com.mysema.query.types.OperationImpl.accept(OperationImpl.java:91) ~[querydsl-core-3.4.3.jar:na]
      	at com.mysema.query.mongodb.MongodbSerializer.handle(MongodbSerializer.java:55) ~[querydsl-mongodb-3.4.3.jar:na]
      	at com.mysema.query.mongodb.MongodbSerializer.visit(MongodbSerializer.java:123) ~[querydsl-mongodb-3.4.3.jar:na]
      	at com.mysema.query.mongodb.MongodbSerializer.visit(MongodbSerializer.java:52) ~[querydsl-mongodb-3.4.3.jar:na]
      	at com.mysema.query.types.OperationImpl.accept(OperationImpl.java:91) ~[querydsl-core-3.4.3.jar:na]
      	at com.mysema.query.mongodb.MongodbSerializer.handle(MongodbSerializer.java:55) ~[querydsl-mongodb-3.4.3.jar:na]
      	at com.mysema.query.mongodb.MongodbQuery.createQuery(MongodbQuery.java:376) ~[querydsl-mongodb-3.4.3.jar:na]
      	at com.mysema.query.mongodb.MongodbQuery.createCursor(MongodbQuery.java:270) ~[querydsl-mongodb-3.4.3.jar:na]
      	at com.mysema.query.mongodb.MongodbQuery.createCursor(MongodbQuery.java:265) ~[querydsl-mongodb-3.4.3.jar:na]
      	at com.mysema.query.mongodb.MongodbQuery.iterate(MongodbQuery.java:221) ~[querydsl-mongodb-3.4.3.jar:na]
      	at org.springframework.data.mongodb.repository.support.QueryDslMongoRepository.findAll(QueryDslMongoRepository.java:118) ~[spring-data-mongodb-1.6.0.RELEASE-onshape.jar:na]
      

        Attachments

          Activity

            People

            Assignee:
            cstrobl Christoph Strobl
            Reporter:
            spasam Seshu Pasam
            Last updater:
            Spring Issues Spring Issues
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: