commondaotest.java

来自「工厂版本管理系统,STRUTS2框架,用于管理商品的版本,便于有效的控制版本」· Java 代码 · 共 47 行

JAVA
47
字号
package com.utstar.fcs.dao;

import java.util.List;

import junit.framework.TestCase;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.bluesky.common.dao.ICommonDao;
import com.bluesky.util.ApplicationContextUtil;

public class CommonDaoTest extends TestCase {
	private Log log = LogFactory.getLog(this.getClass());

	
	private ICommonDao commonDao;

	public void setUp() {
		commonDao = (ICommonDao) ApplicationContextUtil.getFactory().getBean(
		"commonDao");
	}

	/*
	 * one test to test all the domain objects and their ORM configuration
	 */
	public void testAll() {
		
		String[] objects = new String[] {
				"Field",
				"FieldDefinition",
				"FieldType",
				"Station",
				"StationType",
				"StationVersion",
				"WorkInstruction",
				"WorkInstructionVersion"
				};
	
		for(int i=0;i<objects.length;i++){
			String hql = String.format("from %s where 1=2", objects[i]);
			List list = commonDao.getHibTemplate().find(hql);
		}		
	}

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?