Lombok - access to getter not visible

Viewed 661

I used lombok annotation '@Data' in my entity. I was trying to use getter by Dto Converter in the same way like I would do it normally without lombok. Somehow it doesn't work as I expected. It looks like my lombok didn't create getters or I don't have access there?

@Entity
@Table(name = "product")
@Data
public class Product {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    private Long id;

    @Column(name = "name")
    private String name;

Dto Converter:

public class ProductEntityToProductDetailsDtoConverterImpl {

    @Override
    public ProductDetailsDto convert(Product product) {
        return new ProductDetailsDto(
                product.getId(),
                product.getName()
        );
    }
}
1 Answers
Related