Spring Expression Language SpEL

Spring Expression Language (SpEL) is a powerful expression language that supports querying and manipulating an object graph at runtime.

This tutorial shows various examples of ways to use SpEL expressions with XML and annotation based configuration. We also know how to evaluate an expression using SpEL classes and interfaces.

[Continue reading…] “Spring Expression Language SpEL”

Spring JPA Hibernate Many to Many – SpringBoot + PostgreSQL

This tutorial will guide you through the steps configuring Many to Many relationship in database with Spring JPA, Spring Boot & PostgreSql.

Related articles:
How to configure Spring JPA One to One Relationship – SpringBoot
How to configure Spring JPA One to Many Relationship – SpringBoot
Spring Data Rest – How to create a RestAPIs with JPA Many-to-Many relational entities | SpringBoot + MySql + HAL Browser

[Continue reading…] “Spring JPA Hibernate Many to Many – SpringBoot + PostgreSQL”

@Resource Annotation in Spring

@Resource Annotation is used to indicate a reference to a resource, it is considered an alternative to @Autowired which is an Spring standard. Similar to Java EE 5, we can use @Resource Annotation with field injection or setter method.

This tutorial will cover those kinds of injection which will be used for matching by Name, Type or Qualifier.

[Continue reading…] “@Resource Annotation in Spring”

Spring MongoOperations to access MongoDB

MongoDB is an open-source NoSQL document database, written using C++. This tutorial will introduce way to use Spring Boot to access MongoDB and perform CRUD operations with Spring MongoOperations.

Related Articles:
How to build SpringBoot MongoDb RestfulApi
How to use SpringData MongoRepository to interact with MongDB
SpringData MongoDB GridFsTemplate to save, retrieve, delete binary files (Image, Text files)
Angular 4 + Spring Boot + MongoDB CRUD example

[Continue reading…] “Spring MongoOperations to access MongoDB”

Spring ThreadPoolTaskExecutor with Callable interface for concurrency programming

Callable is a Java interface that is an useful methodology for control multi-threading returns on concurrency development.

The tutorial will guide you to build a concurrency program with ThreadPoolTaskExecutor of Spring Framework and Callable interface.

[Continue reading…] “Spring ThreadPoolTaskExecutor with Callable interface for concurrency programming”

Java 8 – Method References

Method References make it clear when referring to the existing method by name.

In the article Lambda Expressions and Functional Interfaces, we use lambda expressions to create anonymous methods and sometimes, calling an existing method is the only thing it does.

When using lambda expression without input arguments or those input arguments doesn’t make sense, we can use Method References to simplify the syntax.

This tutorial introduces four kinds of Method References and how to use them efficiently with some Functional Interfaces.

[Continue reading…] “Java 8 – Method References”

Java 8 – Functional Interfaces

Functional Interfaces is one of the new important things of Java 8. In previous article, we had a little view about common use cases of Lambda Expression including Runnable and ActionListener. They are example of Functional Interfaces.

This tutorial helps you have deeper concept of Functional Interface, then some interfaces which are provided in java.util.function package such as Predicate and Function.

[Continue reading…] “Java 8 – Functional Interfaces”

Spring Security – Config Security for Web MVC by Spring Boot

Configure Spring Security for Spring MVC web application + SpringBoot

In the tutorial, JavaSampleApproach will show you how to configure Security for SpringMVC web application.

[Continue reading…] “Spring Security – Config Security for Web MVC by Spring Boot”

Java Design Pattern – Abstract Factory Pattern

Abstract factory pattern is a Super-Factory of a group familiar factories. We can use it to expose API for integration code and hidden the logic implementation. Abstract Factory gives us a way to manage and decouple design in case Program has more than one Factory having the same Interface.

The tutorial will guide you a sample for how to program with Abstract Factory Pattern.

[Continue reading…] “Java Design Pattern – Abstract Factory Pattern”

Java Design Pattern – Singleton Pattern

Singleton Pattern is a design pattern which you often meet in almost applications. Singleton Pattern provides a way to instantiate only one instance in an application context.

The tutorial introduces the design of Singleton Design Pattern and give many ways to create a Singleton Pattern in your application.

[Continue reading…] “Java Design Pattern – Singleton Pattern”

Spring Batch Job with Parallel Steps

For scaling a Batch Job, Parallel Steps is one solution that bases on the business logic of application. We split the logic business in distinct responsibilities, and each step can be executed in parallelized flow. The tutorial will guide you how to configure parallel steps with Spring Batch.

Related Articles:
Spring Batch Partition for Scaling & Parallel Processing
How to start with Spring Batch using Spring Boot – Java Config

[Continue reading…] “Spring Batch Job with Parallel Steps”

Spring Profiles – @Profile Annotation and XML Configuration

In application development, sometimes we should make different configuration for each environment. Spring Profiles provides a way to separate application configuration into some parts and they are only available in one or more specific environments.

This tutorial introduces ways to use Spring Profiles by @Profile Annotation or XML Configuration.

[Continue reading…] “Spring Profiles – @Profile Annotation and XML Configuration”

Spring Batch XML Config by Spring Boot

How to start Spring Batch XML Config – use Spring Boot

Many business operations need to process with batch job for critical environment. Spring Batch is a lightweight framework to boot the batch application.

For starting, you can follow the How to start with Spring Batch using Spring Boot – Java Config. In the tutorial I will guide you how to start with XML config.

Related Articles:
How to start with Spring Batch using Spring Boot – Java Config
How to use Intercepting Job Execution in Spring Batch
How to use Spring Batch Restartable Function
Spring Batch – Programmatic Flow Decision
How to import CSV data to PostgreSQL Database using Spring Batch Job

[Continue reading…] “Spring Batch XML Config by Spring Boot”

Inject Properties using @Value Annotations vs Environment vs @ConfigurationProperties

@Value Annotations vs Environment vs @ConfigurationProperties.

Spring provides some ways to inject properties from properties file. We have learned how to use them in 3 articles:
@Value Annotation

This tutorial helps you have a comparison view covering those solutions.

[Continue reading…] “Inject Properties using @Value Annotations vs Environment vs @ConfigurationProperties”

Inject Properties from Properties File using Spring Environment

We can load properties value from Properties file to Spring Environment just by using @PropertySource annotation. This tutorial shows you the simple way to get them from Environment object.

Related Articles:
Inject Properties from Properties File using @Value annotation
Inject Properties from Properties File using @ConfigurationProperties Annotation
How to use Spring Factory Method to create Spring Bean

[Continue reading…] “Inject Properties from Properties File using Spring Environment”