Home » jpa

Tag Archives: jpa

Spring Form Validation Example

In this example, we will show how to implement server-side form validation in a Spring MVC application. 1. Introduction Form validation is a basic requirement for web applications that accept data as input. For example, you may want to ensure that an email address or credit card number sent in a request is valid before processing the data. There are ...

Read More »

JPA @Embedded And @Embeddable Example

1. Introduction In this post, we will examine the functionality of two JPA annotations, the JPA @Embedded and the @Embeddable. We will leverage the power of Spring Data JPA and H2 in memory database to create the code examples and run the unit test. 2. Project Setup To run the code examples of this post, we will use the following ...

Read More »

Spring Boot JAX-RS with Jersey Example

In this post, we feature a comprehensive article on Spring Boot JAX-RS with Jersey. We will show how to create a JAX-RS web service with Spring Boot and Jersey. 1. Introduction REST (Representational State Transfer) is an architectural pattern for developing web services. REST is a popular choice for web services development projects since it is lightweight, stateless, and therefore easily ...

Read More »

Spring Boot JPA MySQL Example

In this example, we will demonstrate how to build a CRUD application using Spring Boot, JPA, and MySQL. 1. Introduction If you worked on enterprise applications in the past, you probably wrote SQL for querying a relational database.  If you are a Java developer, you also had to use JDBC for connecting to the database and executing queries.  (Java Database ...

Read More »

Spring Querydsl Tutorial

Spring Data JPA and Querydsl enable developers to write type-safe queries. In this tutorial, we will build a Spring boot JPA application to demonstrate how to achieve it.                     Table Of Contents 1. Introduction 2. Technologies Used 3. Spring Boot JPA Maven Project 3.1 Dependency 3.2 Entity Classes 3.3 Generated Meta ...

Read More »

Spring Batch Hibernate Example

This article is a tutorial about Spring Batch with Hibernate. We will use Spring Boot to speed our development process. 1. Introduction Spring Batch is a lightweight, scale-able and comprehensive batch framework to handle data at massive scale. Spring Batch builds upon the spring framework to provide intuitive and easy configuration for executing batch applications. Spring Batch provides reusable functions ...

Read More »

Spring Data JPARepository Example

1. Introduction Spring Data is a part of Spring Framework. It simplifies the data access process for both relational and non-relational databases. Java Persistence API (JPA) is Java’s standard API specification for object-relational mapping. Spring Data JPA is a part of Spring Data and it supports Hibernate 5, OpenJPA 2.4, and EclipseLink 2.6.1. Spring Data repository significantly reduces the amount of boilerplate code required to implement data access layers ...

Read More »

Spring Boot and JPA Example

Are you keen on learning about using Spring Boot with JPA? Yes? Gather your tools and read on. This example is very straight forward and simple, it should be easy to understand. Let’s begin with our Spring Boot JPA example. 1. Tools Apache Maven Mars Eclipse Spring Boot Spring Data JPA H2 Database Engine 2. Assumptions This article assumes that ...

Read More »

JPA mappedBy Example

Hello readers, in this tutorial, we will show how to implement the mappedBy annotation in JPA using EclipseLink and MySQL in Java.                     1. Introduction Java Persistence API (JPA), is a standard interface which wraps the different Object Relational Mapping (ORM) tools such as Hibernate, EclipseLink, OpenJPA etc. JPA provides a ...

Read More »