Java Localization – Formatting Messages
1. Introduction In this tutorial, we’ll consider how we can localize and format messages based on Locale. We’ll use both Java’s MessageFormat and the third-party library, ICU. 2. Localization Use Case...
View ArticleGuide to JVM Platform Annotations in Kotlin
1. Introduction Kotlin provides several annotations to facilitate compatibility of Kotlin classes with Java. In this tutorial, we’ll specifically explore Kotlin’s JVM annotations, how we can use them...
View ArticleDefault Column Values in JPA
1. Introduction In this tutorial, we’ll look into default column values in JPA. We’ll learn how to set them in as a default property in the entity as well as directly in the SQL table definition. 2....
View ArticleJava Weekly, Issue 280
Here we go… 1. Spring and Java >> Multiple Cache Configurations with Caffeine and Spring Boot [techblog.bozho.net] A novel extension of the CaffeineCacheManager lets you configure caches with...
View ArticleJPA @Basic Annotation
1. Overview In this quick tutorial, we’ll explore the JPA @Basic annotation. We’ll also discuss the difference between @Basic and @Column JPA annotations. 2. Basic Types JPA support various Java data...
View ArticleOData Protocol Guide
1. Introduction In this tutorial, we’ll explore OData, a standard protocol that allows easy access to data sets using a RESTFul API. 2. What is OData? OData is an OASIS and ISO/IEC Standard for...
View ArticleDerived Query Methods in Spring Data JPA Repositories
1. Introduction For simple queries, it’s easy to derive what the query should be just by looking at the corresponding method name in our code. In this tutorial, we’ll explore how Spring Data JPA...
View ArticleHow to Find an Exception’s Root Cause in Java
1. Introduction It’s pretty common in Java to work with nested exceptions as they can help us track the source of an error. When we deal with these kinds of exceptions, sometimes we may want to know...
View ArticleTemplate Engines in Groovy
1. Overview In this introductory tutorial, we’ll explore the concept of template engines in Groovy. In Groovy, we can use GStrings to generate dynamic text easily. However, the template engines provide...
View ArticleConverting Between Stream and Array in Java
1. Introduction It’s common to need to convert various dynamic data structures into arrays. In this tutorial, we’ll demonstrate how to convert a Stream to an array and vice versa in Java. 2. Converting...
View ArticleJava Weekly, Issue 281
Here we go… 1. Spring and Java >> Test-Driven Development: Really, It’s a Design Technique [infoq.com] A step-by-step walkthrough of TDD using a simple Java example. >> Property-based...
View ArticleString Initialization in Java
1. Introduction Java String is one of the most important classes and we’ve already covered a lot of its aspects in our String-related series of tutorials. In this tutorial, we’ll focus on String...
View ArticleIntroduction to RxKotlin
1. Overview In this tutorial, we’re going to review the use of Reactive Extensions (Rx) in idiomatic Kotlin using the RxKotlin library. RxKotlin is not an implementation of Reactive Extensions, per se....
View ArticleDifference Between a Java Keystore and a Truststore
1. Overview In this article, we’ll provide an overview of the differences between a Java keystore and a Java truststore. 2. Concepts In most cases, we use a keystore and a truststore when our...
View ArticleString API Updates in Java 12
1. Introduction Java 12 added a couple of useful APIs to the String class. In this tutorial, we will explore these new APIs with examples. 2. indent() The indent() method adjusts the indentation of...
View ArticleRemoving Stopwords from a String in Java
1. Overview In this tutorial, we’ll discuss different ways to remove stopwords from a String in Java. This is a useful operation in cases where we want to remove unwanted or disallowed words from a...
View ArticleLIKE Queries in Spring JPA Repositories
1. Introduction In this quick tutorial, we’re going to cover various ways of creating LIKE queries in Spring JPA Repositories. We’ll start by looking at the various keywords we can use while creating...
View ArticlePersisting Enums in JPA
1. Introduction In JPA version 2.0 and below, there’s no convenient way to map Enum values to a database column. Each option has its limitations and drawbacks. These issues can be avoided by using JPA...
View ArticleThe Difference Between CDI and EJB Singleton
1. Overview In this tutorial, we’ll take a closer look at two types of singletons available in Java EE. We’ll explain and demonstrate the differences and see the usages suitable for each one. First,...
View ArticleHow to Delay Code Execution in Java
1. Introduction It is relatively common for Java programs to add a delay or pause in their operation. This can be useful for task pacing or to pause execution until another task completes. This...
View Article