title: "No property exists found for type"... When using the QueryDslPredicateExecutor with MongoDB and Spring-Data
body: <p>I'm trying to use the QueryDslPredicateExecutor with MongoDB and Spring-Data, but it seems to be choking on the "exists()" property.</p>
  
  <p>I'm using -  </p>
  
  <pre><code>org.springframework.boot:spring-boot-starter-parent:1.3.5.RELEASE  
  com.querydsl:querydsl-mongodb:4.1.2  
  com.querydsl:querydsl-apt:4.1.2  
  org.mongodb.morphia:morphia:1.1.1  
  </code></pre>
  
  <p>Stack Trace  </p>
  
  <pre><code>Caused by: org.springframework.data.mapping.PropertyReferenceException: No property exists found for type Tree!
      at org.springframework.data.mapping.PropertyPath.&lt;init&gt;(PropertyPath.java:77) ~[spring-data-commons-1.12.0.RELEASE.jar:na]
      at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:329) ~[spring-data-commons-1.12.0.RELEASE.jar:na]
      at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:309) ~[spring-data-commons-1.12.0.RELEASE.jar:na]
      at org.springframework.data.mapping.PropertyPath.from(PropertyPath.java:272) ~[spring-data-commons-1.12.0.RELEASE.jar:na]
      at org.springframework.data.mapping.PropertyPath.from(PropertyPath.java:243) ~[spring-data-commons-1.12.0.RELEASE.jar:na]
      at org.springframework.data.repository.query.parser.Part.&lt;init&gt;(Part.java:76) ~[spring-data-commons-1.12.0.RELEASE.jar:na]
      at org.springframework.data.repository.query.parser.PartTree$OrPart.&lt;init&gt;(PartTree.java:235) ~[spring-data-commons-1.12.0.RELEASE.jar:na]
      at org.springframework.data.repository.query.parser.PartTree$Predicate.buildTree(PartTree.java:373) ~[spring-data-commons-1.12.0.RELEASE.jar:na]
      at org.springframework.data.repository.query.parser.PartTree$Predicate.&lt;init&gt;(PartTree.java:353) ~[spring-data-commons-1.12.0.RELEASE.jar:na]
      at org.springframework.data.repository.query.parser.PartTree.&lt;init&gt;(PartTree.java:84) ~[spring-data-commons-1.12.0.RELEASE.jar:na]
      at org.springframework.data.mongodb.repository.query.PartTreeMongoQuery.&lt;init&gt;(PartTreeMongoQuery.java:60) ~[spring-data-mongodb-1.9.0.RELEASE.jar:na]
      at org.springframework.data.mongodb.repository.support.MongoRepositoryFactory$MongoQueryLookupStrategy.resolveQuery(MongoRepositoryFactory.java:168) ~[spring-data-mongodb-1.9.0.RELEASE.jar:na]
      at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.&lt;init&gt;(RepositoryFactorySupport.java:435) ~[spring-data-commons-1.12.0.RELEASE.jar:na]
      at org.springframework.data.repository.core.support.RepositoryFactorySupport.getRepository(RepositoryFactorySupport.java:220) ~[spring-data-commons-1.12.0.RELEASE.jar:na]
      at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.initAndReturn(RepositoryFactoryBeanSupport.java:266) ~[spring-data-commons-1.12.0.RELEASE.jar:na]
      at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.afterPropertiesSet(RepositoryFactoryBeanSupport.java:252) ~[spring-data-commons-1.12.0.RELEASE.jar:na]
      at org.springframework.data.mongodb.repository.support.MongoRepositoryFactoryBean.afterPropertiesSet(MongoRepositoryFactoryBean.java:108) ~[spring-data-mongodb-1.9.0.RELEASE.jar:na]
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1637) ~[spring-beans-4.2.6.RELEASE.jar:4.2.6.RELEASE]
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574) ~[spring-beans-4.2.6.RELEASE.jar:4.2.6.RELEASE]
      ... 30 common frames omitted
  </code></pre>
  
  <p>The exception is being thrown from this class  </p>
  
  <pre><code>package org.springframework.data.mapping
  // PropertyPath.class 
  ....
  
  /**
   * Creates a leaf {@link PropertyPath} (no nested ones with the given name and owning type.
   * 
   * @param name must not be {@literal null} or empty.
   * @param owningType must not be {@literal null}.
   * @param base the {@link PropertyPath} previously found.
   */
  PropertyPath(String name, TypeInformation&lt;?&gt; owningType, List&lt;PropertyPath&gt; base) {
  
      Assert.hasText(name, "Name must not be null or empty!");
      Assert.notNull(owningType, "Owning type must not be null!");
      Assert.notNull(base, "Perviously found properties must not be null!");
  
      String propertyName = name.matches(ALL_UPPERCASE) ? name : StringUtils.uncapitalize(name);
      TypeInformation&lt;?&gt; propertyType = owningType.getProperty(propertyName);
  
      if (propertyType == null) {
          throw new PropertyReferenceException(propertyName, owningType, base);
      }
  
      this.owningType = owningType;
      this.isCollection = propertyType.isCollectionLike();
      this.type = propertyType.getActualType();
      this.name = propertyName;
  }
  </code></pre>
  
  <p>The property (method) is coming from the QueryDslPredicateExecutor class that my Repository extends.  </p>
  
  <pre><code>public abstract boolean org.springframework.data.querydsl.QueryDslPredicateExecutor.exists(com.querydsl.core.types.Predicate)  
  </code></pre>
  
  <p>Here is the repository -</p>
  
  <pre><code>public interface TreeRepository extends ExtendedMongoRepository&lt;Tree, String&gt;, QueryDslPredicateExecutor&lt;Tree&gt;{}
  </code></pre>