find()
List list = session.find(
"from RiskEvaluation where inherentRisk=? and residualRisk=?",
new Object[]{inherent.getLevel(),residual.getLevel()},
new Type[]{Hibernate.STRING,Hibernate.STRING});
createQuery()
List list = session.createQuery(
"from RiskEvaluation where inherentRisk = ? and residualRisk = ?")
.setString(0,inherent.getLevel())
.setString(1,residual.getLevel())
.list();
createCriteria()
Criteria criteria = session.createCriteria(RiskEvaluation.class);
criteria.add( Restrictions.eq("inherentRisk", inherent.getLevel()) );
criteria.add( Restrictions.eq("residualRisk", residual.getLevel()) );
List list = criteria.list();
No comments:
Post a Comment