当Java Hibernate自动创建表时,我想将255增加到1000,但是该怎么做呢?
可能需要对其进行更改的部分代码:
@Entity
public class Work implements Serializable {
@Id
@GeneratedValue
private long workNumber;
private int fromYear;
private int tillYear;
private String name;
private String profession;
private String description;
@ManyToOne
private User user;
public Work() {
}
public Work(long workNumber, int fromYear, int tillYear, String name, String profession, String description) {
this.setWorkNumber(workNumber);
this.setFromYear(fromYear);
this.setTillYear(tillYear);
this.setName(name);
this.setProfession(profession);
this.setDescription(description);
}
为什么不尝试简单
@Column(columnDefinition="varchar(1000)")
?
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句