Chocolate Factory Inventory System
Description: You are tasked with creating a Java application for managing the inventory of a chocolate factory. The application should utilize inheritance and SQL to model and store information about different types of chocolate products.
Requirements:
-
Create a base
Chocolate
class with the following properties:id
(Long)name
(String)price
(BigDecimal)weight
(double)
-
Implement a simple DataLoader that allows users to interact with the chocolate factory inventory system. The should provide options for:
- Adding a new chocolate product
- Retrieving a chocolate product by ID
- Retrieving all chocolate products
- Updating a chocolate product
- Deleting a chocolate product
-
Write unit tests for the
ChocolateRepository
class to demonstrate how to use the operations to create, update, delete and find of a chocolate..