spring-guides / getting-started-guides

Getting Started Guide template :: The template for new guides and also the place to request them.
https://github.com/spring-guides/getting-started-guides/wiki
Apache License 2.0
519 stars 204 forks source link

Accessing Data with JPA article needs improvements #107

Closed farazdurrani closed 5 years ago

farazdurrani commented 5 years ago

The startup guide at Accessing Data with JPA requires some improvements. For example, there is no place for this paragraph in the write-up:

Normally you would add @EnableWebMvc for a Spring MVC app, but Spring Boot adds it automatically when it sees spring-webmvc on the classpath. This flags the application as a web application and activates key behaviors such as setting up a DispatcherServlet.

This is because that write-up is not about serving HTTP requests. It has nothing to do with serving content to the user. And there is no Spring boot starter web dependency on the classpath of the article.

Instead, it should be replaced with something like this:

Spring boot application will automatically enable @EnableJpaRepositories if it finds spring-boot-starter-data-mongodb on the classpath.

Something like that.

dsyer commented 5 years ago

Fixed here: https://github.com/spring-guides/getting-started-macros/commit/5034bdddd8fb73b87ca7dea0d77dd2d921762ab6. Actually there is no content specifically on @EnableJpaRepositories, but please raise issues directly in the JPA guide repo if you think there should be.

farazdurrani commented 5 years ago

Issue raised in its appropriate repo page.