1.在hibernate.cfg.xml配置中,有
<property name="hbm2ddl.auto">update</property>这一句,就是在数据库中没有对应的表时,系统自动生成表格。
2.本节将利用程序进行控制hibernate生成新表。
new SchemaExport(new AnnotationConfiguration().configure()).creart(true,true);
1.在hibernate.cfg.xml配置中,有
<property name="hbm2ddl.auto">update</property>这一句,就是在数据库中没有对应的表时,系统自动生成表格。
2.本节将利用程序进行控制hibernate生成新表。
new SchemaExport(new AnnotationConfiguration().configure()).creart(true,true);