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 intoProduct
entities. - Convert
Product
entities into outgoingProductResponse
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