<分区>
这是我注释为实体的 pojo
@Entity
@Table(name = "book", catalog = "book_db")
public class Book {
private Integer bookId;
private String bookName;
private String bookShortDesc;
private String bookDesc;
private String bookAuthor;
}
@Id
@GeneratedValue(strategy = IDENTITY)
@Column(name = "book_id", unique = true, nullable = false)
public Integer getBookId() {
return this.bookId;
}
@Column(name = "book_name", nullable = false, length = 256)
public String getBookName() {
return this.bookName;
}
@Column(name = "book_short_desc", nullable = false, length = 1024)
public String getBookShortDesc() {
return this.bookShortDesc;
}
等等……
上面的实体是使用注释创建的,当我查看 mysql 数据库时,列不是按顺序创建的,我在下面写了,相反,第一列是 book_id,然后是 book_desc,然后是 book_athor,然后是 book_short_desc 然后书名。
我的问题是如何告诉 Hibernate 按照我在 Java 代码中编写的相同顺序创建列??
有注释吗??
问候