📄 countrytest.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 + -