我使用SQL表的数量庞大的Web应用程序的工作。 我需要为每个表的Java bean类。 我在寻找一个工具,可以SQL表转换为Java bean类。 这将有助于节省时间。
下面是一个例子:
studentTable(studentId,名字,姓氏,yearLevel)
-->
public class Student {
@Id
@Column
@GeneratedValue(strategy=GenerationType.AUTO)
private int studentId;
@Column
private String firstname;
@Column
private String lastname;
@Column
private int yearLevel;
public Student(){}
public Student(int studentId, String firstname, String lastname,
int yearLevel) {
super();
this.studentId = studentId;
this.firstname = firstname;
this.lastname = lastname;
this.yearLevel = yearLevel;
}
public int getStudentId() {
return studentId;
}
public void setStudentId(int studentId) {
this.studentId = studentId;
}
public String getFirstname() {
return firstname;
}
public void setFirstname(String firstname) {
this.firstname = firstname;
}
public String getLastname() {
return lastname;
}
public void setLastname(String lastname) {
this.lastname = lastname;
}
public int getYearLevel() {
return yearLevel;
}
public void setYearLevel(int yearLevel) {
this.yearLevel = yearLevel;
}
}
你有关于这些工具的任何想法。