我如何从数据库中获取特定字段
将Employee数据库作为-:
public class Employee{
private String employeeId;
private String employeeSalary;
private Adress address;
//and so on
}
让我们假设地址pojo中的字段为-:
private EmployeeAddress employeeAddress;
现在让我们假设EmployeeAddress具有以下字段:
private HomeAddress homeAddress;
private OfficeAddress officeAddress;
现在让我们假设家庭住址pojo为
private String addressLine1;
private String addressLine2;
//and so on
现在,如果我只想住家地址,同时办公室地址应该为空或完全不显示...
如果您需要更多有关此信息,请留下您的评论。