Package com.example.springrest.mappers


package com.example.springrest.mappers
Provides MapStruct-based mappers for converting between domain entities and Data Transfer Objects (DTOs).

Each mapper defines methods to:

  • Convert incoming ProductRequest DTOs into Product entities.
  • Convert Product entities into outgoing ProductResponse DTOs.
  • Update existing entities selectively (ignoring null values).

By using MapStruct, boilerplate field mapping code is generated at compile time, ensuring type safety, readability, and performance.

All mappers are registered as Spring beans by specifying componentModel = "spring" in their @Mapper annotation, allowing them to be injected into services and controllers.

  • Interfaces
    Class
    Description
    Maps between API-layer DTOs and the Product JPA entity.