Store Image As Blob And Retrieve Blob As Image Using Spring

Image As Blob And Blob As Image Here in this example I am going to show you how to store image as blob into database. While retrieving blob from database I am going to display blob as image. While storing image as blob into database I am going to display a page which will be used for uploading the image….

Google Organization Chart Using Spring

Organization Chart Here I am going to build google organization chart using spring boot framework. Organization chart can be used to display hierarchical data of an organization, for example, you can display the employees and their managers in hierarchical order. You can also find the organization hierarchy in your organization also. For example, you can see your manager, your manager’s…

Completable Future To Fetch Data Asynchronously

Asynchronous Data Here I am going to show you how to fetch data asynchronously. So, data which are not coordinated in time will be fetched any time. This means that data is sent at irregular intervals, without any specific time or synchronization between the sender and receiver. In this example I am going to use CompletableFuture from Java 8’s new…

Spring Boot Hikari Connection Pool Configurations

Hikari Connection Pool Here in this Spring Boot application example, I am going to show you how to use Hikari connection pool to use dedicated HikariDataSource instead of the use of database specific datasource. Hikari connection pool commonly known as HikariCP is extremely fast, light-weight, simple and production ready JDBC connection pool.

Spring Boot Composite Primary Key Example

Composite Primary Key Composite primary key is a combination of two or more columns in a table. So instead of a single column to be a primary key, more than one column or field is made to be a primary key to uniquely identify the rows in a given table. Let’s say you have created a table called user in your database…

Spring Boot Data JPA Entity DTO Mapping Using MapStruct

Introduction In this example I will show you how to convert entity class to DTO (Data Transfer Object) class and DTO class to entity class using MapStruct. So, MapStruct will map entity class to DTO class or vice versa. This example will test both from RESTful webservices and standalone main class. Spring Boot provides CommandLineRunner interface to run the project…

PreAuthorize HasPermission Security Using Spring Boot Data JPA

Introduction The ability of hasPermission() method in Spring Boot Security applications is to determine the accessibility of a particular user for the application. The permission of an access can be read, write, etc. So, a particular user has defined set of access permission by which a user can perform certain activities in the application. The most useful annotation @PreAuthorize, which…

Angular Spring Boot REST API CRUD Example

Introduction In this tutorial I am going to show you how to build Spring Boot Angular CRUD Application. CRUD is an acronym and stands for Create, Read, Update and Delete operations performed through an application or APIs. Using Spring Boot application I will build REST APIs which will be used to perform CRUD operations on server side resources. The Angular…

Bootstrap AJAX Spring Boot Pagination

Introduction In this tutorial I will use Spring Data JPA Pageable to build REST API for pagination in Spring Boot applications. Here, I am going to show you how to build pagination using Bootstrap jQuery – AJAX with Spring Boot applications. Using jQuery – AJAX, you don’t need to load or fetch all records from server side, and you are…

Bulk Delete Using Spring JPA CriteriaDelete

Criteria Delete The new feature bulk delete operation in Criteria API was added in JPA 2.1. I will show you an example how to perform bulk delete using Spring JPA CriteriaDelete. The CriteriaDelete interface can be used to implement bulk delete operations. Delete operations performed through CriteriaDelete interface are directly mapped to database delete operations. Hence the persistent context is…