HATEOAS driven REST API using Spring Boot

Introduction In this post you will see an example on HATEOAS driven REST API using Spring Boot. An approach that breaks down the principal elements of a REST approach into three steps are resources, http verbs and hypermedia controls: Without using any mechanism of the web, HTTP is used as a transport system for remote interactions. Every individual service end…

Integrate H2 In-memory Database with Spring Boot

Spring Boot and H2 Database This tutorial will show you how to integrate in-memory H2 database with Spring Boot and build using Gradle/Maven tools. You will see here simple Spring Boot Data JPA example with Spring REST API to understand how it works. H2 is in-memory database, so it does not have persistence capability once your Spring Boot application is…

Spring Boot Data JPA Left Right Inner And Cross Join Examples

Spring Boot Data JPA Joins This tutorial will show you Spring Boot Data JPA Left Right Inner and Cross Join Examples. I will show you how to use this example in Spring Boot application, where you will use Spring Data JPA Repository to query your database tables. I will build the project using both maven and gradle build tools. I…

Spring Data JPA Specification Criteria Query With IN Clause Example

Spring Data JPA Specification Here I will create an example on Spring Data JPA Specification Criteria Query with IN Clause. Spring Data JPA Specification Criteria Query generally used for search functionality on a page where users want to search by providing some inputs or by selecting several dropdown values. In this example I will show you how to use collection…

Spring Data JPA Entity Auditing Using EntityListeners

JPA Entity Auditing The tutorial Spring Data JPA Entity Auditing using EntityListeners will show you how you persist the audit log using JPA’s built-in functionality. Spring Data  JPA provides sophisticated support to transparently keep track of who created or changed an entity and at what time. To benefit from this functionality you have to equip your entity classes with auditing metadata…

Hibernate UserType Example using Spring Data JPA

Introduction I am going to show you here what is UserType and why do you need UserType while working with database and web application. In Hibernate UserType Example using Spring Data JPA I will show you how Hibernate allows you to implement and use custom types when built-in types do not satisfy an application’s requirements, or when you want to…

Spring EnableEncryptableProperties with Jasypt

EnableEncryptableProperties – Jasypt Spring EnableEncryptableProperties with Jasypt shows an example how to avoid clear text password for database connection’s credentials in properties file. Jasypt means Java simplified encryption. Here I am going to use Spring Boot with Jasypt (Java simplified encryption). Here I am also going to use Spring Data JPA to perform the data layer activities with database. If…

Configure JNDI DataSource with Spring Boot

Introduction In this post I will show you how to configure JNDI datasource with Spring Boot applications. JNDI (Java Naming Directory Interface) data source is very similar to JDBC (Java Database Connectivity) data source. I will show examples on Oracle as well as MySQL database servers. The MySQL version example is downloadable at the end of this tutorial. I will…

org.hibernate.MappingException: No Dialect mapping for JDBC type

Introduction Here I am going to show you how to resolve issue org.hibernate.mapping.exception: No Dialect mapping for JDBC type that occurs in your Hibernate based application due to some types mismatch between database table column and Java field. You might have seen similar kind of exception occurred during performing native queries without entity class and this kind of issue may…

Spring Data JPA Entity Graphs

One of the important features in Spring Data JPA or simply JPA is the ability to specify fetch plans using Entity Graphs. This is useful since it allows you to customize the data, which is retrieved with a query or find operation. It is expected to display data from the same entity in different and several ways when working with…