/** * Set the deleted flag of the procedure and corresponding entities * (observations, series, obervationConstellation) to <code>true</code> * * @param identifier * Procedure identifier * @param deleteFlag * Deleted flag to set * @param session * Hibernate session * @throws OwsExceptionReport * If the procedure is not contained in the database */ private void setDeleteSensorFlag(String identifier, boolean deleteFlag, Session session) throws OwsExceptionReport { ProcedureEntity procedure = daoFactory.getProcedureDAO().getProcedureForIdentifier(identifier, session); if (procedure != null) { procedure.setDeleted(deleteFlag); session.saveOrUpdate(procedure); session.flush(); // set deleted flag in Series and Observation table for series concept to true List<DatasetEntity> series = daoFactory.getSeriesDAO().updateSeriesSetAsDeletedForProcedureAndGetSeries(identifier, deleteFlag, session); getSeriesObservationDAO().updateObservationSetAsDeletedForSeries(series, deleteFlag, session); } else { throw new NoApplicableCodeException().withMessage("The requested identifier is not contained in database"); } }
/** * Set the deleted flag of the procedure and corresponding entities * (observations, series, obervationConstellation) to <code>true</code> * * @param identifier * Procedure identifier * @param deleteFlag * Deleted flag to set * @param session * Hibernate session * @throws OwsExceptionReport * If the procedure is not contained in the database */ private void setDeleteSensorFlag(String identifier, boolean deleteFlag, Session session) throws OwsExceptionReport { ProcedureEntity procedure = daoFactory.getProcedureDAO().getProcedureForIdentifier(identifier, session); if (procedure != null) { procedure.setDeleted(deleteFlag); session.saveOrUpdate(procedure); session.flush(); // set deleted flag in Series and Observation table for series concept to true List<DatasetEntity> series = daoFactory.getSeriesDAO().updateSeriesSetAsDeletedForProcedureAndGetSeries(identifier, deleteFlag, session); getSeriesObservationDAO().updateObservationSetAsDeletedForSeries(series, deleteFlag, session); } else { throw new NoApplicableCodeException().withMessage("The requested identifier is not contained in database"); } }
procedure.setReference(procedureDescription.isReference()); procedure.setDeleted(false); session.saveOrUpdate(procedure); session.flush();
procedure.setReference(procedureDescription.isReference()); procedure.setDeleted(false); session.saveOrUpdate(procedure); session.flush();