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
ProductRequestDTOs intoProductentities. - Convert
Productentities into outgoingProductResponseDTOs. - Update existing entities selectively (ignoring
nullvalues).
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