📄 daoadpater.java
字号:
package com.xfaccp.adapter;
import java.util.List;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import com.xfaccp.base.BaseForm;
import com.xfaccp.interf.IDAO;
public abstract class DAOAdpater extends HibernateDaoSupport implements IDAO {
/*
* (non-Javadoc)
* @实现IDAO接口中的方法的适配器类
* 可以部分实现或是全部实现
* 这样该适配器类就可以充当处理业务逻辑块与底层
* 基本DAO的纽带!根据实际情况实际相应适配
*/
public void create(BaseForm form) throws Exception
{
getHibernateTemplate().save(form);
}
public void delete(BaseForm form) throws Exception
{
getHibernateTemplate().delete(form);
}
public List findAllList() throws Exception {
// 空实现...实际情况进行不同的实现
return null;
}
public List findByExample(BaseForm form) throws Exception
{
List list=getHibernateTemplate().findByExample(form);
return list;
}
public List findById(Integer id) throws Exception
{
return null;
}
public void load(BaseForm form) throws Exception
{
getHibernateTemplate().load(form,form.getId());
}
public void update(BaseForm form) throws Exception
{
getHibernateTemplate().update(form);
}
public List checkLogin(String useName, String password) throws Exception {
// TODO Auto-generated method stub
return null;
}
//根据特定的SQL语句进行动态的查找
public List findBySql(String hsql)throws Exception
{
List list=getHibernateTemplate().find(hsql);
return list;
}
public List findBySqlto(String hsql,Object obj[]) throws Exception
{
List list=getHibernateTemplate().find(hsql,obj);
return list;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -