Using Sequences in the H2 Database
1. Overview Our applications running in production usually support sequence-based primary key generation for efficiency and scalability. However, during development or testing, we often switch to...
View ArticleImplementing the Core Services of Spring Authorization Server with Redis
1. Overview The default implementation of Spring Authorization Server stores everything in memory. Things like RegisteredClient, Token stores, Authorization states, and more are all created and deleted...
View ArticlePagination Support in Spring Boot GraphQL
1. Introduction GraphQL is a powerful query language that lets clients request exactly the data they need. One common challenge when working with APIs is handling large datasets efficiently. Pagination...
View ArticleCopying Text to the Clipboard in Java
1. Overview In this tutorial, we’ll discuss how to copy text to the system clipboard in Java. These methods aren’t limited to GUI applications; they’ll also apply to console applications. We’ll look at...
View ArticleSpring AI With Docker Model Runner
1. Introduction Docker Model Runner, introduced in Docker Desktop 4.40 for Mac with Apple Silicon (at the time of writing this article), revolutionizes local AI development by simplifying the...
View ArticleHow to Unit Test MapStruct Generated Mappers
1. Introduction MapStruct is a powerful and sophisticated mapping library for Java projects. By following the convention-over-configuration approach, MapStruct enables developers to map large and...
View ArticleChat Memory in Spring AI
1. Overview We often need human-like interactions when we have a conversation with an AI application. Therefore, there is a need to maintain the conversation with the LLM model, while Spring AI...
View ArticleCount the Number of Sign Changes in an Array
1. Overview In this tutorial, we’ll see two approaches to count the number of sign changes in an array. First, we’ll check a straightforward iterative algorithm that traverses the array and increments...
View ArticleFixing Hibernate AnnotationException: Field Is a @ManyToOne Association and...
1. Overview In this short tutorial, we’ll shed light on how to fix the Hibernate exception: “AnnotationException: field is a @ManyToOne association and may not use @Column to specify column mappings...
View ArticleWriting Stored Procedures for H2 in Java
1. Introduction In this tutorial, we’ll learn how we can write stored procedures in Java for use with the H2 database engine. We’ll see what they are, how we can create them and how we can make use of...
View ArticleSecuring Spring AI MCP Servers With OAuth2
1. Introduction MCP (Model Context Protocol) is an open standard, introduced by Anthropic, designed to let AI models interact with external tools, data sources, and services in a structured way. An...
View ArticleJava Weekly, Issue 602
1. Spring and Java >> RESTful API Guidelines [asimio.neto] Good practices when building a REST API. So many APIs don’t get this stuff right. >> Simplifying Java Runtime Setup in OCI Cloud...
View Article