Spring Data JPA Batch Inserts 1. Overview Going out to the database is expensive. We may be able to improve performance and consistency by batching multiple inserts into one. In this tutorial, we’ll look at how to do this with Spring Data JPA. 2. Spring JPA Repository First, we’ll need… Continue Reading spring-data-jpa-batch-inserts

Convert a Comma Separated String to a List in Java 1. Overview In this tutorial, we’ll look at converting a comma-separated String into a List of strings. Additionally, we’ll transform a comma-separated String of integers to a List of Integers. 2. Dependencies A few of the methods that we’ll use… Continue Reading java-string-with-separator-to-list

Java 8 Stream findFirst() vs. findAny() 1. Introduction The Java 8 Stream API introduced two methods that are often being misunderstood: findAny() and findFirst(). In this quick tutorial, we will be looking at the difference between these two methods and when to use them. Further reading: Filtering a Stream of… Continue Reading java-stream-findfirst-vs-findany

Java Weekly, Issue 227 Here we go… 1. Spring and Java ===== >> Monitor and troubleshoot Java applications and services with Datadog Sponsored Optimize performance with end-to-end tracing and out-of-the-box support for popular Java frameworks, application servers, and databases. Try it free.  >> My first impressions about Graal VM [blog.frankel.ch] GraalVM… Continue Reading java-weekly-227

Exploring the Spring 5 WebFlux URL Matching 1. Overview Spring 5 brought a new PathPatternParser for parsing URI template patterns. This is an alternative to the previously used AntPathMatcher. The AntPathMatcher was an implementation of Ant-style path pattern matching. PathPatternParser breaks the path into a linked list of PathElements. This chain… Continue Reading spring-5-mvc-url-matching

How to Inject a Property Value Into a Class Not Managed by Spring? Spring 1. Overview By design, classes annotated with @Repository, @Service, @Controller, etc. are managed by Spring and injecting configuration there is easy and natural. What’s not as simple is passing configuration to classes that are not directly… Continue Reading inject-properties-value-non-spring-class

Exploring the Spring Boot TestRestTemplate 1. Overview This article explores the Spring Boot TestRestTemplate. It can be treated as a follow-up of The Guide to RestTemplate, which we firmly recommend to read before focusing on TestRestTemplate. TestRestTemplate can be considered as an attractive alternative of RestTemplate. 2. Maven Dependencies To… Continue Reading spring-boot-testresttemplate