public List getDefectVaritiesByTypeAndConstruction(final String defectTypeId,final String constructionTypeId){
return super.getSession().createQuery("from DefectVarity defectVarity where defectVarity.varityId in (select varities.varityId from DefectType defectType join defectType.varities as varities join varities.constructionTypes as constructionTypes where defectType.defectTypeId=? AND constructionTypes.constructionTypeId=?)").setString(0,defectTypeId).setString(1,constructionTypeId).list();
}
public List getDefectVaritiesByType(final String defectTypeId) {
DefectType defectType = (DefectType) getHibernateTemplate().get(DefectType.class, new Integer(defectTypeId));
// evict(defectType);
// List varityList=defectType.getVarities();
// List resultList=new ArrayList();
// for (int i = 0; i < varityList.size(); i++) {
// DefectVarity defectVarity = (DefectVarity)varityList.get(i);
// evict(defectVarity);
// resultList.add(defectVarity);
// }
// return resultList;
System.out.println(defectType);
return defectType.getVarities();
}