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

📄 countrytest.java

📁 一个自娱自乐的demo 开发环境 apache-tomcat-6.0.16 Mysql 5.1.11 Jdk 1.6 文件结构如下 --MyGame -----MyGam
💻 JAVA
字号:
package com.hb.base.test.dao.common;

import com.hb.base.dao.common.CountryDao;
import com.hb.base.domain.common.Country;
import com.hb.core.test.dao.HibernateDaoTestCase;

/**
 * 2007-11-3
 * 
 * @author 何 貝
 */
public class CountryTest extends HibernateDaoTestCase {

	private CountryDao countryDao;

	public void testInsertCountry() {
		Country country = null;
		String[] cNameList = new String[] { "中国", "日本", "韩国" };
		for (int i = 0; i < cNameList.length; i++) {
			country = new Country();
			country.setCountryID(getMaxID(i));
			country.setName(cNameList[i]);
			countryDao.save(country);
		}
	}

	// public void testGetCountry() {
	// for (int i = 1; i < 3; i++) {
	// System.out.println( countryDao.get(new Integer(i)));
	// Country country = countryDao.get(i);
	// System.out.println(country == null);

	// Set<Person> pSet = country.getPersonSet();
	// for (Person person : pSet) {
	// System.out.println(person);
	//
	// Set<Address> addresses = person.getAddresses();
	// for (Address address : addresses) {
	// System.out.println(address);
	// }
	// }
	// }
	// }

	// public void testDelCountry() {
	// for (int i = 1; i < 3; i++) {
	// Country country = countryDao.get(i);
	// countryDao.delete(country);
	// }
	// }

	public CountryDao getCountryDao() {
		return countryDao;
	}

	public void setCountryDao(CountryDao countryDao) {
		this.countryDao = countryDao;
	}

}

⌨️ 快捷键说明

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