Spring Bean Life Cycle

By implementing InitializingBean and DisposableBean interfaces Providing init-method and destroy-method in xml configuration or @PostConstruct and @PreDestroy annotations for methods

For activating post processor annotation annotations use

or by

used to activate applied annotations in already registered beans in application context (context:component-scan does what context:annotation-config does, but additionally it scan the […]

Spring Annotations

@SpringBootApplication @SpringBootConfiguration @EnableAutoConfiguration @ComponentScan @Component for any Spring-managed component, scanned by to respect the convention: @Repository for persistence layer – deal with DataAccessException @Service for service layer @Controller for presentation layer (spring-mvc) – the dispatcher scans the classes annotated with @Controller and detects @RequestMapping annotations within them. We can only use @RequestMapping on @Controller @EnableWebMvc […]

Transaction propagations in Spring

Defaults to Propagation.REQUIRED TransactionDefinition.ISOLATION_DEFAULT – Use the default isolation level of the underlying datastore. TransactionDefinition.ISOLATION_READ_COMMITTED – Indicates that dirty reads are prevented; non-repeatable reads and phantom reads can occur. TransactionDefinition.ISOLATION_READ_UNCOMMITTED – Indicates that dirty reads, non-repeatable reads and phantom reads can occur. TransactionDefinition.ISOLATION_REPEATABLE_READ – Indicates that dirty reads and non-repeatable reads are prevented; phantom reads […]

Spring Security

Spring Security is a framework that focuses on providing both authentication and authorization to Java applications.

 

Spring Framework

Dependency Injection Aspect Oriented Programming Core modules Core/IoC container Bean Context SpEL Data Access/Integration JDBC http://norows.com/spring-jdbc.html ORM JMS Transaction – Transaction propagations in Spring JMX Marshalling XML Security http://norows.com/spring-integration.html Spring Data Web Web Web-MVC http://norows.com/spring-boot-mvc.html Web-Socket Testing Mock objects TestContext framework Spring MVC Test WebTestClient Spring Test DBUnit Spring Boot http://norows.com/start-spring-boot.html Links: https://www.tutorialspoint.com/spring/spring_quick_guide.htm

Spring JDBC Framework: JdbcTemplate, SimpleJdbcCall, StoredProcedure

build.gradle

@Configuration

JdbcTemplate

  NamedParameterJdbcTemplate SimpleJdbcInsert

SimpleJdbcCall MappingSqlQuery SqlUpdate StoredProcedure Execute stored procedure with Spring extends StoredProcedure

Spring Boot MVC

build.gradle

HomeController.java