Inventory Manager - WIP
Learning Project
Java - Maven - Hibernate - PostgreSQL - HikariCP
Description
This project was designed to deepen my understanding of backend development principles and best practices, with a particular focus on Hibernate ORM, database design, JPA implementation, and robust unit testing. The core objective was to create a solid and maintainable foundation for a book management application, emphasizing the service, model, and data layers.
Key Features and Technologies:
Database Design: A relational database schema was carefully designed to efficiently store and manage book information, including titles, authors, genres, ISBNs, and publication dates. Considerations were made for data integrity, relationships between entities, and potential future expansion.
Hibernate ORM: Leveraging Hibernate, I implemented the object-relational mapping for the application. This involved mapping database tables to Java entities, defining relationships (one-to-many, many-to-many), and utilizing Hibernate's features for data persistence, retrieval, and manipulation.
JPA Implementation: The project adheres to the Java Persistence API (JPA) standards, ensuring a consistent and portable approach to data access. JPA annotations were used to define entities, relationships, and query methods.
Service Layer Logic: A well-defined service layer encapsulates the core business logic for managing books. This includes operations like adding new books, updating existing records, searching for books by various criteria, and handling potential data validation rules.
Unit Testing: A comprehensive suite of unit tests was developed using JUnit and Mockito to ensure the reliability and correctness of the backend logic. Tests were written to cover various scenarios, including data persistence, retrieval, error handling, and edge cases.
Learning Outcomes:
In-depth understanding of Hibernate ORM and JPA: Gained proficiency in mapping objects to relational databases, writing efficient queries, and managing transactions.
Strengthened database design skills: Improved ability to design and implement relational database schemas for specific application requirements.
Enhanced service layer development: Learned to encapsulate business logic and create maintainable and testable code.
Mastery of unit testing techniques: Developed skills in writing effective unit tests to ensure code quality and prevent regressions.
This project served as a valuable learning experience, reinforcing my backend development skills and providing a solid foundation for building more complex and feature-rich applications in the future.
Current Release
The system will be used to track and manage inventory for a small to medium-sized business. The initial focus is on the Model, Service, and Database layers, with data ingestion from the Controller layer simulated using simple data structures.
Focus
Backend service, model, and data layers
DB design
SQL DDL/DML
JPA implementation
Data processing
Functional Requirements
Add new products:
Product Name (required, string)
SKU (Stock Keeping Unit - required, string, unique)
Quantity in stock (required, integer)
Unit price (required, decimal)
Category (required, string, from a predefined list)
Supplier (required, string, from a predefined list)
Update existing products:
Allow updating all product attributes.
Delete products
Search products
By name or SKU.
View product details
Inventory Tracking
Track stock levels
Accurately track the quantity of each product.
Update stock levels
Manually or through simulated order processing.
Low stock alerts
Generate alerts when stock falls below a threshold.
Supplier Management
Add new suppliers
Supplier Name (required, string)
Update existing suppliers
Delete suppliers
Category Management
Add new categories
Category Name (required, string)
Update existing categories
Delete categories
Reporting
Inventory reports
Current stock levels and low stock items.
Non-Functional Requirements
Database: Relational database (e.g., PostgreSQL, MySQL).
Data Access: Hibernate as the JPA implementation.
Data Integrity: Ensure data integrity through database design and constraints.
Efficiency: Efficient data processing and retrieval.
Technical Requirements
Java:
SQL: (DDL and DML)
Hibernate: For ORM.
Testing: Unit tests.