我有JPA实体
@Entity
@Table(name = "PEOPLES_TABLE")
public class peoplesTable {
@Id
@Column(name = "ID", nullable = false, length = 36)
private String id;
@Column(name = "Name", nullable = false, length = 255)
private String name;
@Column(name = "Soname", nullable = false, length = 255)
private String soname;
}
我上课了
*public class Table {
private String name;
private List<Column> columns;
public Table(String name, List<Column> columns){
this.name = name;
this.columns = columns;
}
}*
我也有班级专栏。
public class Column {
private String name;
private String type;
private String length;
private String defaultValue;
private String nullable;
private String constraint;
private String commentOnColumn;
public Columnn(){
<-Constructor->
}
}
告诉我将实体映射到对象表的最佳方法。我尝试用javaParser来做,但这是一个惨败=(