@Test public void testDeleteModelFamily() { try { List<ModelFamilyDTO> modelFamilyDTOs = modelFamilyResourceFacadeImp.getAllModelFamiliesByCrisis(crisisDTO.getCrisisID()); assertNotNull(modelFamilyDTOs); entityManager.getTransaction().begin(); boolean success = modelFamilyResourceFacadeImp.deleteModelFamily(modelFamilyDTOs.get(0).getModelFamilyId()); entityManager.getTransaction().commit(); assertTrue(success); } catch (PropertyNotSetException e) { logger.error("PropertyNotSetException while executing testDeleteModelFamily "+e.getMessage()); } }
@Override public boolean deleteModelFamily(Long modelFamilyID) throws PropertyNotSetException { ModelFamily modelFamily = getEntityManager().find(ModelFamily.class, modelFamilyID); if (modelFamily != null) { try { getEntityManager().remove(modelFamily); } catch (HibernateException he) { logger.error("Hibernate exception on deleting ModelFamily using ID=" + modelFamilyID + he.getStackTrace()); return false; } return true; } else { return false; } }
ModelFamilyResourceFacadeImp extends CoreDBServiceFacadeImp<ModelFamily, Long> implements ModelFamilyResourceFacade { @Override public boolean deleteModelFamily(Long modelFamilyID) throws PropertyNotSetException { ModelFamily modelFamily = getEntityManager().find(ModelFamily.class, modelFamilyID); if (modelFamily != null) { try { getEntityManager().remove(modelFamily); } catch (HibernateException he) { logger.error("Hibernate exception on deleting ModelFamily using ID=" + modelFamilyID + he.getStackTrace()); return false; } return true; } else { return false; } } }
ModelFamilyResourceFacadeImp extends CoreDBServiceFacadeImp<ModelFamily, Long> implements ModelFamilyResourceFacade { @Override public boolean deleteModelFamily(Long modelFamilyID) throws PropertyNotSetException { ModelFamily modelFamily = getEntityManager().find(ModelFamily.class, modelFamilyID); if (modelFamily != null) { try { getEntityManager().remove(modelFamily); } catch (HibernateException he) { logger.error("Hibernate exception on deleting ModelFamily using ID=" + modelFamilyID + he.getStackTrace()); return false; } return true; } else { return false; } } ModelFamilyResourceFacadeImp(); }
ModelFamilyResourceFacadeImp extends CoreDBServiceFacadeImp<ModelFamily, Long> implements ModelFamilyResourceFacade { @Override public boolean deleteModelFamily(Long modelFamilyID) throws PropertyNotSetException { ModelFamily modelFamily = getEntityManager().find(ModelFamily.class, modelFamilyID); if (modelFamily != null) { try { getEntityManager().remove(modelFamily); } catch (HibernateException he) { logger.error("Hibernate exception on deleting ModelFamily using ID=" + modelFamilyID + he.getStackTrace()); return false; } return true; } else { return false; } } ModelFamilyResourceFacadeImp(); @Override List<ModelFamilyDTO> getAllModelFamilies(); @Override List<ModelFamilyDTO> getAllModelFamiliesByCrisis(Long crisisID); @Override ModelFamilyDTO getModelFamilyByID(Long id); @Override boolean addCrisisAttribute(ModelFamilyDTO modelFamily); @Override boolean deleteModelFamily(Long modelFamilyID); @Override List<TaggersForCodes> getTaggersByCodes(final List<String> codes); @Override List<ModelWrapper> getModelFamilyAggregateDataForCollection(Long collectionId); }
ModelFamilyResourceFacadeImp extends CoreDBServiceFacadeImp<ModelFamily, Long> implements ModelFamilyResourceFacade { @Override public boolean deleteModelFamily(Long modelFamilyID) throws PropertyNotSetException { ModelFamily modelFamily = getEntityManager().find(ModelFamily.class, modelFamilyID); if (modelFamily != null) { try { getEntityManager().remove(modelFamily); } catch (HibernateException he) { logger.error("Hibernate exception on deleting ModelFamily using ID=" + modelFamilyID + he.getStackTrace()); return false; } return true; } else { return false; } } ModelFamilyResourceFacadeImp(); @Override List<ModelFamilyDTO> getAllModelFamilies(); @Override List<ModelFamilyDTO> getAllModelFamiliesByCrisis(Long crisisID); @Override ModelFamilyDTO getModelFamilyByID(Long id); @Override boolean addCrisisAttribute(ModelFamilyDTO modelFamily); @Override boolean deleteModelFamily(Long modelFamilyID); @Override List<TaggersForCodes> getTaggersByCodes(final List<String> codes); @Override List<ModelWrapper> getModelFamilyAggregateDataForCollection(Long collectionId);  }