erptest.java

来自「ERPERP ERP ERP ERP ERP ERP ERP ERP」· Java 代码 · 共 38 行

JAVA
38
字号
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 + =
减小字号Ctrl + -
显示快捷键?