Java Enums, JPA and PostgreSQL Enums
1. Introduction In this tutorial, we’ll explore the concepts of Java enums, JPA, and PostgreSQL enums, and learn how to use them together to create a seamless mapping between Java enums and PostgreSQL...
View ArticleFinding the Max Value in Spring Data JPA
1. Introduction When using Spring Data JPA, finding specific values in our database is a common task. One such task is finding the maximum value in a particular column. In this tutorial, we’ll explore...
View ArticleHow to Delay a Stubbed Method Response With Mockito
1. Introduction Mockito allows developers to stub methods to return specific values or perform certain actions. In some test scenarios, we may need to introduce a delay in the response of a stubbed...
View ArticleHTTP Request and Response Logging Using Logbook in Spring
1. Overview HTTP API requests are part of most applications now. Logbook is an extensible Java library to enable complete request and response logging for different client and server-side technologies....
View ArticleVertical Slice Architecture
1. Overview In this tutorial, we’ll learn about Vertical Slice Architecture and how it attempts to solve the issues associated with layered designs. We’ll discuss structuring the code by business...
View ArticleStore File or byte[] as SQL Blob in Java (Store and Load)
1. Overview Files such as images, audio, video, documents, etc. can be stored in a database as Binary Large Object (BLOB). A BLOB is a SQL data type that can store large binary data as a single entity....
View ArticleIntroduction to TigerBeetle Transactions Database
1. Introduction In this tutorial, we’ll explore the TigerBeetle database engine and learn how we can use it to build a fault-tolerant and high-performance application. 2. Financial Transactions in a...
View ArticleDefine Multiple Repositories With Maven
1. Overview Apache Maven lets us define a repository or a central place where we store and retrieve project artifacts. Sometimes, we need to define multiple repositories, especially when our project...
View ArticleCheck if a Variable Is Null Using Hamcrest
1. Overview When we write unit tests in Java, particularly with the JUnit framework, we often need to verify that certain variables are null or not null. Hamcrest, a popular library of Matchers for...
View ArticleDifference Between hasItems(), contains(), and containsInAnyOrder() in Hamcrest
1. Introduction Hamcrest is a popular framework for writing matcher objects in Java, providing an expressive way to define match conditions. Matchers like hasItems(), contains(), and...
View ArticleArithmetic Operations on Arbitrary-Length Binary Integers in Java
1. Overview In digital signal processing, operations are often performed on the binary representations of signals. In computer graphics, bit manipulation is critical for color, pixel operations, and...
View ArticleGuide to CompletableFuture join() vs get()
1. Introduction In Java’s concurrent programming, CompletableFuture is a powerful tool that allows us to write non-blocking code. When working with CompletableFuture, we’ll encounter two common...
View ArticleJava Weekly, Issue 548
1. Spring and Java >> Getting Started with Jakarta Data and Hibernate [thorben-janssen.com] Jakarta Data, a new specification in Jakarta EE 11: a repository abstraction on top of Jakarta...
View ArticleRead Last N Lines From File in Java
1. Introduction In this article, we’ll see how can we read the last N lines from a file using different standard Java packages and the Apache Commons IO library. 2. Sample Data We’ll use the sample...
View ArticleHow to Fix PSQLException: Operator Does Not Exist: Character Varying = UUID
1. Introduction In this tutorial, we’ll explore the PSQLException error: “operator does not exist: character varying = uuid” when using JPA to interact with PostgreSQL. We’ll delve into why this error...
View ArticleTesting CORS in Spring Boot
1. Overview Cross-Origin Resource Sharing (CORS) is a security mechanism that allows a web page from one origin to access resources from another origin. It’s enforced by browsers to prevent websites...
View ArticleGuide to FileWriter vs. BufferedWriter
1. Overview In this tutorial, we’ll look at the performance differences between two basic Java classes for writing files: FileWriter and BufferedWriter. While conventional wisdom on the web often...
View ArticleContainerize a Spring Boot Application With Podman Desktop
1. Overview In this tutorial, we’ll learn how to containerize a Spring Boot application using Podman Desktop. Podman is a containerization tool that allows us to manage containers without requiring a...
View ArticleFixing UnsupportedTemporalTypeException: Unsupported Field: InstantSeconds
1. Overview When working with dates, we often leverage the Date-Time API. However, manipulating or accessing temporal data may lead to errors and exceptions when done improperly. One such specific...
View ArticleA Guide to Structured Output in Spring AI
1. Introduction Typically, when using large language models (LLMs), we don’t expect a structured response. Moreover, we got used to their unpredictable behavior, which often leads to outputs that do...
View Article