Results 1 to 2 of 2

Thread: error on spring-data-jpa with querydsl and custom repository

  1. #1
    Join Date
    Apr 2006
    Posts
    4

    Default error on spring-data-jpa with querydsl and custom repository

    Hi,

    I have a custom repository which extends org.springframework.data.jpa.repository.JpaReposit ory (and custom factory class and so on). This works fine.

    Now I would like to use querydsl.
    I did this with defining repository in the following way:

    public interface MyRepository extends MyGenericRepository<MyEntity, String>, QueryDslPredicateExecutor<MyEntity> { ... }

    (where MyGenericRepository extends JpaRepository)

    When I try to start the app I get exceptions like:

    Caused by: org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'myRepository': FactoryBean threw exception on object creation; nested exception is org.springframework.data.mapping.PropertyReference Exception: No property find found for type com.xyz.MyEntity

    When I don't use my JpaRepository extension I get no errors...

    Can anybody of you give me a hint how to solve the problem??

    TIA
    Martin

  2. #2

    Default

    Hi,

    Make the following changes to your code:

    1. Extend the QuerydslPredicateExecutor interface in the MyGenericRepository interface.
    2. Extend the QueryDslJpaRepository class in your implementation of the MyGenericRepository interface.
    3. The MyRepository interface should extend only the MyGenericRepository interface.


    This should do the trick.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •