Skip to content

Getting Started #15

Closed
Closed
@jordanbaucke

Description

@jordanbaucke

I have followed [2.0 quickstart guide](https://github.com/Cosium/spring-data-jpa-entity-graph/blob/master/doc/MAIN.md,

In my database configuration I had:

@Configuration
@EnableJpaRepositories("com.mypackage.api.repository")
@EnableJpaAuditing(auditorAwareRef = "springSecurityAuditorAware")
@EnableTransactionManagement
@EnableElasticsearchRepositories("com.mypackage.api.repository.search")
public class DatabaseConfiguration {
    @Bean
    public Hibernate5Module hibernate5Module() {
        return new Hibernate5Module();
    }
}

Now if I switch:

@EnableJpaRepositories("com.mypackage.api.repository")

to:

@EnableJpaRepositories(repositoryFactoryBeanClass = EntityGraphJpaRepositoryFactoryBean.class)

I than add a new repository:

public interface UserEntityGraphRepository extends EntityGraphJpaRepository<User, Long> {
}

in addition to:

public interface UserRepository extends JpaRepository<User, Long> {
}

I get exception:

java.lang.IllegalStateException: Failed to load ApplicationContext
...
Caused by: org.springframework.data.mapping.PropertyReferenceException: No property findAll found for type User!

If I just replace extends JpaRepository w/ EntityGraphJpaRepository, I get:

Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userDetailsService': Unsatisfied dependency expressed through field 'userRepository'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userRepository': Invocation of init method failed; nested exception is org.springframework.data.mapping.PropertyReferenceException: No property findOne found for type User!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions