Solving Spring Data JPA ConverterNotFoundException: No converter found
1. Overview When using Spring Data JPA, we often leverage derived and custom queries that return the result in our preferred formats. A typical example is the DTO projection, which offers a great way...
View ArticleReturn Non-null Elements From Java 8 Map Operation
1. Overview The Java Stream API introduced many features that significantly enhance the functionality and readability of our code. Among these, the map() method stands out as a powerful tool for...
View ArticleDeclare an Enum in an Inner Class in Java
1. Introduction When working with Java, enums serve as a convenient way to define a fixed set of constants. However, creating enums within inner classes can introduce some complexities and...
View ArticleConvert Decimal to Fraction in Java
1. Introduction A fraction is another way of representing a number, consisting of a numerator and a denominator. For example, the fraction 3/5 can be thought of as “3 out of 5,” representing the same...
View ArticleUsing Comparator.nullsLast() to Avoid NullPointerException When Sorting
1. Overview Sorting a collection that contains null values can lead to a NullPointerException if not handled properly. Java 8 has a convenient method Comparator.nullsLast() to address this issue. This...
View ArticleCompletableFuture vs. Mono
1. Overview In this quick tutorial, we’ll learn the differences between CompletableFuture and Mono from Project Reactor in Java. We’ll focus on how they handle asynchronous tasks and the execution that...
View ArticleStatic Code Analysis Using Infer
1. Introduction In the realm of software development, ensuring code quality is very important, especially for complex and large codebases. Static code analysis tools like Infer provide us with...
View ArticleReplacing Strings in Java Using Regex: Back Reference vs. Lookaround
1. Overview In this tutorial, we’ll examine how to use the replaceAll() provided in the String class to replace text using regular expressions. Additionally, we’ll learn two methods, back reference and...
View ArticleJava Weekly, Issue 543
1. Spring and Java >> JEP 467: Java Enhances Documentation with Markdown Support [infoq.com] Another look at the proposed feature for Java 23: enabling markdowns in JavaDocs, instead of a painful...
View ArticleOpenAI API Client in Java
1. Overview With the widespread use of generative AI and ChatGPT, in particular, many languages have started to provide libraries that interact with their OpenAI API. Java isn’t an exception. In this...
View ArticleConsumer Processing of Kafka Messages With Delay
1. Overview Apache Kafka is an event streaming platform that collects, processes, stores, and integrates data at scale. Sometimes, we may want to delay the processing of messages from Kafka. An example...
View ArticleExtracting Text Between Parentheses in Java
1. Overview When we code in Java, there are many scenarios where we need to extract text enclosed within parentheses. Understanding how to retrieve the text between parentheses is an essential skill....
View ArticleReading CSV Headers Into a List
1. Overview In this short tutorial, we’ll explore different ways of reading CSV headers into a list in Java. First, we’ll learn how to do this using JDK classes. Then, we’ll see how to achieve the same...
View ArticleHow to Convert org.w3c.dom.Document to String in Java
1. Overview When handling XML in Java, we’ll often have an instance of a org.w3c.dom.Document that we need to convert to a String. Typically we might want to do this for a number of reasons, such as...
View ArticlegRPC Authentication in Java Using Application Layer Transport Security (ALTS)
1. Overview In this tutorial, we’ll explore the role of ALTS (Application Layer Transport Security) in gRPC applications. As we know, ensuring authentication and data security is difficult but...
View ArticleAutowiring an Interface With Multiple Implementations
1. Introduction In this article, we’ll explore autowiring an interface with multiple implementations in Spring Boot, ways to do that, and some use cases. This is a powerful feature that allows...
View ArticleRemoving Bracket Characters in a Java String
1. Overview When working with String values in Java, there are times when we need to clean up our data by removing specific characters. One common scenario is removing bracket characters. With the...
View ArticleEffective Scaling of Hot Application Instances with OpenJDK CRaC Help in...
1. Introduction In this tutorial, we’ll learn about Coordinated Restore at Checkpoint (CRaC), an OpenJDK project that allows us to start Java programs with a shorter time to the first transaction....
View ArticleIntroduction to Apache Nutch
1. Introduction In this tutorial, we’re going to have a look at Apache Nutch. We’ll see what it is, what we can do with it, and how to use it. Apache Nutch is a ready-to-go web crawler that we can use...
View ArticleReturn Auto Generated ID From Insert With MyBatis and Spring
1. Overview MyBatis is an open-source Java persistence framework that can be used as an alternative to JDBC and Hibernate. It helps us reduce code and simplifies the retrieval of the result, allowing...
View Article