Guide to MapDB
1. Introduction In this article, weāll look at the MapDB library ā an embedded database engine accessed through a collection-like API. We start by exploring the core classes DBĀ andĀ DBMakerĀ that help...
View ArticleThe Java SecureRandom Class
1. Introduction In this short tutorial, weāll learn about java.security.SecureRandom, aĀ class that provides a cryptographically strong random number generator. 2. Comparison to java.util.Random...
View ArticleJWS + JWK in a Spring Security OAuth2 Application
1. Overview In this tutorial, weāll learn about JSON Web Signature (JWS), and how it can be implemented using the JSON Web Key (JWK) specification on applications configured with Spring Security...
View ArticleWorking with Enums in Thymeleaf
1. Introduction In this quick tutorial, weāre going to learn how to work with enumsĀ in Thymeleaf. Weāll start by listing enum values in a dropdown. After that, weāll look at using our enum for flow...
View ArticleHow to Reverse a String in Java
1. Overview In this tutorial, weāre going to see how we can reverse a String in Java. Weāll start to do this processing using plain Java solutions. Next, weāll have a look at the options that the...
View ArticleSpring @Qualifier Annotation
1. Overview In this article, weāll explore what the @Qualifier annotation can help us with, which problems it solves, and how to use it. Weāll also explain how itās different from the @Primary...
View ArticleProgrammatic Transaction Management in Spring
1. Overview Spring's @Transactional annotation provides a nice declarative API to mark transactional boundaries. Behind the scenes, an aspect takes care of creating and maintaining transactions as they...
View ArticleManipulating Strings in Linux with tr
1. Overview In this tutorial, we'll see how to manipulate strings using the tr in Linux. Note that we've tested these commands using Bash, but should work on any POSIX-compliant terminal. 2. Lower Case...
View ArticleGuide to Stream Redirections in Linux
1. Introduction Whenever we work on the Linux command line, we often have to pass data from one command to another, like feeding a list ofĀ find results into aĀ grep.Ā This is where streams come into...
View ArticleHow to Count Duplicate Elements in Arraylist
1. Overview In this short tutorial, we'll look at some different ways to count the duplicated elements in an ArrayList. 2. Loop with Map.put() Our expected result would be a Map object, which contains...
View ArticleBest Practices for REST API Error Handling
1. Introduction REST is a stateless architecture in which clients can access and manipulate resources on a server. Generally, REST services utilize HTTP to advertise a set of resources that they manage...
View ArticleIntro to Spring Data Geode
1. Overview Apache Geode provides data management solutions through a distributed cloud architecture. It would be ideal to utilize the Spring Data APIs for the data access through the Apache Geode...
View ArticleConcatenating Files in Linux
1. Introduction Sometimes, we need to do some operations that require using multiple files at the same time. This can be something as common as searching for some text in multiple files or merging...
View ArticleFile System Mocking with Jimfs
1. Overview Typically, when testing components that make heavy use of I/O operations, our tests can suffer from several issues such as poor performance, platform dependency, and unexpected state. In...
View ArticleTesting a Spring Batch Job
1. Introduction Unlike other Spring-based applications, testing batch jobs comes with some specific challenges, mostly due to the asynchronous nature of how jobs are executed. In this tutorial, we're...
View ArticleMapping a Single Entity to Multiple Tables in JPA
1. Introduction JPA makes dealing with relational database models from our Java applications less painful. Things are simple when we map every table to a single entity class. But, sometimes we have...
View ArticleConverting Java Date to OffsetDateTime
1. Introduction In this tutorial, we learn about the difference between DateĀ and OffsetDateTime. We also learn how to convert from one to the other. 2. Difference between Date and OffsetDateTime...
View ArticleJava Scanner hasNext() vs. hasNextLine()
1. Overview The Scanner class is a handy tool that can parse primitive types and strings using regular expressions and was introduced into the java.util package in Java 5. In this short tutorial, we'll...
View ArticleCustomizing the Result of JPA Queries with Aggregation Functions
1. Overview While Spring Data JPA can abstract the creation of queries to retrieve entities from the database in specific situations, we sometimes need to customize our queries, such as when we add...
View ArticleGuide to the Linux find Command
1. Introduction The Linux find command can be used to find files and directories on a disk. It provides several command-line options that make it a powerful tool. In this tutorial, we'll look at how to...
View Article