Spring Boot for JPA support -
i found adding properties scanbasepackages
on @springbootapplication
can not enable feature of jpa on @enity
, jparepository
. have add @enablejparepositories
, @entityscan
, basepackages
properties on them. there simpler solution on this? thank you
just go spring initializr site, specify 'group' , 'artifact' (or live default ones), in 'dependencies' block choose "jpa" , "h2" (or db need - see 'switch full version' link), click 'generate project'.
in downloaded archive can find spring boot skeleton project jpa support.
if project pom.xml
file can see these dependencies:
<dependencies> <!-- jpa --> <dependency> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-data-jpa</artifactid> </dependency> <!-- h2 db --> <dependency> <groupid>com.h2database</groupid> <artifactid>h2</artifactid> </dependency> <!-- other suff --> </dependencies>
Comments
Post a Comment