package hib.test;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.AnnotationConfiguration;
import org.hibernate.tool.hbm2ddl.SchemaExport;
import org.junit.Test;
public class HibernateORMappingTest {
private static SessionFactory sessionFactory;
public static void beforeClass() {
sessionFactory = new AnnotationConfiguration().configure()
.buildSessionFactory();
}
@Test
public void testScheamExport() {
new SchemaExport(new AnnotationConfiguration().configure()).create(
true, true);
}
}Hibernate自动生成数据库表
最新推荐文章于 2018-05-22 13:38:05 发布
本文介绍如何使用Hibernate框架进行对象关系映射(ORM)的测试,包括配置SessionFactory、创建数据库模式等关键步骤。
9093

被折叠的 条评论
为什么被折叠?



