Array to String Conversions
1. Overview In this short tutorial, we’re going to look at converting an array of strings or integers to a string and back again. We can achieve this with vanilla Java and Java utility classes from...
View ArticleSpring Data with Reactive Cassandra
1. Introduction In this tutorial, we’ll learn how to use reactive data access features of Spring Data Cassandra. Particularly, this is the third article of the Spring Data Cassandra article series. In...
View ArticleJava Weekly, Issue 257
Here we go… 1. Spring and Java >> Practice Mock Interviews & Coding Problems with Pramp If you’re looking to improve your interview game, definitely have a look at the Pramp mock interviews...
View ArticleWays to Iterate Over a List in Java
1. Introduction Iterating over the elements of a list is one of the most common tasks in a program. In this tutorial, we’re going to review different ways to do this in Java. We’ll be focusing on...
View ArticleAuto-Generated Field for MongoDB using Spring Boot
1. Overview In this tutorial, we’re going to learn how to implement a sequential, auto-generated field for MongoDB in Spring Boot. When we’re using MongoDB as the database for a Spring Boot...
View ArticleKotlin Contracts
1. Overview In this tutorial, we will talk about Kotlin Contracts. Their syntax is not stable yet, but the binary implementation is, and Kotlin stdlib itself is already putting them to use. Basically,...
View ArticleOperator Overloading in Kotlin
1. Overview In this tutorial, we’re going to talk about the conventions that Kotlin provides to support operator overloading. 2. The operator Keyword In Java, operators are tied to specific Java...
View ArticleGet All Data from a Table with Hibernate
1. Overview In this quick tutorial, we’ll look at how to get all data from a table with Hibernate using JPQL or the Criteria API. JPQL provides us with a quicker and simpler implementation while using...
View ArticleGuide to Character Encoding
1. Overview In this tutorial, we’ll discuss the basics of character encoding and how we handle it in Java. 2. Importance of Character Encoding We often have to deal with texts belonging to multiple...
View ArticleCustomizing Authorization and Token Requests with Spring Security 5.1 Client
1. Overview Sometimes OAuth2 APIs can diverge a little from the standard, in which case we need to do some customizations to the standard OAuth2 requests. Spring Security 5.1 provides support for...
View ArticleRemove Leading and Trailing Characters from a String
1. Introduction In this short tutorial, we’ll see several ways to remove leading and trailing characters from a String. For the sake of simplicity, we’ll remove zeroes in the examples. With each...
View ArticleJPA Entity Graph
1. Overview JPA 2.1 has introduced the Entity Graph feature as a more sophisticated method of dealing with performance loading. It allows defining a template by grouping the related persistence fields...
View ArticleFormatting with printf() in Java
1. Introduction In this tutorial, we’ll demonstrate different examples of formatting with the printf() method. The method is part of the java.io.PrintStream class and provides String formatting...
View ArticleSpring Boot With SQLite
1. Overview In this quick tutorial, we’ll go through steps to use an SQLite database in a JPA-enabled Spring Boot application. Spring Boot supports a few well known in-memory databases out of the box,...
View ArticleImmutable Map Implementations in Java
1. Overview It is sometimes preferable to disallow modifications to the java.util.Map such as sharing read-only data across threads. For this purpose, we can use either an Unmodifiable Map or an...
View ArticleJava Compound Operators
1. Overview In this tutorial, we’ll have a look at Java compound operators, their types and how Java evaluates them. We’ll also explain how implicit casting works. 2. Compound Assignment Operators An...
View ArticleJava Weekly, Issue 258
Here we go… 1. Spring and Java >> The best way to initialize LAZY entity and collection proxies with JPA and Hibernate [vladmihalcea.com] A good write-up on when and how to use lazy...
View ArticleFind the Longest Substring without Repeating Characters
1. Overview In this tutorial, compare ways to find the longest substring of unique letters using Java. For example, the longest substring of unique letters in “CODINGISAWESOME” is “NGISAWE”. 2. Brute...
View ArticleInline Functions in Kotlin
1. Overview In Kotlin, functions are first-class citizens, so we can pass functions around or return them just like other normal types. However, the representation of these functions at runtime...
View ArticleOne-to-One Relationship in JPA
1. Introduction In this tutorial, we’ll have a look at different ways of creating one-to-one mappings in JPA. We’ll need a basic understanding of the Hibernate framework, so please check out our Guide...
View Article