?? hibernatedaotestcase.java
字號:
package com.hb.core.test.dao;
import java.text.SimpleDateFormat;
import java.util.Date;
import org.springframework.test.AbstractTransactionalSpringContextTests;
/**
* 2007-11-3
*
* @author 何 貝
*/
public class HibernateDaoTestCase extends AbstractTransactionalSpringContextTests {
public HibernateDaoTestCase() {
// 數據不回滾,提交到數據表中
setDefaultRollback(false);
}
protected String[] getConfigLocations() {
return new String[] { "classpath:/config/ApplicationContext.xml" };
}
protected String getMaxID(int id) {
if (id > -1) {
return String.format("%1$08d", Integer.valueOf(id) + 1);
}
return null;
}
protected String getCurrentDate() {
Date date = new Date();
return dateFormat(date);
}
protected String getMaxDate() {
return "99991231";
}
protected String dateFormat(Date date) {
SimpleDateFormat sm = new SimpleDateFormat("yyyyMMdd");
return sm.format(date);
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -