public List findKnowledgeExpertArticleForSearch(
String keyName, Object value,final int start,final int limit) {
//
log.debug("search knowledgeExpertArticle by :"+value);
try{
final String hql = "form KnowledgeExpertArticle as model where model.'"+keyName+"' like '%"+value+"%' order by model.expertArticleId DESC";
log.info(hql);
List resultList = getHibernateTemplate().executeFind(
new HibernateCallback() {
public Object doInHibernate(Session arg0)
throws HibernateException, SQLException {
Query query = arg0.createQuery(hql);
query.setFirstResult(start);
query.setMaxResults(limit);
return query.list();
}
});
return resultList;
}catch(RuntimeException re){
throw re;
}
}