hibernate自动生成的DAO里怎么写根据两个外键查找的方法
POJO CpInfo里有 private PpInfo ppInfo;
private FlInfo flInfo;
hibernate自动生成的DAO里有
public List findByProperty(String propertyName, Object value) {
log.debug("finding CpInfo instance with property: " + propertyName
+ ", value: " + value);
try {
String queryString = "from CpInfo as model where model."
+ propertyName + "= ?";
return getHibernateTemplate().find(queryString, value);
} catch (RuntimeException re) {
log.error("find by property name failed", re);
throw re;
}
}
这个方法可以根据一个外键查找。
但我要用ppInfo,flInfo两个外键查找,怎么写?
[b]问题补充:[/b]
查询CpInfo里其他的属性撒。
写个详细点的,我HQL 稀烂、