DB Integration Tests with Spring Boot and Testcontainers 1. Overview Spring Data JPA provides an easy way to create database queries and test them with an embedded H2 database. But in some cases, testing on a real database is much more profitable, especially if we use provider-dependent queries. In this tutorial,… Continue Reading spring-boot-testcontainers-integration-test

Intro to DataStax Java Driver for Apache Cassandra 1. Overview The DataStax Distribution of Apache Cassandra is a production-ready distributed database, compatible with open-source Cassandra. It adds a few features that aren’t available in the open-source distribution, including monitoring, improved batch, and streaming data processing. DataStax also provides a Java… Continue Reading cassandra-datastax-java-driver

Spring Data JPA @Modifying Annotation 1. Introduction In this short tutorial, we’ll learn how to create update queries with the Spring Data JPA @Query annotation. We’ll achieve this by using the @Modifying annotation. First, we’ll refresh our memory and see how to make queries using Spring Data JPA. After that,… Continue Reading spring-data-jpa-modifying-annotation

Hibernate Tips Book Excerpt: How to Map an Inheritance Hierarchy to One Table Persistence Hibernate 1. Introduction Inheritance is one of the key concepts in Java. So, it’s no surprise that most domain models use it. But unfortunately, this concept doesn’t exist in relational databases, and you need to find… Continue Reading hibernate-tips-how-to-map-an-inheritance-hierarchy-to-one-table

Bootstrapping JPA Programmatically in Java 1. Overview Most JPA-driven applications make heavy use of the “persistence.xml” file for getting a JPA implementation, such as Hibernate or OpenJPA. Our approach here provides a centralized mechanism for configuring one or more persistence units and the associated persistence contexts. And while this approach isn’t… Continue Reading java-bootstrap-jpa