include into Lombok ToString field from another object
问题 I have this POJOs //@ToString(of = { "id", "name", "employee.id - not working" }) @ToString(of = { "id", "name", "employee - working" }) public class Company { private int id; private String name; @OneToMany(mappedBy="company") private Set<Employee> employee; } public class Employee{ private int id; private String name; @ManyToOne private Company company; } how can I print just id from object employee ? I do not want to print whole object employee , just one field. Thank you 回答1: You have