我有7个实体,我将hibernate.hbm2ddl.auto设置为crate-drop。当我运行我的Web应用程序时,这句话会打印所有表格
create table table_name ....
。 所有表格将创建除一个。 这是我的评论实体,hibernate没有创建它的表。
@Entity(name = "comments")
@Table(name = "COMMENTS")
public class Comments implements Serializable{
@Id
@Column(name = "ID",columnDefinition = "NUMBER")
@SequenceGenerator(name = "COM_SEQ",sequenceName = "COM_SEQ",allocationSize = 1)
@GeneratedValue(strategy = GenerationType.AUTO,generator = "COM_SEQ")
private Long id;
@Column(name = "CONTENT",columnDefinition = "NCLOB")
private String content;
@Column(name = "date",columnDefinition = "NVARCHAR2(20)")
private String date;
@ManyToOne(cascade = CascadeType.ALL,fetch = FetchType.LAZY)
@JoinColumn(name = "USER_ID")
public Person person;
@ManyToOne(cascade = CascadeType.ALL,fetch = FetchType.LAZY)
@JoinColumn(name = "DOCTOR_ID")
public Doctor doctor;
我不明白为什么会这样?