Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

How can I extends already existing interfaces? #83

Unanswered
onacit asked this question in Q&A
Discussion options

What steps will reproduce the problem ?

Steps to reproduce the behavior:

  1. Predefine repository interfaces (in an upstream module)
  2. (In a downstream module) extends EntityGraphJpa... interfaces.
  3. 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.

You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /