hibernate查询时Criteria怎么根据级联的两个类里的属性进行查询
展开全部
@Autowired
@Qualifier("sessionFactory")
protected SessionFactory sessionFactory;
protected Session getSession() {
return sessionFactory.getCurrentSession();
}
@Override
public Criteria getExecutableCriteria(){
DetachedCriteria dc = DetachedCriteria .forClass(this.entityClass);
return dc.getExecutableCriteria(getSession());
}
@Qualifier("sessionFactory")
protected SessionFactory sessionFactory;
protected Session getSession() {
return sessionFactory.getCurrentSession();
}
@Override
public Criteria getExecutableCriteria(){
DetachedCriteria dc = DetachedCriteria .forClass(this.entityClass);
return dc.getExecutableCriteria(getSession());
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询