Negate a Predicate Method Reference with Java 11
1. Overview In this short tutorial, we’ll see how to negate a Predicate method reference using Java 11. We’ll start with the limitations encountered in order to achieve this before Java 11. Then we’ll...
View ArticleGuide to Java FileChannel
1. Overview In this quick tutorial, we’ll look at the FileChannel class provided in the Java NIO library. We’ll discuss how to read and write data using FileChannel and ByteBuffer. We’ll also explore...
View ArticleJPA/Hibernate Projections
1. Overview In this tutorial, we’ll learn how to project entity properties using JPA and Hibernate. 2. The Entity First, let’s look at the entity we will be using throughout this article: @Entity...
View ArticleSpring Boot Embedded Tomcat Logs
1. Introduction Spring Boot comes with an embedded Tomcat server, which is super-handy. However, we can’t see Tomcat’s logs by default. In this tutorial, we’ll learn how to configure Spring Boot to...
View ArticleDesign Strategies for Decoupling Java Modules
1. Overview The Java Platform Module System (JPMS) provides stronger encapsulation, more reliability and better separation of concerns. But all these handy features come at a price. Since modularized...
View ArticleRSocket Using Spring Boot
1. Overview RSocket is an application protocol providing Reactive Streams semantics – it functions, for example, as an alternative to HTTP. In this tutorial, we’re going to look at RSocket using Spring...
View ArticleIntro to OData with Olingo
1. Introduction This tutorial is a follow-up to our OData Protocol Guide, where we’ve explored the basics of the OData protocol. Now, we’ll see how to implement a simple OData service using the Apache...
View ArticleA First Experience Working with an AI Assistant in Java
I started using Codota recently, and have been highly impressed with what the tool can do. Simply put, the goal of Codota is to make development simpler, and most importantly – a lot faster. Working...
View ArticleJava Weekly, Issue 282
Here we go… 1. Spring and Java >> Reactive Transactions with Spring [spring.io] A couple of milestone releases that let you play with Spring Reactive’s transactional support, using either RDBC2...
View ArticleUnderstanding NumberFormatException in Java
1. Introduction Java throws NumberFormatException – an unchecked exception – when it cannot convert a String to a number type. Since it’s unchecked, Java does not force us to handle or declare it. In...
View ArticleComposite Primary Keys in JPA
1. Introduction In this tutorial, we’ll learn about Composite Primary Keys and the corresponding annotations in JPA. 2. Composite Primary Keys A composite primary key – also called a composite key – is...
View ArticleExplore Jersey Request Parameters
1. Introduction Jersey is a popular Java framework for creating RESTful web services. In this tutorial, we’ll explore how to read different request parameter types via a simple Jersey project. 2....
View ArticleDouble Dispatch in DDD
1. Overview Double dispatch is a technical term to describe the process of choosing the method to invoke based both on receiver and argument types. A lot of developers often confuse double dispatch...
View ArticleJava Weekly, Issue 283
Here we go… 1. Spring and Java >> Feature toggles in a microservice environment – Part 2: Implementation [blog.codecentric.de] A quick look at Unleash, a Node.js service for managing feature...
View ArticleEnabling Transaction Locks in Spring Data JPA
1. Overview In this article, we’ll discuss enabling transaction locks in Spring Data JPA for custom query methods and predefined repository CRUD methods. We will also discuss different lock types and...
View ArticleRefactoring in Eclipse
1. Overview On refactoring.com, we read that “refactoring is a disciplined technique for restructuring an existing body of code, altering its internal structure without changing its external behavior.”...
View ArticleGeospatial Support in MongoDB
1. Overview In this tutorial, we’ll explore the Geospatial support in MongoDB. We’ll discuss how to store geospatial data, geo indexing, and geospatial search. We’ll also use multiple geospatial search...
View ArticleWill an Error Be Caught by Catch Block in Java?
1. Overview In this short article, we’re going to show how to properly catch Java errors, and we’ll explain when it doesn’t make sense to do so. For detailed information about Throwables in Java,...
View ArticleGuide to ApplicationContextRunner in Spring Boot
1. Overview It’s well known that auto-configuration is one of the key features in Spring Boot, but testing auto-configuration scenarios can be tricky. In the following sections, we’ll show how...
View ArticleIntroduction to Docker Compose
1. Overview When using Docker extensively, the management of several different containers quickly becomes cumbersome. Docker Compose is a tool that helps us overcome this problem and easily handle...
View Article