greetings to all, in an example of a course we have used an entity and its corresponding entity that acts as a DTO that is called entidadRest but that annotates it with @json, what advantage does this approach have when performing DTOS, I am developing a mini project and I am using DTOS to use them with MapStruct but the fact is that when I generate the conversion, even though it generates and compiles them, it does not show me the settters
@Override
public Price dtoToModel(PriceDTO pricesDTO) {
if ( pricesDTO == null ) {
return null;
}
Price.PriceBuilder price = Price.builder();
price.priceId( pricesDTO.getPrice_Id() );
price.productId( pricesDTO.getProduct_Id() );
price.brandId( pricesDTO.getBrand_Id() );
price.starDate( pricesDTO.getStarDate() );
price.endDate( pricesDTO.getEndDate() );
price.priority( pricesDTO.getPriority() );
price.price( pricesDTO.getPrice_dto() );
if ( pricesDTO.getCurr() != null ) {
price.curr( String.valueOf( pricesDTO.getCurr() ) );
}
price.price_List( priceDTOSetToPriceSet( pricesDTO.getPriceList_dto() ) );
price.produc( pricesDTO.getProduc() );
return price.build();
}
the form correct for that's price.SetPriceId( pricesDTO.getPrice_Id() );