Implements the GET endpoint for fetching all products, adhering to the specified requirements and performance standards.
Model Creation: Adds the Product model class with fields for ID, name, description, and price, including Hibernate validation annotations to ensure data integrity.
Repository Setup: Introduces the ProductRepository interface extending JpaRepository, facilitating database operations for the Product entity.
Service Layer: Establishes the ProductService class to handle business logic, specifically to retrieve all products from the database.
Controller Implementation: Implements the ProductController class with a GET endpoint /api/products to fetch and return all products.
Database Initialization: Adds a data.sql file containing initial data for the Product table, ensuring the application has predefined products to display upon startup.
Related to #3
Implements the GET endpoint for fetching all products, adhering to the specified requirements and performance standards.
Product
model class with fields for ID, name, description, and price, including Hibernate validation annotations to ensure data integrity.ProductRepository
interface extendingJpaRepository
, facilitating database operations for theProduct
entity.ProductService
class to handle business logic, specifically to retrieve all products from the database.ProductController
class with a GET endpoint/api/products
to fetch and return all products.data.sql
file containing initial data for theProduct
table, ensuring the application has predefined products to display upon startup.For more details, open the Copilot Workspace session.