Enabling Transaction Locks in Spring Data JPA 1. Overview In this quick tutorial, we’ll discuss enabling transaction locks in Spring Data JPA for custom query methods and predefined repository CRUD methods. We will also have a look at different lock types and setting transaction lock timeouts. 2. Lock Types JPA… Continue Reading java-jpa-transaction-locks

Difference Between @Size, @Length, and @Column(length=value) 1. Overview In this quick tutorial, we’ll take a look at JSR-330‘s @Size, Hibernate‘s @Length and JPA @Column‘s length attribute. At first blush, these may seem the same, but they perform different functions. Let’s see how. 2. Origins Simply put, all of these annotations… Continue Reading jpa-size-length-column-differences

Batch Insert/Update with Hibernate/JPA 1. Overview In this tutorial, we’ll look at how we can batch insert or update entities using Hibernate/JPA. Batching allows us to send a group of SQL statements to the database in a single network call. This way, we can optimize the network and memory usage… Continue Reading jpa-hibernate-batch-insert-update

Spring Data Composable Repositories 1. Introduction When modeling a real-world system or process, domain-driven design (DDD) style repositories are a good option. For this very purpose, we can use Spring Data JPA as our data access abstraction layer. If you are new to this concept check out this introductory tutorial to… Continue Reading spring-data-composable-repositories