Skip to content

Latest commit

 

History

History
42 lines (37 loc) · 873 Bytes

File metadata and controls

42 lines (37 loc) · 873 Bytes

DTO Field Mapping Configuration 🗺️

@Mapping Attribute

Define fields to be ignored

@HyperResource(
    mapping = @Mapping(
        ignore = {"internalId"},
        ignoreNested = {"orders.checkout"} // Deep path exclusion
    )
)
public class Product {
    //...
}

Generated output

public abstract class ProductMapper extends AbstractMapper<ProductDTO, Product> {
    @Mapping(
            target = "internalId",
            ignore = true
    )
    @Mapping(
            target = "orders.checkout.orders",
            ignore = true
    )
    public abstract Product toEntity(ProductDTO dto);
    
    @Mapping(
            target = "internalId",
            ignore = true
    )
    @Mapping(
            target = "orders.checkout.orders",
            ignore = true
    )
    public abstract ProductDTO toDto(Product entity);
}