【发布时间】:2017-04-17 07:05:57
【问题描述】:
POJO类的优点是什么?我已经通过休眠框架中的 POJO 类术语,我很困惑使用 pojo 类有什么好处,如果我不使用它会遇到什么问题。
public class Person {
//variables
People people = new People();
private int id;
private String name;
private String address;
private int salary;
public int getId() {
return id;
}
public String getName() {
return name;
}
public String getAddress() {
return address;
}
public int getSalary() {
return salary;
}
public void setId() {
this.id = id;
}
public void setName() {
this.name = name;
}
public void setAddress() {
this.address = address;
}
public void setSalary() {
this.salary = salary;
}
}
请帮助我理解这个概念。谢谢。
【问题讨论】:
-
这个forums 会帮助你
-
如果没有 POJO,您将如何获取和设置数据?
-
@Akshay 只有这个优势吗?
标签: java spring hibernate jakarta-ee