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

📄 actlogdaotest.java

📁 新技术论坛系统 v1.0 前后台管理的初始用户名 : admin 密码 123456
💻 JAVA
字号:
package com.ntsky.bbs.dao;

import java.util.Collection;
import java.util.Date;

import org.springframework.dao.DataAccessException;

import com.ntsky.bbs.dao.hibernate.ActLogDAOHibernateImpl;
import com.ntsky.bbs.domain.ActLog;
import com.ntsky.bbs.domain.Stat;
import com.ntsky.bbs.util.page.Pagination;

/**
 * 操作日志模块数据处理接口
 * 
 * @author ntsky
 * @link www.ntsky.com
 */
public class ActlogDAOTest extends BaseDAOCase {

	private ActLogDAO actLogDAO = null;

	private ActLog actlog = null;

	public void setActLogDAO(ActLogDAO actLogDAO) {
		this.actLogDAO = actLogDAO;
	}

	protected void onSetUpInTransaction() throws Exception {
		super.onSetUpInTransaction();
		// super.onSetUpInTransaction();
		// this.setPopulateProtectedVariables(true);
		// actLogDAO = (ActLogDAO) this.applicationContext.getBean("actLogDAO");
	}

	public void onSetUpBeforeTransaction() {
		actlog = new ActLog();
		actlog.setName("add act log");
		actlog.setUsername("guest");
		actlog.setIp("127.0.0.1");
		actlog.setTime(new Date());
		/*
		 * person = new Person(); person.setFirstName("Sean");
		 * person.setLastName("Liu"); person.setUserName("forever");
		 */

		/*
		 * 联合查询 多表操作返回 List的场合 list().get(0)[0] list().get(0)[1]
		 * list().get(0)[2] list().get(0)[3]
		 * 
		 * select new XX('field1','field2')
		 */
	}

	public void testSaveActLog() {
		actLogDAO.save(actlog);
	}

	public void testFindActLog() {
		assertNull(actLogDAO.findActLog(100));
	}

	public void testFindActLogs() {
		actLogDAO.findActLogs("", new Pagination(0, 10));
	}

	public void testDeleteActLog(){
		actLogDAO.delete(actLogDAO.get(ActLog.class,new Long(1)));
	}
	
}

⌨️ 快捷键说明

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