Domain Model & Data Layer
The Domain Model Layer represents the core business entities and their relationships. These JPA entities map directly to database tables and form the foundation of the application’s data persistence.
Location:
src/main/java/com/smartsupplypro/inventory/model/
Responsibility: Entity definitions, relationships, constraints, audit tracking, enumeration types
Quick Navigation
By Topic
- Supplier Entity - Inventory goods providers
- Inventory Item Entity - Products/items in inventory
- Stock History Entity - Immutable audit trail
- App User Entity - OAuth2 users and authentication
- Enumerations - Role and StockChangeReason types
- Entity Relationships - Supplier → Item → StockHistory, User relationships
- JPA Annotations - @Entity, @Column, @ManyToOne, @Version, etc.
- Design Patterns - Audit fields, optimistic locking, denormalization
- Data Integrity - Primary keys, unique constraints, foreign keys
- Model Lifecycle - Transient → Managed → Persistent states
- Best Practices - Lombok, fetch strategies, immutability
By Role
- Database Designers → Start with Entity Relationships
- ORM Developers → Review JPA Annotations
- Backend Developers → Check Supplier Entity and Inventory Item Entity
- Data Architects → Review Data Integrity and Design Patterns
- New Team Members → Begin with Best Practices
Core Entities Overview
- Supplier - Inventory goods providers with contact information
- InventoryItem - Individual products/items with stock tracking
- StockHistory - Immutable audit trail of all stock movements
- AppUser - OAuth2 user principals with roles