Tagged: Hibernate
Spring Boot + Spring Security + Hibernate Configuration Example
This tutorial demonstrates how to configure Spring Security Hibernate and Spring Boot. We secure a simple stateless web service using basic authentication. We configure Spring Security using Spring Java and/or XML Configuration. Finally, we...
Spring Boot – Spring Data JPA with Hibernate and H2 Web Console
The H2 database provides a browser-based web console that Spring Boot can auto-configure for you. In order to let spring auto-configure the H2 Web Console, we have to make sure we are developing a...
Unit Test JPA with JUnit H2 In Memory Database
This tutorial shows how to Unit Test JPA with JUnit and a H2 In Memory Database. Some people disagree and don’t call these unit tests, but integration tests. Imho there is some truth in...
Hibernate/JPA Batch Insert and Batch Update Example
This tutorial shows how to create batch insert and batch update statements using JPA and Hibernate. JDBC offers support for batching together SQL statements that can be represented as a single PreparedStatement. The JDBC...
Hibernate/JPA Named Stored Procedure XML and Annotation Example
This tutorial show how to use Named Stored Procedures using JPA with either XML and Annotations. We show a concrete example how to use Named Stored Procedures. Maven Dependencies We use Apache Maven to...
Hibernate/JPA Named Native Query XML and Annotation Example
Previously, we saw how to use named queries. This tutorial, we show how to use Hibernate/JPA Named Native Queries. With Named Native Queries, we can use native SQL statements. Maven Dependencies We use Apache...
Hibernate/JPA Named Query XML and Annotation Example
This tutorial show how to use Hibernate/JPA Named Queries. We start by explaining why we would use named queries. Next, we show an example of how to use named queries, either with annotations or...
Hibernate/JPA Table Per Class Inheritance Example
In this tutorial, we show how to map entity hierarchies onto database tables. There are several ways of mapping inheritance to the database. Here, we’ll look into Hibernate/JPA table per class inheritance. In a...
Hibernate/JPA Joined Table Inheritance Example
In this tutorial, we show how to map entity hierarchies onto database tables. There are several ways of mapping inheritance to the database. Here, we’ll look into Hibernate/JPA joined table inheritance. The base class...