⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 abstractormappingtests.java

📁 一个hibernate的自动测试框架源码
💻 JAVA
字号:
package net.chrisrichardson.ormunit.hibernate;

import java.util.Set;


/**
 * Implements behavior common to both HibernateMappingTests (old version) and HibernateORMappingTests
 * @author cer
 *
 */
public abstract class AbstractORMappingTests extends HibernateORMTestCase {

	protected HibernateMappingChecker mappingChecker;
	protected MappedClassChecker classChecker;


	protected void onSetUp() throws Exception {
		super.onSetUp();
		this.mappingChecker = new HibernateMappingChecker(getConfiguration());
	}

	/**
	 * Specifies whether to use field mapping or property mapping
	 * @param accessStrategy
	 */
	protected void setAccessStrategy(AccessStrategy accessStrategy) {
		mappingChecker.setAccessStrategy(accessStrategy);
	}

	/**
	 * Verify that the class is mapped to the specified table
	 * 
	 * @param type
	 * @param tableName
	 */
	protected void assertClassMapping(Class type, String tableName) {
		HibernateMappingChecker r = this.mappingChecker;
		classChecker = r.getClassChecker(type);
		classChecker.assertClassMapping(type, tableName);
	}

	/**
	 * Verify that all classes and their fields/properties are mapped
	 */
	protected void assertAllClassesMapped() {
		mappingChecker.assertAllClassesMapped();
	}

	/**
	 * Verify that all classes and properties/properties are mapped except the specified fields/properties
	 * @param unmappedProperties
	 */
	protected void assertAllClassesMapped(Set<String> unmappedProperties) {
		mappingChecker.assertAllClassesMapped(unmappedProperties);
	}

}

⌨️ 快捷键说明

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