很简单的问题,为什么我的hibernate返回空值?
我的dao中是这样写的:
public List findByProperty(String propertyName, Object value) {
log.debug("finding ReptAgilityConfig instance with property: "
+ propertyName + ", value: " + value);
try {
String queryString = "from ReptAgilityConfig as model";
return getHibernateTemplate().find(queryString);
} catch (RuntimeException re) {
log.error("find by property name failed", re);
throw re;
}
}
返回的list是空的。
还有啊,我用myeclipse自动把数据库中的表映射成hibernate所需要的类,生成了2个,一个ReptAgilityConfig,里面只有一个id;另一个是ReptAgilityConfigId,里面对应了数据库表中的一些字段。在上面的dao中,propertyName填成表中的任意字段都会出错(因为它只有一个成员id),那么我该怎么用它呢?
高手来帮我啊,我只有这么多分了。