org.springframework.data.mapping.PropertyReferenceException: No property count found for type Employee! in...












0














I already went through urls like Spring Data JPA - "No Property Found for Type" Exception, but it did not solved my issue yet. I'm developing Spring Boot + Spring Data Redids example. In this example, I am contineously facing the below issues. I have used QueryByExampleExecutor<Employee> as suggested in https://programtalk.com/vs/?source=spring-data-examples/jpa/query-by-example/src/test/java/example/springdata/jpa/querybyexample/UserRepositoryInheritanceIntegrationTests.java



Here is the source code for reference: https://github.com/JavaHelper/spring-redis-examples/tree/master/redis-example



org.springframework.data.mapping.PropertyReferenceException: No property count found for type Employee!
at org.springframework.data.mapping.PropertyPath.<init>(PropertyPath.java:94)
at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:358)
at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:334)
at org.springframework.data.mapping.PropertyPath.lambda$from$0(PropertyPath.java:287)
at java.util.concurrent.ConcurrentMap.computeIfAbsent(Unknown Source)
at org.springframework.data.mapping.PropertyPath.from(PropertyPath.java:269)
at org.springframework.data.mapping.PropertyPath.from(PropertyPath.java:252)
at org.springframework.data.repository.query.parser.Part.<init>(Part.java:81)
at org.springframework.data.repository.query.parser.PartTree$OrPart.lambda$new$0(PartTree.java:250)
at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
at java.util.stream.ReferencePipeline$2$1.accept(Unknown Source)
at java.util.Spliterators$ArraySpliterator.forEachRemaining(Unknown Source)
at java.util.stream.AbstractPipeline.copyInto(Unknown Source)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source)
at java.util.stream.AbstractPipeline.evaluate(Unknown Source)
at java.util.stream.ReferencePipeline.collect(Unknown Source)
at org.springframework.data.repository.query.parser.PartTree$OrPart.<init>(PartTree.java:251)
at org.springframework.data.repository.query.parser.PartTree$Predicate.lambda$new$0(PartTree.java:380)
at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
at java.util.stream.ReferencePipeline$2$1.accept(Unknown Source)
at java.util.Spliterators$ArraySpliterator.forEachRemaining(Unknown Source)
at java.util.stream.AbstractPipeline.copyInto(Unknown Source)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source)
at java.util.stream.AbstractPipeline.evaluate(Unknown Source)
at java.util.stream.ReferencePipeline.collect(Unknown Source)
at org.springframework.data.repository.query.parser.PartTree$Predicate.<init>(PartTree.java:381)
at org.springframework.data.repository.query.parser.PartTree.<init>(PartTree.java:93)
at org.springframework.data.keyvalue.repository.query.KeyValuePartTreeQuery.createQuery(KeyValuePartTreeQuery.java:206)
at org.springframework.data.keyvalue.repository.query.KeyValuePartTreeQuery.prepareQuery(KeyValuePartTreeQuery.java:148)
at org.springframework.data.keyvalue.repository.query.KeyValuePartTreeQuery.execute(KeyValuePartTreeQuery.java:106)
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:602)
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:590)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
at org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:59)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
at


EmployeeRepository.java



public interface EmployeeRepository extends CrudRepository<Employee, String>, QueryByExampleExecutor<Employee>{

}


Employee.java



@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
@RedisHash("employees")
public class Employee {
@Id @Indexed
private String id;
private String firstName;
private String lastName;
private List<Address> addresses;

private List<Department> departments;
}


Test class/Main Method



Example<Employee> example = Example.of(new Employee(null, "Raj", null, null, null));
long count = employeeRepository.count(example);
System.out.println("COUNT_OF_EMPLOYEE = "+count);


Any Quick pointers??










