Troubleshooting Spring JPA Attribute Naming Issues
1. Introduction One of the most powerful frameworks that Spring offers programmers for simplifying database interactions in Java applications is the Spring JPA (Java Persistence API). It provides a...
View ArticleRound Robin and AtomicInteger in Java
1. Introduction Multithreading has been a part of Java since its inception. However, managing concurrent tasks in multithreaded environments remains challenging, especially when multiple threads...
View ArticleConverting a JDBC ResultSet to CSV in Java
1. Introduction When working with Java applications that interact with databases, we often need to export the query results into a format that can be easily consumed or shared. One common format for...
View ArticleFinding the Index of the First Duplicate Element in an Array
1. Overview Finding the index of the first duplicate element in an array is a common coding problem that can be approached in various ways. While the brute-force method is straightforward, it can be...
View ArticleHTTP DELETE With Request Body
1. Introduction In this quick tutorial, we’ll implement a HTTP DELETE endpoint that accepts a body and then explore multiple ways to send a request to it. Consequently, we’ll use different popular REST...
View ArticleAutomatically Create a Database Schema With Spring Boot
1. Introduction Spring Boot works seamlessly with JPA making it easy to implement the data access layer in our applications. One of its powerful features is its ability to automatically create and...
View ArticleDetermining Empty Row in an Excel File With Java
1. Overview One common task when working with Excel files in Java is identifying empty rows, especially when processing large datasets for analysis or reporting. Empty rows in an Excel file can disrupt...
View ArticleGet Classpath From ClassLoader in Java
1. Overview In this article, we’ll explore how to obtain the classpath from a ClassLoader in recent OpenJDK distributions. 2. ClassLoaders and Classpath The Java Virtual Machine uses ClassLoaders to...
View ArticleConsumer Seek in Kafka
1. Overview Seeking in Kafka is similar to locating stored data on a disk before reading. Before reading data from a partition, we must first seek to the correct position. A Kafka consumer offset is a...
View ArticleStoring Basic Arrays and Collections using Array/JSON/XML Types in Hibernate
1. Overview Mapping data collections in an SQL table field is a common approach when we want to store non-relational data within our entity. In Hibernate 6, there are changes to the default mapping...
View ArticleFilter a List by Any Matching Field
1. Overview We often need to filter a List of objects by checking if any of their fields match a given String in many real-world Java applications. In other words, we want to search for a String and...
View ArticleConfigure CORS Policy for Spring Cloud Gateway
1. Overview Cross-Origin Resource Sharing (CORS) is a security mechanism for browser-based applications that allows a web page from one domain to access another domain’s resources. The browser...
View ArticleMock Nested Method Calls Using Mockito
1. Overview In this tutorial, we’ll see how to mock nested method calls using Mockito stubs, specifically deep stubs. To learn more about testing with Mockito, check out our comprehensive Mockito...
View ArticleGet a List of IP Connected in Same Network (Subnet) using Java
1. Introduction In networking, retrieving the list of IP addresses connected within the same network (subnet) is essential for tasks such as network monitoring and device administration. Additionally,...
View ArticleFormatting Java Code From the Command Line
1. Overview Despite the ability to format code within an Integrated Development Environment (IDE), we might want to use command-line formatters to automate the process of formatting code. Therefore, we...
View ArticleConversion from POJO to Avro Record
1. Introduction When working with Apache Avro in Java applications, we often need to convert Plain Old Java Objects (POJOs) to their Avro equivalent. While it’s perfectly acceptable to do this manually...
View ArticleEntityManagerFactory vs. SessionFactory
1. Introduction In this tutorial, we’ll explore the similarities and differences between SessionFactory and EntityManagerFactory. As their names suggest, both are factory classes used to create objects...
View ArticleIntellij Idea – How to Build Project Automatically
1. Introduction IntelliJ IDEA is a powerful IDE for Java and other JVM-based languages, offering numerous features to enhance productivity. One key feature allows IntelliJ IDEA to automatically build...
View ArticleLogstash vs. Kafka
1. Overview Logstash and Kafka are two powerful tools for managing real-time data streams. While Kafka excels as a distributed event streaming platform, Logstash is a data processing pipeline for...
View ArticleIntroduction to Apache Commons Validator
1. Overview In this tutorial, we’ll learn the basics of Apache Commons Validator, a powerful library from Apache Commons. It simplifies data validation in Java applications. Firstly, we will understand...
View Article