Spring Boot auto-configuration

 

 

Spring Boot auto-configuration is a runtime (more accurately, application startup-time) process that considers several factors to decide what Spring configuration should and should not be applied. To illustrate, here are a few examples of the kinds of things that Spring Boot auto-configuration might consider:

Is Spring’s JdbcTemplate available on the classpath? If so and if there is a DataSource bean, then auto-configure a JdbcTemplate bean.

Is Thymeleaf on the classpath? If so, then configure a Thymeleaf templateresolver, view resolver, and template engine.

Is Spring Security on the classpath? If so, then configure a very basic web security setup.

There are nearly 200 such decisions that Spring Boot makes with regard to autoconfiguration every time an application starts up, covering such areas as security,integration, persistence, and web development.

By extending JpaRepository, XyzRepository interface inherits 18 methods for performing common persistence operations. 

The JpaRepository interface is parameterized with two parameters: the domain type that the repository will work with, and the

type of its ID property. The interface will be implemented automatically at runtime when the application is started