To transform a plain Spring Boot project into a basic Vaadin “Hello World” app, you’ll need to add Vaadin dependencies, configure the build for frontend resources, update your main application class, and create a simple Vaadin route (view). This assumes a Maven-based project using Spring Boot 3.x (Vaadin 24+ requires it) and Java 17+. If…
Search Results for: Spring
Integrating xAI Grok API with Spring Boot
This guide walks you through integrating the xAI Grok API into a Spring Boot application. The Grok API is a RESTful service compatible with OpenAI’s API structure, making it straightforward to use for chat completions, text generation, and more. It powers models like grok-beta, grok-2-latest, and advanced ones like grok-3 or grok-4 (availability depends on…
What are ways to Optimize the backend endpoints in Spring Boot
To Optimize backend endpoints in a Spring Boot app with Java 17 can significantly improve performance and scalability. Here’s a structured list of strategies, starting from database-level optimizations and moving to application and infrastructure layers: Database/SQL Optimization ✅ Optimize SQL Queries Use EXPLAIN plans to analyze slow queries. Use proper indexing on columns used in…
Spring Boot CSV Export
Below is a Spring Boot example that demonstrates Export of data to CSV by processing records in two ways with and without library. A count() query to get the total number of records. Paging (PageRequest) to fetch records batch-by-batch. Writing directly to the response’s OutputStream to avoid holding all records in memory. ✅ Assumptions You…
How to pass a List in Spring Repository Query
To pass a List (or any Collection) into a Spring Data JPA repository query, you can use the IN clause in JPQL or native SQL, and Spring will automatically bind the list elements. ✅ Example 1: Using @Query with JPQL @Query(“SELECT p FROM Product p WHERE p.id IN :ids”) List<Product> findByIds(@Param(“ids”) List<Long> ids); You can…
How to return HashMap from Spring Repository
A Spring Data Repository typically returns entities or List of Object arrays List<Object[]> – for custom queries, not collections like HashMap<K, V> directly. You can structure a custom query or a method that returns a Map in your Service or in additional method, but it’s not automatic — you have to be explicit about it….
Spring Boot RestController output fromat
Spring Boot decides which format (JSON, XML, Protobuf, etc.) to use when handling a request based on the configuration for content negotiation. 1. Content Negotiation in Spring Boot Spring Boot decides how to serialize and deserialize request/response bodies using HttpMessageConverters. These converters are automatically registered based on the libraries in the classpath. 2. How Does…
How to Optimize an Inefficient N+1 Query Problem in Spring Boot
The N+1 query problem is a common issue that occurs when using JPA repositories in Spring Boot. It happens when you have a one-to-many or many-to-one relationship between entities, and you’re fetching the parent entity with its children. This results in a separate database query for each child, leading to inefficient performance. Optimizing N+1 Query…
Object Mapping – examples With Java Spring Boot
There are several Java Frameworks available that does Object Mapping – automatic creation of DTO (Data Transfer Object) in Spring Boot. Reasons we need it Spring (Boot) Framework saves a lot of time of developers by hiding complexity and placing smart defaults with convention over configuration. This comes with the price of a “magic” happening…
Social Media Post Tracker – Spring Boot – Vaadin Web App
This is simple Vaadin Web Tracker App build on top Spring Boot to allow you to have your Social Media Post and content in one place. It will allow you to see missing places where you haven’t posted yet and you should – to keep the reach of your free content at peak. Post Tracker…









