出的错误是:java.lang.IllegalArgumentException: argument type mismatch
hibernet的问题 出的错误是:java.lang.IllegalArgumentException: argument type mismatch at org.yh.dlogic.FindCountDlogic.findCountByID(FindCountDlogic.java:39) 这个类FindCountDlogic的代码是
Java code
package org.yh.dlogic;
import java.util.ArrayList;
import java.util.List;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.cfg.Configuration;
public class FindCountDlogic {
/**
* session定义
*/
private Session session =null;
/**
* 构造函数
*/
public FindCountDlogic() {
this.session =new Configuration().configure().
buildSessionFactory().openSession();
}
public List findCountByID (String countId) {
List countList = new ArrayList();
StringBuffer sb = new StringBuffer("from Count");
if (countId !=null && !"".equals(countId)) {
sb.append(" where countid = "+countId);
}
String sql = sb.toString();
Query query = this.session.createQuery(sql);
[color=#FF0000]countList = query.list();[/color]
return countList;
}
}