share|improve this question





























    0














    I already went through urls like Spring Data JPA - "No Property Found for Type" Exception, but it did not solved my issue yet. I'm developing Spring Boot + Spring Data Redids example. In this example, I am contineously facing the below issues. I have used QueryByExampleExecutor<Employee> as suggested in https://programtalk.com/vs/?source=spring-data-examples/jpa/query-by-example/src/test/java/example/springdata/jpa/querybyexample/UserRepositoryInheritanceIntegrationTests.java



    Here is the source code for reference: https://github.com/JavaHelper/spring-redis-examples/tree/master/redis-example



    org.springframework.data.mapping.PropertyReferenceException: No property count found for type Employee!
    at org.springframework.data.mapping.PropertyPath.<init>(PropertyPath.java:94)
    at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:358)
    at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:334)
    at org.springframework.data.mapping.PropertyPath.lambda$from$0(PropertyPath.java:287)
    at java.util.concurrent.ConcurrentMap.computeIfAbsent(Unknown Source)
    at org.springframework.data.mapping.PropertyPath.from(PropertyPath.java:269)
    at org.springframework.data.mapping.PropertyPath.from(PropertyPath.java:252)
    at org.springframework.data.repository.query.parser.Part.<init>(Part.java:81)
    at org.springframework.data.repository.query.parser.PartTree$OrPart.lambda$new$0(PartTree.java:250)
    at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
    at java.util.stream.ReferencePipeline$2$1.accept(Unknown Source)
    at java.util.Spliterators$ArraySpliterator.forEachRemaining(Unknown Source)
    at java.util.stream.AbstractPipeline.copyInto(Unknown Source)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
    at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source)
    at java.util.stream.AbstractPipeline.evaluate(Unknown Source)
    at java.util.stream.ReferencePipeline.collect(Unknown Source)
    at org.springframework.data.repository.query.parser.PartTree$OrPart.<init>(PartTree.java:251)
    at org.springframework.data.repository.query.parser.PartTree$Predicate.lambda$new$0(PartTree.java:380)
    at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
    at java.util.stream.ReferencePipeline$2$1.accept(Unknown Source)
    at java.util.Spliterators$ArraySpliterator.forEachRemaining(Unknown Source)
    at java.util.stream.AbstractPipeline.copyInto(Unknown Source)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
    at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source)
    at java.util.stream.AbstractPipeline.evaluate(Unknown Source)
    at java.util.stream.ReferencePipeline.collect(Unknown Source)
    at org.springframework.data.repository.query.parser.PartTree$Predicate.<init>(PartTree.java:381)
    at org.springframework.data.repository.query.parser.PartTree.<init>(PartTree.java:93)
    at org.springframework.data.keyvalue.repository.query.KeyValuePartTreeQuery.createQuery(KeyValuePartTreeQuery.java:206)
    at org.springframework.data.keyvalue.repository.query.KeyValuePartTreeQuery.prepareQuery(KeyValuePartTreeQuery.java:148)
    at org.springframework.data.keyvalue.repository.query.KeyValuePartTreeQuery.execute(KeyValuePartTreeQuery.java:106)
    at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:602)
    at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:590)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
    at org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:59)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
    at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
    at


    EmployeeRepository.java



    public interface EmployeeRepository extends CrudRepository<Employee, String>, QueryByExampleExecutor<Employee>{

    }


    Employee.java



    @Builder
    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    @RedisHash("employees")
    public class Employee {
    @Id @Indexed
    private String id;
    private String firstName;
    private String lastName;
    private List<Address> addresses;

    private List<Department> departments;
    }


    Test class/Main Method



    Example<Employee> example = Example.of(new Employee(null, "Raj", null, null, null));
    long count = employeeRepository.count(example);
    System.out.println("COUNT_OF_EMPLOYEE = "+count);


    Any Quick pointers??










    share|improve this question



























      0












      0








      0


      1





      I already went through urls like Spring Data JPA - "No Property Found for Type" Exception, but it did not solved my issue yet. I'm developing Spring Boot + Spring Data Redids example. In this example, I am contineously facing the below issues. I have used QueryByExampleExecutor<Employee> as suggested in https://programtalk.com/vs/?source=spring-data-examples/jpa/query-by-example/src/test/java/example/springdata/jpa/querybyexample/UserRepositoryInheritanceIntegrationTests.java



      Here is the source code for reference: https://github.com/JavaHelper/spring-redis-examples/tree/master/redis-example



      org.springframework.data.mapping.PropertyReferenceException: No property count found for type Employee!
      at org.springframework.data.mapping.PropertyPath.<init>(PropertyPath.java:94)
      at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:358)
      at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:334)
      at org.springframework.data.mapping.PropertyPath.lambda$from$0(PropertyPath.java:287)
      at java.util.concurrent.ConcurrentMap.computeIfAbsent(Unknown Source)
      at org.springframework.data.mapping.PropertyPath.from(PropertyPath.java:269)
      at org.springframework.data.mapping.PropertyPath.from(PropertyPath.java:252)
      at org.springframework.data.repository.query.parser.Part.<init>(Part.java:81)
      at org.springframework.data.repository.query.parser.PartTree$OrPart.lambda$new$0(PartTree.java:250)
      at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
      at java.util.stream.ReferencePipeline$2$1.accept(Unknown Source)
      at java.util.Spliterators$ArraySpliterator.forEachRemaining(Unknown Source)
      at java.util.stream.AbstractPipeline.copyInto(Unknown Source)
      at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
      at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source)
      at java.util.stream.AbstractPipeline.evaluate(Unknown Source)
      at java.util.stream.ReferencePipeline.collect(Unknown Source)
      at org.springframework.data.repository.query.parser.PartTree$OrPart.<init>(PartTree.java:251)
      at org.springframework.data.repository.query.parser.PartTree$Predicate.lambda$new$0(PartTree.java:380)
      at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
      at java.util.stream.ReferencePipeline$2$1.accept(Unknown Source)
      at java.util.Spliterators$ArraySpliterator.forEachRemaining(Unknown Source)
      at java.util.stream.AbstractPipeline.copyInto(Unknown Source)
      at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
      at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source)
      at java.util.stream.AbstractPipeline.evaluate(Unknown Source)
      at java.util.stream.ReferencePipeline.collect(Unknown Source)
      at org.springframework.data.repository.query.parser.PartTree$Predicate.<init>(PartTree.java:381)
      at org.springframework.data.repository.query.parser.PartTree.<init>(PartTree.java:93)
      at org.springframework.data.keyvalue.repository.query.KeyValuePartTreeQuery.createQuery(KeyValuePartTreeQuery.java:206)
      at org.springframework.data.keyvalue.repository.query.KeyValuePartTreeQuery.prepareQuery(KeyValuePartTreeQuery.java:148)
      at org.springframework.data.keyvalue.repository.query.KeyValuePartTreeQuery.execute(KeyValuePartTreeQuery.java:106)
      at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:602)
      at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:590)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
      at org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:59)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
      at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
      at


      EmployeeRepository.java



      public interface EmployeeRepository extends CrudRepository<Employee, String>, QueryByExampleExecutor<Employee>{

      }


      Employee.java



      @Builder
      @Data
      @AllArgsConstructor
      @NoArgsConstructor
      @RedisHash("employees")
      public class Employee {
      @Id @Indexed
      private String id;
      private String firstName;
      private String lastName;
      private List<Address> addresses;

      private List<Department> departments;
      }


      Test class/Main Method



      Example<Employee> example = Example.of(new Employee(null, "Raj", null, null, null));
      long count = employeeRepository.count(example);
      System.out.println("COUNT_OF_EMPLOYEE = "+count);


      Any Quick pointers??










      share|improve this question















      I already went through urls like Spring Data JPA - "No Property Found for Type" Exception, but it did not solved my issue yet. I'm developing Spring Boot + Spring Data Redids example. In this example, I am contineously facing the below issues. I have used QueryByExampleExecutor<Employee> as suggested in https://programtalk.com/vs/?source=spring-data-examples/jpa/query-by-example/src/test/java/example/springdata/jpa/querybyexample/UserRepositoryInheritanceIntegrationTests.java



      Here is the source code for reference: https://github.com/JavaHelper/spring-redis-examples/tree/master/redis-example



      org.springframework.data.mapping.PropertyReferenceException: No property count found for type Employee!
      at org.springframework.data.mapping.PropertyPath.<init>(PropertyPath.java:94)
      at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:358)
      at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:334)
      at org.springframework.data.mapping.PropertyPath.lambda$from$0(PropertyPath.java:287)
      at java.util.concurrent.ConcurrentMap.computeIfAbsent(Unknown Source)
      at org.springframework.data.mapping.PropertyPath.from(PropertyPath.java:269)
      at org.springframework.data.mapping.PropertyPath.from(PropertyPath.java:252)
      at org.springframework.data.repository.query.parser.Part.<init>(Part.java:81)
      at org.springframework.data.repository.query.parser.PartTree$OrPart.lambda$new$0(PartTree.java:250)
      at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
      at java.util.stream.ReferencePipeline$2$1.accept(Unknown Source)
      at java.util.Spliterators$ArraySpliterator.forEachRemaining(Unknown Source)
      at java.util.stream.AbstractPipeline.copyInto(Unknown Source)
      at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
      at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source)
      at java.util.stream.AbstractPipeline.evaluate(Unknown Source)
      at java.util.stream.ReferencePipeline.collect(Unknown Source)
      at org.springframework.data.repository.query.parser.PartTree$OrPart.<init>(PartTree.java:251)
      at org.springframework.data.repository.query.parser.PartTree$Predicate.lambda$new$0(PartTree.java:380)
      at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
      at java.util.stream.ReferencePipeline$2$1.accept(Unknown Source)
      at java.util.Spliterators$ArraySpliterator.forEachRemaining(Unknown Source)
      at java.util.stream.AbstractPipeline.copyInto(Unknown Source)
      at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
      at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source)
      at java.util.stream.AbstractPipeline.evaluate(Unknown Source)
      at java.util.stream.ReferencePipeline.collect(Unknown Source)
      at org.springframework.data.repository.query.parser.PartTree$Predicate.<init>(PartTree.java:381)
      at org.springframework.data.repository.query.parser.PartTree.<init>(PartTree.java:93)
      at org.springframework.data.keyvalue.repository.query.KeyValuePartTreeQuery.createQuery(KeyValuePartTreeQuery.java:206)
      at org.springframework.data.keyvalue.repository.query.KeyValuePartTreeQuery.prepareQuery(KeyValuePartTreeQuery.java:148)
      at org.springframework.data.keyvalue.repository.query.KeyValuePartTreeQuery.execute(KeyValuePartTreeQuery.java:106)
      at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:602)
      at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:590)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
      at org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:59)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
      at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
      at


      EmployeeRepository.java



      public interface EmployeeRepository extends CrudRepository<Employee, String>, QueryByExampleExecutor<Employee>{

      }


      Employee.java



      @Builder
      @Data
      @AllArgsConstructor
      @NoArgsConstructor
      @RedisHash("employees")
      public class Employee {
      @Id @Indexed
      private String id;
      private String firstName;
      private String lastName;
      private List<Address> addresses;

      private List<Department> departments;
      }


      Test class/Main Method



      Example<Employee> example = Example.of(new Employee(null, "Raj", null, null, null));
      long count = employeeRepository.count(example);
      System.out.println("COUNT_OF_EMPLOYEE = "+count);


      Any Quick pointers??







      spring redis jedis spring-data-redis






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 23 '18 at 17:13

























      asked Nov 21 '18 at 16:27









      PAA

      2,48221935




      2,48221935
























          0






          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53416495%2forg-springframework-data-mapping-propertyreferenceexception-no-property-count-f%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53416495%2forg-springframework-data-mapping-propertyreferenceexception-no-property-count-f%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          404 Error Contact Form 7 ajax form submitting

          How to know if a Active Directory user can login interactively

          TypeError: fit_transform() missing 1 required positional argument: 'X'