-
Notifications
You must be signed in to change notification settings - Fork 52
-
What steps will reproduce the problem ?
Steps to reproduce the behavior:
- Predefine repository interfaces (in an upstream module)
- (In a downstream module) extends
EntityGraphJpa...
interfaces. - The notorious
findOne
problem
Detailed scenaio
I have an upstream module which defined mapped superclasses and no-repository-beans.
@MappedSuperclass public abstract class MappedSome<T extends Some<T>> { } @NoRepositoryBean public interface MappedSomeRepository<T extends MappedSome<T>, Long> { }
An I tried, with my down-stream module like this.
@Entity public class Some extends MappedSome<Some> { } @Repository public interface SomeRepository extends MappedSomeRepository<Some>, EntityGraphJpaRepository<Some, Long>, EntityGraphJpaSpecificationExecutor<Some> { }
And I got this.
Caused by: java.lang.IllegalArgumentException: Failed to create query for method public abstract java.util.Optional com.cosium.spring.data.jpa.entity.graph.repository.EntityGraphJpaSpecificationExecutor.findOne(org.springframework.data.jpa.domain.Specification,com.cosium.spring.data.jpa.entity.graph.domain2.EntityGraph); No property 'findOne' found for type 'AdDaBookingDefaultSetting'
Oh. I neve forget the configuration.
@EnableJpaRepositories( repositoryFactoryBeanClass = com.cosium.spring.data.jpa.entity.graph.repository.support.EntityGraphJpaRepositoryFactoryBean.class) @Configuration @Slf4j // https://github.com/Cosium/spring-data-jpa-entity-graph class __DataJpaEntityGraphConfiguration { }
Did I do something wrong?
Is my scenario expected?
Thank you.
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment