Skip to content

ksachin7/spring-orm-practice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Spring ORM Practice

Project : hibernate

This project is a basic demonstration of setting up Hibernate for Spring applications to perform object-relational mapping (ORM).

Practiced Concepts:

  1. Hibernate Configuration: Configured Hibernate through hibernate.cfg.xml, specifying database connection details, dialect, and other properties.

  2. Persistence Annotations: Utilized Hibernate's persistence annotations such as @Entity, @Table, @Id, @GeneratedValue, and @Column to map Java entities to corresponding database tables and columns.

  3. Fetch Types: Explored different fetch types to control how related entities are loaded from the database.

  4. Cascading: Learned about cascading operations to automatically propagate changes from parent entities to associated child entities.

  5. Caching: Explored caching mechanisms in Hibernate to improve application performance by reducing the number of database queries.

  6. Session Management: Managed Hibernate SessionFactory using a utility class (HibernateUtil) to establish and close database sessions efficiently.

  7. Transaction Handling: Implemented transaction management using Transaction objects to ensure data consistency and integrity during database operations.

  8. Persisting Data: Practiced persisting data to the database using Hibernate's session API.

Through this project, I've gained practical experience in setting up Hibernate within a Spring application, defining entity mappings, managing sessions and transactions, and persisting data to the database efficiently. These skills are essential for building robust and scalable Spring applications that interact with relational databases using ORM frameworks like Hibernate.

Project : Bank-Account-Management-System

This project provides a basic banking system with CRUD operations, exception handling, pagination, validation, and a Thymeleaf-based UI.

Practiced Concepts:

  1. CRUD Operations: Practiced CRUD (Create, Read, Update, Delete) operations using Spring Data JPA for database interaction.
  2. Pagination: Implemented pagination with Spring Data JPA to efficiently retrieve large datasets by breaking them into manageable chunks.
  3. Validation: Utilized validation to ensure data integrity and enforce constraints on user input, improving the overall quality of the application.
  4. H2 DB: Employed H2 Database for its simplicity and convenience during development and testing, providing fast and lightweight data storage.

Through this project, I gained practical experience in setting up Spring Data JPA and H2 Database, as well as performing CRUD operations and implementing pagination.