1
我有對象員工這個POJO的包括到龍目島的ToString場從另一個對象
//@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;
}
我怎麼能只打印ID? 我不想打印整個對象員工,只有一個字段。
謝謝