I've been trying to solve it for a while but I couldn't find anything to help me, in my Spring Boot Project, in one of the assembler classes I extend "RepresentationModelAssemblerSupport", when I extend the class I start to have a conflict with my Lombok @AllArgsContructor, I use it to not use @Autowired keeping the code clean, so I can't compile, and I get the following Warning in the annotation "Lombok needs a default constructor in the base class", but I already have a constructor in the Class
After a lot of research, I saw that in some cases other annotations like @NoArgsConstructor and @RequiredArgsConstructor helped but I was not successful.
@Component@AllArgsConstructorpublic class SaleModelAssembler extends RepresentationModelAssemblerSupport<Sale, SaleModel> { @Autowired private ModelMapper modelMapper;enter image description here public SaleModelAssembler() { super(SaleResource.class, SaleModel.class); } @Override public SaleModel toModel(Sale sale) { SaleModel saleModel = createModelWithId(sale.getCode(), sale); modelMapper.map(sale, saleModel); saleModel.getItems().forEach(saleItemModel -> { saleItemModel.getProduct().add(linkTo(ProductResource.class) .slash(saleItemModel.getProduct().getId()).withSelfRel()); }); return saleModel; } @Override public CollectionModel<SaleModel> toCollectionModel(Iterable<? extends Sale> entities) { return super.toCollectionModel(entities).add(linkTo(SaleResource.class).withSelfRel()); }}