r/SpringBoot • u/subhadragope • Aug 25 '25
Question Has @MockBean in SpringTests been depricated?
What else to be used in place of u/MockBean?
r/SpringBoot • u/subhadragope • Aug 25 '25
What else to be used in place of u/MockBean?
r/SpringBoot • u/Daagi_saber • May 06 '25
I just shared a new proof of concept on LinkedIn: a conversational inventory system built with Spring Boot, Spring AI, and Ollama — no UI forms, no dropdowns. Just plain language commands like:
“Add a product called Wireless Mouse”
“Find electronics under 30 euros”
It’s powered by:
OpenAPI (auto-generates code fast)
Hexagonal architecture (clean + scalable)
WireMock + Testcontainers (easy testing)
This project shows how AI can do more than chat it can drive real backend logic and simplify complex workflows.
Want to see it in action? Check out the full breakdown + link to the code on my LinkedIn post here: Read the post
I’d love to hear your thoughts and if your team is working on something similar or needs help building AI-first backend tools, let’s connect.
r/SpringBoot • u/Individual-Hat8246 • Apr 20 '25
Hello everyone i was wondering if you guys use eclipse or intelliJ to also write javascript or react? I use eclipse for example but i don't get auto complete or auto complete suggestions for js or html or css when doing frontend for my projects. Are there any extensions am missing or should be using?
For now i'm thinking of using Vs code for the frontend part and for creating backend rest api will stick with eclipse.
Please tell what you guys use.
r/SpringBoot • u/zarinfam • Feb 07 '25
r/SpringBoot • u/javinpaul • Sep 12 '24
r/SpringBoot • u/No-Philosophy-1189 • Feb 02 '24
r/SpringBoot • u/Emotional-Emotion-17 • Feb 15 '26
I want to learn and practice:
• Core Java
• OOP concepts
• Collections
• Java 8
• Spring Boot
• Real-world projects
My goal is to become job-ready in the next 2 months, so I’m looking for someone who is serious, consistent, and ready to study daily. We can set daily targets, solve problems, discuss doubts, mock interview, and prepare for interviews together.
If anyone is interested please DM..
r/SpringBoot • u/Sea-War5240 • Feb 03 '26
Hello everyone,
I’m new to Spring Boot and REST APIs, and I’ve built a basic CRUD REST project to understand core concepts like controllers, services, repositories, DTOs, and entity relationships.
While developing this project, I made a design decision that I’m now unsure about and would really appreciate some validation or guidance from experienced developers.
My project link: chesszero-23/basicCRUDapplication
In my request and response DTOs, I directly used JPA entities instead of primitive IDs.
For example:
In BranchDTO, I used:
Company company
List<Employees> employees
instead of:
int companyId
List<Integer> employeeIds
Because of this, when I query my API using Postman, I get deeply nested responses like this:
[
{
"numberOfEmployees": 2345,
"employees": [
{
"firstName": "john",
"id": 1,
"lastName": "doe",
"salary": 20000
},
{
"firstName": "charlie",
"id": 2,
"lastName": "kirk",
"salary": 25000
}
],
"company": {
"branches": [
{
"branchId": 1,
"employees": [ ... ],
"numberOfEmployees": 2345
}
],
"companyId": 1,
"employees": [ ... ],
"name": "Amazon",
"numberOfEmployees": 2345,
"revenue": 24567
}
}
]This is not an infinite loop, but the data is repeated and deeply nested, which doesn’t feel like good API design.
After some discussion (and ChatGPT help), I learned that:
DTOs should not contain entities
DTOs should ideally contain primitive values or other DTOs
Relationships should be handled in the service layer, not the mapper
So now I’m trying to redesign my DTOs like this:
BranchCreateDTO → contains companyId
BranchResponseDTO → contains a CompanySummaryDTO (id + name)
Example service logic I’m using now:
u/Service
public BranchCompleteDTO createBranch(BranchCreateDTO dto) {
Company company = companyRepository.findById(dto.companyId())
.orElseThrow(() -> new RuntimeException("Company not found"));
Branch branch = branchMapper.toBranch(dto);
branch.setCompany(company);
Branch saved = branchRepository.save(branch);
return toBranchCompleteDTO(saved);
}This approach feels much more verbose compared to directly using entities in DTOs.
For read APIs (like “get all branches”), if I want to show company name, I end up creating:
CompanySummaryDTO
EmployeeSummaryDTO
BranchCompleteDTO
This makes even a simple CRUD project feel over-engineered.
Is this DTO-heavy approach actually the correct and recommended way, even for small projects?
Is there a simpler or cleaner pattern for basic CRUD APIs that still follows good practices?
At what point does it make sense to use:
DTOs
Or even returning entities directly?
If possible, could you share a simple but well-structured CRUD Spring Boot project that I can refer to?
I’m not trying to over-optimize — I just want to:
learn correct habits early
understand why certain patterns are preferred
avoid building bad practices into my foundation
I have structured my question with ChatGPT help, Thanks for your answers.
r/SpringBoot • u/Outside-Strain7025 • Dec 04 '25
I recently started with Spring and Spring Boot, as i was going through Spring MVC I came across Spring Data JDBC, Spring Data JPA and there is something as Spring JDBC API (which does not come under Spring Data Project) and all this got me so confused. I know JDBC and that the JPA is a specification for ORMs and hibernate is one of most popular ORM out there. But now i am cant how should i go about all this, what to learn first, should I learn Spring Data JDBC first or Spring JDBC API or I should learn vanilla Hibernate first and then go with Spring Data JPA. So i need some guidance on this part and also if you can suggest some good resource which actually explains whats going on under-hood that would be great.
r/SpringBoot • u/Agile_Rain4486 • Nov 27 '25
I found this comment under stack overflow claiming that n+1 performance is really better than a casterian product of join, also api to db call time is really not that significant? that n+1 from calls to db feels faster than 1 single call to db from app?
r/SpringBoot • u/leetjourney • Oct 26 '25
MCP is one of the buzzwords of this year and with the new Spring AI release, it's easier than you think to build an MCP server.
I've put together an example where I show you how to first create an MCP Server on top of a data source and then use an MCP Host (Claude Desktop) to to fulfil request through the MCP Server created in Spring Boot
Link to the video:
https://youtu.be/3rtZRKM39BI
Hope you find it useful
r/SpringBoot • u/HelpfulBasis4529 • Sep 22 '25
Hello guys, I joined an internship which requires me to use springboot to develop backend . But I have no prior experience in springboot . Do u guys have any suggestions for some courses that can help me learn it? Paid/free anything is fine
r/SpringBoot • u/Nervous-Staff3364 • Jul 21 '25
Ever since I started my career as a developer, I’ve always relied on JPA/Hibernate as the communication layer between my Java entities and the database. However, after years of experience and numerous real-world issues in enterprise applications, I’ve come to a crossroads.
If you’ve developed Java applications with JPA and Hibernate, you’ve likely faced these same challenges:
Complex mappings with OneToMany, ManyToMany, and bidirectional relationships
N+1 problems degrade performance in complex scenarios
“Dirty entities” mixing persistence logic with business logic
Difficulty building dynamic queries with the complex Criteria API
Bad performance if compared to no-ORM frameworks/libraries (e.g., JOOQ)
Proxy overhead causing LazyInitializationException
Deeply understanding the Hibernate life cycle
But what if I told you that, in my recent research, I stumbled upon an ORM framework that not only ensures the representation between our Java objects and our database model, but also promises to solve the following problems?
Eliminates N+1 by design
Keeps entities immutable and pure
Automatically generates optimized queries
️ Offers a powerful DSL for dynamic queries
Great performance (almost as if we were writing SQL commands in the DBMS)
Meet Jimmer — a revolutionary ORM that redefines how we interact with databases in Java.
r/SpringBoot • u/keerthistar2005 • Jun 28 '25
Hey everyone! I'm a fresher working on full-stack web development using Spring Boot (Java) for the backend and React for the frontend. I'm trying to build some solid projects for my resume, but I'm hoping to avoid the usual clones (like Todo apps, Netflix clones, etc.) since they feel a bit overdone and copy-paste-ish.
What kind of unique or impactful project ideas would actually help me stand out as a beginner with no work experience? Something that still teaches good practices (auth, CRUD, APIs, etc.) but shows creativity or problem-solving would be amazing.
Any advice, examples, or even challenges you recommend? Thanks a lot in advance! ✨
r/SpringBoot • u/IdeaRelative • May 14 '25
Hello everyone,
This year I decided to invest some time in a personal project: a Java learning blog.
I created a serios of tutorials for mid learners based on all the feedback that i found on reddit, university and from some internships where I was trainer.
The goal of these tutorials is to help you transition from simply knowing Java concepts to applying them in real projects through hands-on practice.
The main idea is to offer challenges and project ideas that help you practice different Spring topics. By the end, you'll have some portfolio-worthy content, practical experience, and more confidence for interviews.
The content is free, without ads or any account required. At the moment, im looking to receive some feedback from people to see if there are any improvements to be done. If you want, feel free to give it a try
Spring Projects ideas: https://explainjavalikeim8.com/spring-projects-ideas/
The roadmap: https://explainjavalikeim8.com/java-developer-roadmap-2025/
OOP Projects ideas: https://explainjavalikeim8.com/multi-layer-architecture-java-project-ideas/
r/SpringBoot • u/Tasty_Zebra_404 • Feb 08 '25
Is there a discord server to discuss and talk about spring? :)
Would be cool to chat with like minded devs all over the world
r/SpringBoot • u/Formal_Hippo8991 • Dec 30 '24
Hello guys,
Hope your are all good. I'm posting on reddit because i'm developing for a while a Full Stack Application, using Spring, Angular and MySQL.
The goal of this application, is to manage all the eletronic equipments of a company and track each equipment (history).
So, i'm also seeking for a job as a dev and i thought this could be a good idea to rich my portfolio experience, since i have none.
So the main goal of the application is:
- User
- Add User
- We can create a user assigning him to a department, location or neither
- Edit User
- Delete User
- View Equipments
- Assign user to an equipment or multiple equipments
- Equiment
- Add Equipment
- We can create a equipmentssigning him to a department, location or neither
- Edit Equipment
- Delete Equipment
- View User owner
- Assign an equipment to an user
This are the main features at the moment, of this application. Later i will do improvements such as:
- Add Spring Security (Implementation of JWT Authentication and Login)
- Add a dashboard for admin, shoqwing cards with stats or graphs (Equipments p/department, Total of Users, Users p/department, Equipment p/status, etc...)
- Implement a notification system, to alert the admin the equipments that are on use or returned from the warranty.
Please, i would love some feedback from you, and i don't mind if my code it's not the best but the logic is there. If u have any thoughts ply don't mind to ask.
All i need is your opinions, improvements, or something i might be doing wrong.
I'm excited to hear from you guys !
Here goes my git hub repo: https://github.com/programtiago/management-app
Wish you the best,
Tiago
r/SpringBoot • u/LouGarret76 • Feb 17 '24
Hi everyone,
I am new to web development. This is my first commercial project.
I am working on a startup idea that requires a landing page, an email capture page and a basic thank you page. Later one, I might add a blog and a selling page.
I am familiar with java for past experience with javafx desktop app. My reading suggested that Spring boot is the most popular framework for my need. I have coded the web app and it is working on my computer.
I want to deploy it online at minimal cost. I started reading about deployment and I realised that it is a whole new area of knowledge.
Any idea how I can go with this? What are the most popular and easiest solution for startups?
Thanks
r/SpringBoot • u/SpecificLove670 • Jul 26 '26
I’m a second year student at a computer science college but I didn’t take Java in college, however, I study Java with ChatGPT cuz I know C++ so i though learning java as a beginner from a playlist or a course wouldn’t be effective, And know I’m in a solid ground in Java, the progress is really good.
Now I don’t know what should I do about the DSA, I studied Data Structure and Algorithms in the college but with C++ language.
So should I study it again using Java? Or is it enough to just know the logic of the things in DSA.
And what should I do after finishing Java?
Start with Spring boot? Or APIs or what?
Notice that I was good in SQL server but not the others and IDK if I should study the databases again or not.
So enlighten please 🙏
r/SpringBoot • u/InformalPhase7658 • Jul 24 '26
I just started learning microservices in spring and dont know anything. Like I know that message brokers are for asynchronous exchange of messages though services, but I wanted to see everything from scratch, so now Im doing a project without any message brokers, just synchronous http requests and after that, when I meet problems with this, I would transition to the RabbitMQ I guess. Any suggestions or resources to learn for beginners?
r/SpringBoot
•
u/utsab-dahal
•
Jun 01 '26
Hi everyone,
I’m a beginner working on my first project using Spring Boot + Keycloak, and I’m a bit confused about the correct architecture. Any suggestions, video links, or GitHub project examples would be really helpful
What I understand so far:
Keycloak handles authentication (login, registration, roles)
Spring Boot acts as a resource server and validates JWT tokens
My app has its own database for business logic (users, orders, etc.)
My confusion:
User data during registration
If a user registers in Keycloak, how should I handle extra fields like:
phone number
address
app-specific profile data
What I’m looking for:
Since this is my first time using Keycloak, any of the following would really help:
Best practice explanation
Real-world architecture examples
GitHub repos using Spring Boot + Keycloak properly
YouTube videos or tutorials that actually follow production patterns
Thanks in advance
r/SpringBoot • u/paszeKongo • Mar 18 '26
r/SpringBoot • u/Quick-Resident9433 • Mar 12 '26
Hi, everyone. I don't have too much experience, and I'd really appreciate your guidance on this
Based on your experience with Spring Boot and ORM, what fetch type would you recommend for a large project with many entities and numerous nested relationships?
I ALREADY KNOW THIS
Eager will fetch all data from all nested entities
Lazy just load on demand
I know that we must always return DTO's with only the necessary fields using SQL queries.
But when it comes to specifying the fetch type within a Java class, I'd like to know the best practice for specifying the fetch type:
Is it better to always set the relationship as LAZY and never use EAGER?
@type_of_relantionship(fetch = FetchType.LAZY)
private Entity myEntity; // it has nested entites
|
| @type_of_relantionship(fetch = FetchType.LAZY)
|__________Entity subEntity
//more relantionships...
vs
@type_of_relantionship(fetch = FetchType.EAGER)
private Entity myEntity; // it has nested entites
|
| @type_of_relantionship(fetch = FetchType.EAGER)
|__________Entity subEntity
//more relantionships...Thanks in advance
r/SpringBoot • u/Aldousrich • Nov 21 '25
I'm a junior developer, not a strong programmer, but I wanted to start my own project using Spring Boot 3.5. I saw the news that the new version 4 was released. I don't know much about it, but should I upgrade to version 4, considering my project is already halfway through?
Sorry for my English, I just want opinion of senior and middle developers
Update Thank you guys for Replies, I enjoy it all. I still decided to stay for the 3rd spring, but it was interesting to read people's opinions.