How do I make my pojo classes as components, so that I can autowire wherever I want? What will be the steps to do? Is this the right way for a spring boot application?
In my application iam using lombok for getters and setters. Here is my pojo:
@Accessors(chain = true)
@NoArgsConstructor
@Getter
@Setter
@ToString
@JsonIgnoreProperties(ignoreUnknown = true)
@SuppressWarnings("all")
public class Qei implements Serializable {
private static final long serialVersionUID = 2902444063726917000L;
private Integer qeiMasterId;
private String qeiId;
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = NMTCConstants.DATEFORMAT)
private Date originalDate;
private BigDecimal amount;
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = NMTCConstants.DATEFORMAT)
private Date complianceEndDate;
private BigDecimal perAllocAgreementPercent;
private BigDecimal minRequiredPercent;
private Integer allocationYear;
private DealDetail dealDetail;// other class
private List<Qlici> qliciInfo;//other class
}
In order to use this class, can it be spring component?