📄 hibernatecommoninfodao.java
字号:
package cn.myapps.core.commoninfo.dao;
import java.util.Collection;
import cn.myapps.base.action.ParamsTable;
import cn.myapps.base.dao.HibernateBaseDAO;
import cn.myapps.core.commoninfo.ejb.CommonInfo;
public class HibernateCommonInfoDAO extends HibernateBaseDAO implements
CommonInfoDAO {
public HibernateCommonInfoDAO(String voClassName) {
super(voClassName);
}
public Collection queryType(String application) throws Exception {
String hql = "select distinct vo.type from " + this._voClazzName
+ " vo where applicationid='" + application + "'";
return getDatas(hql);
}
public Collection queryByType(String type, String application)
throws Exception {
String hql = "from " + _voClazzName + " vo where vo.type='" + type
+ "' and vo.applicationid = '"
+ application +"' order by vo.orderNo";
// ParamsTable params = new ParamsTable();
// params.setParameter("application", application);
// return getDatas(hql, params);
return getDatas(hql);
}
public CommonInfo findByTypeAndCode(String type, String code,
String application) throws Exception {
String hql = "From " + _voClazzName + " vo where vo.type='" + type
+ "' and vo.code='" + code + "' and vo.applicationid = '"
+ application + "' order by vo.orderNo";
return (CommonInfo) this.getData(hql);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -