๐ Built a Spring Boot Auditing Project
Recently, I implemented Spring Data JPA Auditing in a Todo Management application to understand how enterprise applications track data creation and modifications automatically.
๐ Project Flow
A user creates a Todo by providing:
โข Name
โข Task
โข Description
The Todo ID is generated automatically by JPA.
When the application starts, Spring requests an AuditorAware implementation from the AuditingConfig class. This provider returns the current user, which is then used by the auditing framework to populate audit-related fields automatically.
๐ Auditing Features Implemented
โ CreatedDate โ Stores the date and time when the entity is first created.
โ LastModifiedDate โ Stores the latest date and time when the entity is updated.
โ CreatedBy โ Stores the author who created the entity.
โ LastModifiedBy โ Stores the user who last modified the entity.
๐ BaseEntity Design
All auditing fields are placed inside a reusable BaseEntity class.
The @MappedSuperclass annotation ensures that:
โข No separate table is created for BaseEntity.
โข All audit fields are inherited by child entities.
โข The audit columns become part of the entity that extends BaseEntity.
This allowed me to keep the Todo entity clean while reusing auditing functionality across future entities.
๐ Technologies Used
๐น Java
๐น Spring Boot
๐น Spring Data JPA
๐น Hibernate
๐น MySQL
๐น Lombok
๐น REST APIs
This project helped me understand how real-world applications maintain accountability, traceability, and change history without writing manual tracking logic.
Next Update โก Integrating Spring Security so the auditing system can capture the actual authenticated user instead of a hardcoded auditor.
#Java#SpringBoot#SpringDataJPA#Hibernate#BackendDevelopment#SoftwareEngineering#RESTAPI#LearningInPublic#JavaDeveloper
Completed the Third Module by Coding Shuttle @sudoanuj which is based on the Relationship mapping between the tables, how JDBC and Spring Data JPA helps to map the POJO with the database. Learned Cascading and many other important concepts like pagination and projection. The homework assignment was heavily focused on the relationship mappings.
The first homework assignment was related to subject, student, department, admission record and professor which is basically a college management system where the ERD diagram was provided by @sudoanuj which made things easier. The tables have different relationships with each other. Some tables have OneToOne relationship and some have ManyToMany.
Let's Understand the annotations with examples:
1. OneToOne: A Student can have only one Admission record. So that's why a OneToOne relationship is established between these two tables.
2. OneToMany: A Professor can teach more than one subject. So there's a OneToMany relationship established between these two tables and vice versa for ManyToOne.
3. ManyToMany: Many students can be taught by many professors.
mappedBy is used to define the non-owning (inverse) side of a bidirectional entity relationship. It is present on the inverse side of the relationship, telling JPA that the other side owns the foreign key.
JsonIgnore is a Jackson library annotation used to prevent specific entity fields or relationships from being serialized into JSON. It is commonly used to hide sensitive data like passwords or to break infinite recursion loops caused by bidirectional database relationships. Heavily used in ManyToMany relationships.
JoinTable with JoinColumn defines the owning side of a ManyToMany relationship in JPA. It explicitly defines the intermediate join table and the foreign key columns used to establish the relationship between two database tables.
The second homework project was an Author and Book management system where we had to map authors and the books they published. There are only two tables in this project with a ManyToMany relationship between authors and books โ because one author can write many books and one book can have many authors.
The main challenge was implementing all these APIs:
Create a new book and author
Retrieve a list of all books and authors
Retrieve a single book or author by ID
Update book and author details
Delete a book or author
Find books by title
Find books published after a certain date
Find authors by name
Find all books by a specific author
Some APIs required custom query methods in the Repository layer using Spring Data JPA's method naming conventions.
Definitely a solid project! Learned a lot in this module. Will dive more in-depth into topics like Cascading and N 1 query optimization.
#Java#SpringBoot#SpringDataJPA#BackendDevelopment#LearningInPublic#JavaDeveloper#CodingJourney
Mastering Spring Data JPA from beginner to advanced with practical examples, repository patterns, entity relationships, custom queries, pagination, transactions, and performance optimization in Spring Boot applications.
Read: blog.masteringbackend.com/maโฆ#SpringBoot#SpringDataJPA
Database access in Java has come a long way ๐
Started with writing everything manually in JDBCโฆ
Then came Hibernate ORMโฆ
Then Spring Boot JPA changed the gameโฆ
And Spring Data JPA made development even faster with clean repository methods ๐ฅ
But hereโs the truth ๐
Tools can save time, but understanding SQL, indexing, joins, and performance will always make you a stronger developer.
What do you prefer in real projects?
1๏ธโฃ JDBC
2๏ธโฃ Hibernate
3๏ธโฃ Spring Data JPA
4๏ธโฃ Native SQL / jOOQ / MyBatis
If you into tech background,let connect.
Drop your answer in comments ๐
#Java#SpringBoot#SpringDataJPA#Hibernate#BackendDeveloper#SoftwareEngineering#Coding#Programming#Developers#Collaboration#Networking
Day 24 of #SpringBoot ๐ฑ
Containerized my database and wired up the backend! ๐ณ
โ Swapped H2 for MySQL
โ Running DB inside Docker
โ Refactored everything to use Spring Data JPA
#Java#BackendDevelopment#SpringDataJPA#Coding
Day 93 of #100DaysOfCode (#JavaRevision)
โ #SpringBoot / #SpringDataJPA
Going deeper into derived query methods and method naming conventions
Understanding how Spring Data generates queries from repository method names
Working with custom JPQL queries using @โQuery annotation
Comparing JPQL vs native queries and when to use each
#Java#Backend#SpringBoot#JPA#100DaysOfCode
Day 92 of #100DaysOfCode (#JavaRevision)
โ #SpringBoot / #SpringDataJPA
- Went deep into Spring Data JPA fundamentals
- Worked with different Repository interfaces (CrudRepository, PagingAndSortingRepository, JpaRepository) and understood how they build on each other
- Covered the key features of Spring Data JPA โ reducing boilerplate, auto-implemented CRUD, pagination & sorting, and query abstraction
- Got started with the basics of JPQL and how it operates on entities instead of tables
๐ Repository hierarchy & capabilities visualized in the reply ๐
#Java#Spring#Backend#JPA#Hibernate#100DaysOfCode
Built a Blood Donor Search Portal!
๐ฉธ Features:
๐ Search donors by blood group, city, district,
โก Optimized queries with Spring Data JPA
๐จ UI with Spring MVC Thymeleaf
๐ ๏ธ Built on Spring Boot MySQL
๐ Repo: PraneethPW/RUDHIRA-PORTAL
#SpringBoot#Backend#SpringDataJPA
Built a clean Spring Boot Spring Data JPA example covering:
๐ Structure:
Entity โ Student.java
Service โ Interface & Implementation
Repo โ JpaRepository
Application โ Starter point
๐ป GitHub โ lnkd.in/gm9Qiky6#SpringBoot#SpringDataJPA#BackendDev
Sunday well played โ both on the field and in code!
Started the day with some solid cricket shots and ended it with:
-> JpaRepository basics
-> Static & Dynamic Projections
-> Custom Finder Methods
-> Custom Query Methods
#SpringBoot#SpringDataJPA#JavaDev#SundayCoding