📄 erptest.java
字号:
package junit.test;
import org.hibernate.cfg.Configuration;
import org.hibernate.tool.hbm2ddl.SchemaExport;
import org.junit.BeforeClass;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import cn.hyq.erp.service.ProductService;
public class ErpTest {
private static ApplicationContext ctx = null;
private static ProductService productService;
@BeforeClass
public static void setUpBeforeClass() throws Exception {
// System.out.println("ddd");
// ctx = new ClassPathXmlApplicationContext("beans.xml");
// System.out.println(ctx);
// productService = (ProductService) ctx.getBean("productService");
}
@Test
public void testDao() {
// Product product = new Product();
// product.setProductName("1111");
// product.setProductUsage("2222");
// productService.addProduct(product);
Configuration cfg = new Configuration().configure();
// cfg.buildSessionFactory();
System.out.println(cfg);
SchemaExport schemaExport = new SchemaExport(cfg);
schemaExport.create(true, true);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -