-
Dec 21st, 2012, 02:27 AM
#1
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
-
Dec 29th, 2012, 09:30 AM
#2
Hi,
Make the following changes to your code:
- Extend the QuerydslPredicateExecutor interface in the MyGenericRepository interface.
- Extend the QueryDslJpaRepository class in your implementation of the MyGenericRepository interface.
- 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
-
Forum Rules