@Test public void testGetModelCountByModelFamilyID() { try { Integer count = modelResourceFacadeImp.getModelCountByModelFamilyID(modelFamilyDTO.getModelFamilyId()); assertNotNull(count); assertTrue(count == 1); } catch (PropertyNotSetException e) { logger.error("PropertyNotSetException while executing testGetModelCountByModelFamilyID "+e.getMessage()); } }
@Override @SuppressWarnings("unchecked") public Integer getModelCountByModelFamilyID(Long modelFamilyID) throws PropertyNotSetException { Criteria criteria = getCurrentSession().createCriteria(Model.class); criteria.add(Restrictions.eq("modelFamily.modelFamilyId", modelFamilyID)); List<Model> modelList = criteria.list(); return modelList != null ? Integer.valueOf(modelList.size()) : 0; }
ModelResourceFacadeImp extends CoreDBServiceFacadeImp<Model, Long> implements ModelResourceFacade { @Override @SuppressWarnings("unchecked") public Integer getModelCountByModelFamilyID(Long modelFamilyID) throws PropertyNotSetException { Criteria criteria = getCurrentSession().createCriteria(Model.class); criteria.add(Restrictions.eq("modelFamily.modelFamilyId", modelFamilyID)); List<Model> modelList = criteria.list(); return modelList != null ? Integer.valueOf(modelList.size()) : 0; } }
ModelResourceFacadeImp extends CoreDBServiceFacadeImp<Model, Long> implements ModelResourceFacade { @Override @SuppressWarnings("unchecked") public Integer getModelCountByModelFamilyID(Long modelFamilyID) throws PropertyNotSetException { Criteria criteria = getCurrentSession().createCriteria(Model.class); criteria.add(Restrictions.eq("modelFamily.modelFamilyId", modelFamilyID)); List<Model> modelList = criteria.list(); return modelList != null ? Integer.valueOf(modelList.size()) : 0; } ModelResourceFacadeImp(); }
ModelResourceFacadeImp extends CoreDBServiceFacadeImp<Model, Long> implements ModelResourceFacade { @Override @SuppressWarnings("unchecked") public Integer getModelCountByModelFamilyID(Long modelFamilyID) throws PropertyNotSetException { Criteria criteria = getCurrentSession().createCriteria(Model.class); criteria.add(Restrictions.eq("modelFamily.modelFamilyId", modelFamilyID)); List<Model> modelList = criteria.list(); return modelList != null ? Integer.valueOf(modelList.size()) : 0; } ModelResourceFacadeImp(); @Override List<ModelDTO> getAllModels(); @Override ModelDTO getModelByID(Long id); @Override @SuppressWarnings("unchecked") Integer getModelCountByModelFamilyID(Long modelFamilyID); @Override @SuppressWarnings("unchecked") List<ModelHistoryWrapper> getModelByModelFamilyID(Long modelFamilyID, Integer start, Integer limit); @Override @SuppressWarnings("unchecked") List<ModelHistoryWrapper> getModelByModelFamilyID(Long modelFamilyID, Integer start, Integer limit, 
			String sortColumn, String sortDirection); @Override List<ModelWrapper> getModelByCrisisID(Long crisisID); @Override boolean deleteModel(Long modelID); }
ModelResourceFacadeImp extends CoreDBServiceFacadeImp<Model, Long> implements ModelResourceFacade { @Override @SuppressWarnings("unchecked") public Integer getModelCountByModelFamilyID(Long modelFamilyID) throws PropertyNotSetException { Criteria criteria = getCurrentSession().createCriteria(Model.class); criteria.add(Restrictions.eq("modelFamily.modelFamilyId", modelFamilyID)); List<Model> modelList = criteria.list(); return modelList != null ? Integer.valueOf(modelList.size()) : 0; } ModelResourceFacadeImp(); @Override List<ModelDTO> getAllModels(); @Override ModelDTO getModelByID(Long id); @Override @SuppressWarnings("unchecked") Integer getModelCountByModelFamilyID(Long modelFamilyID); @Override @SuppressWarnings("unchecked") List<ModelHistoryWrapper> getModelByModelFamilyID(Long modelFamilyID, Integer start, Integer limit); @Override @SuppressWarnings("unchecked") List<ModelHistoryWrapper> getModelByModelFamilyID(Long modelFamilyID, Integer start, Integer limit, 
			String sortColumn, String sortDirection); @Override List<ModelWrapper> getModelByCrisisID(Long crisisID); @Override boolean deleteModel(Long modelID);  }