I\'m having trouble with my first steps using Spring-Boot with JPA. I\'ve started with a pretty minimalistic example from Git using Gradle.
Now simply moving
Location of entities in Spring Boot can be configured using @EntityScan.
By default, @EnableAutoConfiguration
enables entity scanning in the package where it's placed (if it's not a default package).
Giving same package location (i.e base package) for below annotation worked for me :-
@SpringBootApplication(scanBasePackages = {"org.ashu.java.*"})
@EnableJpaRepositories(basePackages ={ "org.ashu.java.*"})
@EntityScan(basePackages ={ "org.ashu.java.*"})
You must locate entities and repositories pakages by using
@EnableJpaRepositories(basePackages = "your.repositories.pakage")
@EntityScan(basePackages = "your.entities.pakage")
this is what worked for me :
@EnableJpaRepositories(basePackages ={ "package1","package2"})
@EntityScan(basePackages ={ "package3","package4"})