@Test public void testGetCustomUITemplateByCrisisIDAndAttributeID() { entityManager.getTransaction().begin(); List<CustomUiTemplateDTO> result = customUiTemplateResourceFacadeImp.getCustomUITemplateByCrisisIDAndAttributeID(crisis.getCrisisID(), nominalAttribute.getNominalAttributeId()); entityManager.getTransaction().commit(); assertTrue(result.size()>=1); }
@Override public List<CustomUiTemplateDTO> getCustomUITemplateByCrisisIDAndAttributeID(long crisisID, long attributeID) { Criterion criterion = Restrictions.conjunction() .add(Restrictions.eq("crisisID",crisisID)) .add(Restrictions.eq("nominalAttributeID", attributeID)); List<CustomUiTemplateDTO> dtoList = null; try { List<CustomUiTemplate> customUITemplates = this.getAllByCriteria(criterion); if (customUITemplates != null) { dtoList = new ArrayList<CustomUiTemplateDTO>(0); for (CustomUiTemplate c: customUITemplates) { CustomUiTemplateDTO dto = new CustomUiTemplateDTO(c); dtoList.add(dto); } } return dtoList; } catch (Exception e) { logger.error("Error in getCustomUITemplateByCrisisIDAndAttributeID " + "crisisID : " + crisisID + " and attributeID : " + attributeID); return null; } }
CustomUiTemplateResourceFacadeImp extends CoreDBServiceFacadeImp<CustomUiTemplate, Long> implements CustomUiTemplateResourceFacade { @Override public List<CustomUiTemplateDTO> getCustomUITemplateByCrisisIDAndAttributeID(long crisisID, long attributeID) { Criterion criterion = Restrictions.conjunction() .add(Restrictions.eq("crisisID",crisisID)) .add(Restrictions.eq("nominalAttributeID", attributeID)); List<CustomUiTemplateDTO> dtoList = null; try { List<CustomUiTemplate> customUITemplates = this.getAllByCriteria(criterion); if (customUITemplates != null) { dtoList = new ArrayList<CustomUiTemplateDTO>(0); for (CustomUiTemplate c: customUITemplates) { CustomUiTemplateDTO dto = new CustomUiTemplateDTO(c); dtoList.add(dto); } } return dtoList; } catch (Exception e) { logger.error("Error in getCustomUITemplateByCrisisIDAndAttributeID " + "crisisID : " + crisisID + " and attributeID : " + attributeID); return null; } } }
CustomUiTemplateResourceFacadeImp extends CoreDBServiceFacadeImp<CustomUiTemplate, Long> implements CustomUiTemplateResourceFacade { @Override public List<CustomUiTemplateDTO> getCustomUITemplateByCrisisIDAndAttributeID(long crisisID, long attributeID) { Criterion criterion = Restrictions.conjunction() .add(Restrictions.eq("crisisID",crisisID)) .add(Restrictions.eq("nominalAttributeID", attributeID)); List<CustomUiTemplateDTO> dtoList = null; try { List<CustomUiTemplate> customUITemplates = this.getAllByCriteria(criterion); if (customUITemplates != null) { dtoList = new ArrayList<CustomUiTemplateDTO>(0); for (CustomUiTemplate c: customUITemplates) { CustomUiTemplateDTO dto = new CustomUiTemplateDTO(c); dtoList.add(dto); } } return dtoList; } catch (Exception e) { logger.error("Error in getCustomUITemplateByCrisisIDAndAttributeID " + "crisisID : " + crisisID + " and attributeID : " + attributeID); return null; } } protected  CustomUiTemplateResourceFacadeImp(); }
CustomUiTemplateResourceFacadeImp extends CoreDBServiceFacadeImp<CustomUiTemplate, Long> implements CustomUiTemplateResourceFacade { @Override public List<CustomUiTemplateDTO> getCustomUITemplateByCrisisIDAndAttributeID(long crisisID, long attributeID) { Criterion criterion = Restrictions.conjunction() .add(Restrictions.eq("crisisID",crisisID)) .add(Restrictions.eq("nominalAttributeID", attributeID)); List<CustomUiTemplateDTO> dtoList = null; try { List<CustomUiTemplate> customUITemplates = this.getAllByCriteria(criterion); if (customUITemplates != null) { dtoList = new ArrayList<CustomUiTemplateDTO>(0); for (CustomUiTemplate c: customUITemplates) { CustomUiTemplateDTO dto = new CustomUiTemplateDTO(c); dtoList.add(dto); } } return dtoList; } catch (Exception e) { logger.error("Error in getCustomUITemplateByCrisisIDAndAttributeID " + "crisisID : " + crisisID + " and attributeID : " + attributeID); return null; } } protected  CustomUiTemplateResourceFacadeImp(); @Override List<CustomUiTemplateDTO> getAllCustomUITemplateByCrisisID(long crisisID); @Override List<CustomUiTemplateDTO> getCustomUITemplateBasedOnTypeByCrisisID(long crisisID, int templateType); @Override List<CustomUiTemplateDTO> getCustomUITemplateBasedOnTypeByCrisisIDAndAttributeID(long crisisID, long attributeID, int templateType); @Override List<CustomUiTemplateDTO> getCustomUITemplateBasedOnTypeByCrisisIDAttributeIDAndStatus(long crisisID, long attributeID, int templateType, int status); @Override List<CustomUiTemplateDTO> getCustomUITemplateByCrisisIDAndAttributeID(long crisisID, long attributeID); @Override CustomUiTemplateDTO addCustomUITemplate(CustomUiTemplateDTO customUITemplate); @Override CustomUiTemplateDTO updateCustomUITemplate(CustomUiTemplateDTO currentTemplate, CustomUiTemplateDTO updatedTemplate); @Override CustomUiTemplateDTO updateCustomUITemplateStatus(CustomUiTemplateDTO currentTemplate, CustomUiTemplateDTO updatedTemplate); @Override void deleteCustomUITemplateBasedOnTypeByCrisisID(long crisisID, int type); @Override void deleteCustomUITemplateByCrisisID(long crisisID); int deleteCustomUiTemplateById(long customUiTemplateId); CustomUiTemplateDTO getCustomUITemplateByID(long customUiTemplateId); }
CustomUiTemplateResourceFacadeImp extends CoreDBServiceFacadeImp<CustomUiTemplate, Long> implements CustomUiTemplateResourceFacade { @Override public List<CustomUiTemplateDTO> getCustomUITemplateByCrisisIDAndAttributeID(long crisisID, long attributeID) { Criterion criterion = Restrictions.conjunction() .add(Restrictions.eq("crisisID",crisisID)) .add(Restrictions.eq("nominalAttributeID", attributeID)); List<CustomUiTemplateDTO> dtoList = null; try { List<CustomUiTemplate> customUITemplates = this.getAllByCriteria(criterion); if (customUITemplates != null) { dtoList = new ArrayList<CustomUiTemplateDTO>(0); for (CustomUiTemplate c: customUITemplates) { CustomUiTemplateDTO dto = new CustomUiTemplateDTO(c); dtoList.add(dto); } } return dtoList; } catch (Exception e) { logger.error("Error in getCustomUITemplateByCrisisIDAndAttributeID " + "crisisID : " + crisisID + " and attributeID : " + attributeID); return null; } } protected  CustomUiTemplateResourceFacadeImp(); @Override List<CustomUiTemplateDTO> getAllCustomUITemplateByCrisisID(long crisisID); @Override List<CustomUiTemplateDTO> getCustomUITemplateBasedOnTypeByCrisisID(long crisisID, int templateType); @Override List<CustomUiTemplateDTO> getCustomUITemplateBasedOnTypeByCrisisIDAndAttributeID(long crisisID, long attributeID, int templateType); @Override List<CustomUiTemplateDTO> getCustomUITemplateBasedOnTypeByCrisisIDAttributeIDAndStatus(long crisisID, long attributeID, int templateType, int status); @Override List<CustomUiTemplateDTO> getCustomUITemplateByCrisisIDAndAttributeID(long crisisID, long attributeID); @Override CustomUiTemplateDTO addCustomUITemplate(CustomUiTemplateDTO customUITemplate); @Override CustomUiTemplateDTO updateCustomUITemplate(CustomUiTemplateDTO currentTemplate, CustomUiTemplateDTO updatedTemplate); @Override CustomUiTemplateDTO updateCustomUITemplateStatus(CustomUiTemplateDTO currentTemplate, CustomUiTemplateDTO updatedTemplate); @Override void deleteCustomUITemplateBasedOnTypeByCrisisID(long crisisID, int type); @Override void deleteCustomUITemplateByCrisisID(long crisisID); int deleteCustomUiTemplateById(long customUiTemplateId); CustomUiTemplateDTO getCustomUITemplateByID(long customUiTemplateId);  }