Examples of EMFUserError


Examples of it.eng.spago.error.EMFUserError

    catch (ConstraintViolationException cve) {
      if (tx != null && tx.isActive()) {
        tx.rollback();
      }
      logger.error("Impossible to delete DataSet", cve);
      throw new EMFUserError(EMFErrorSeverity.WARNING, 10014);

    } catch (HibernateException e) {
      if (tx != null && tx.isActive()) {
        tx.rollback();
      }
      logger.error("Error while deleting the DataSet with id " + ((dsID == null)?"":dsID.toString()), e);
      throw new EMFUserError(EMFErrorSeverity.ERROR, 101);

    } finally {
      aSession.close();
    }
  }
View Full Code Here

Examples of it.eng.spago.error.EMFUserError

    catch (ConstraintViolationException cve) {
      if (tx != null && tx.isActive()) {
        tx.rollback();
      }
      logger.error("Impossible to delete DataSet Version", cve);
      throw new EMFUserError(EMFErrorSeverity.WARNING, 10014);

    } catch (HibernateException e) {
      if (tx != null && tx.isActive()) {
        tx.rollback();
      }
      logger.error("Error while deleting the DataSet with varsionId " + ((dsVerionID == null)?"":dsVerionID.toString()), e);
      throw new EMFUserError(EMFErrorSeverity.ERROR, 101);

    } finally {
      aSession.close();
    }
    return deleted;
View Full Code Here

Examples of it.eng.spago.error.EMFUserError

    catch (ConstraintViolationException cve) {
      if (tx != null && tx.isActive()) {
        tx.rollback();
      }
      logger.error("Impossible to delete All DataSet Version", cve);
      throw new EMFUserError(EMFErrorSeverity.WARNING, 10014);

    } catch (HibernateException e) {
      if (tx != null && tx.isActive()) {
        tx.rollback();
      }
      logger.error("Error while deleting the Older Versions of DataSet with id " + ((dsID == null)?"":dsID.toString()), e);
      throw new EMFUserError(EMFErrorSeverity.ERROR, 101);

    } finally {
      aSession.close();
    }
  }
View Full Code Here

Examples of it.eng.spago.error.EMFUserError

          transformer = (SbiDomains) criteria.uniqueResult();

          if (transformer == null){
            logger.error("The Domain with value_id= "+dataSetActiveDetail.getTransformerId()+" does not exist.");
            throw new EMFUserError(EMFErrorSeverity.ERROR, 1035);
          }
        }

        SbiDomains category = null;
        if (dataSetActiveDetail.getCategoryId()!= null){
          Criterion aCriterion = Expression.eq("valueId",  dataSetActiveDetail.getCategoryId());
          Criteria criteria = aSession.createCriteria(SbiDomains.class);
          criteria.add(aCriterion);

          category = (SbiDomains) criteria.uniqueResult();

          if (category == null){
            logger.error("The Domain with value_id= "+dataSetActiveDetail.getCategoryId()+" does not exist.");
            throw new EMFUserError(EMFErrorSeverity.ERROR, 1035);
          }
        }
        Date currentTStamp = new Date();
        SbiDataSetConfig dsConfig = new SbiDataSetConfig();     
        dsConfig.setLabel(dataSet.getLabel());
        dsConfig.setDescription(dataSet.getDescription());
        dsConfig.setName(dataSet.getName())
        updateSbiCommonInfo4Insert(dsConfig);

        String userIn = dsConfig.getCommonInfo().getUserIn();
        String sbiVersionIn = dsConfig.getCommonInfo().getSbiVersionIn();
        hibDataSet.setUserIn(userIn);
        hibDataSet.setSbiVersionIn(sbiVersionIn);   
        hibDataSet.setVersionNum(1);
        hibDataSet.setTimeIn(currentTStamp)
       
        hibDataSet.setActive(true);     

        hibDataSet.setTransformer(transformer);
        hibDataSet.setPivotColumnName(dataSetActiveDetail.getPivotColumnName());
        hibDataSet.setPivotRowName(dataSetActiveDetail.getPivotRowName());
        hibDataSet.setPivotColumnValue(dataSetActiveDetail.getPivotColumnValue());
        hibDataSet.setNumRows(dataSetActiveDetail.isNumRows());

        hibDataSet.setCategory(category);
        hibDataSet.setParameters(dataSetActiveDetail.getParameters());
        hibDataSet.setDsMetadata(dataSetActiveDetail.getDsMetadata());

        Integer dsId =(Integer) aSession.save(dsConfig);
        dsConfig.setDsId(dsId);
        hibDataSet.setSbiDsConfig(dsConfig);

        aSession.save(hibDataSet);

        idToReturn = dsId;
        tx.commit();
      }
    } catch (HibernateException he) {
      logger.error("Error while inserting the New Data Set ", he);
      if (tx != null)
        tx.rollback();
      throw new EMFUserError(EMFErrorSeverity.ERROR, 100);
    } finally {
      if (aSession!=null){
        if (aSession.isOpen()) aSession.close();
        logger.debug("OUT");
      }
View Full Code Here

Examples of it.eng.spago.error.EMFUserError

      }
    } catch (HibernateException he) {
      logger.error("Error while modifing the data Set with id " + ((dsId == null)?"":String.valueOf(dsId)), he);
      if (tx != null)
        tx.rollback();
      throw new EMFUserError(EMFErrorSeverity.ERROR, 100);
    } finally {
      if (aSession!=null){
        if (aSession.isOpen()) aSession.close();
        logger.debug("OUT");
      }
View Full Code Here

Examples of it.eng.spago.error.EMFUserError

      }
    } catch (HibernateException he) {
      logger.error("Error while modifing the data Set with id " + ((dsId == null)?"":String.valueOf(dsId)), he);
      if (tx != null)
        tx.rollback();
      throw new EMFUserError(EMFErrorSeverity.ERROR, 100);
    } finally {
      if (aSession!=null){
        if (aSession.isOpen()) aSession.close();
        logger.debug("OUT");
      }
View Full Code Here

Examples of it.eng.spago.error.EMFUserError

          Criteria criteria = aSession.createCriteria(SbiDomains.class);
          criteria.add(aCriterion);
          transformer = (SbiDomains) criteria.uniqueResult();
          if (transformer == null){
            logger.error("The Domain with value_id= "+dsActiveDetailToSet.getTransformerId()+" does not exist.");
            throw new EMFUserError(EMFErrorSeverity.ERROR, 1035);
          }
        }

        SbiDomains category = null;
        if (dsActiveDetailToSet.getCategoryId()!= null){
          Criterion aCriterion = Expression.eq("valueId",  dsActiveDetailToSet.getCategoryId());
          Criteria criteria = aSession.createCriteria(SbiDomains.class);
          criteria.add(aCriterion)
          category = (SbiDomains) criteria.uniqueResult()
          if (category == null){
            logger.error("The Domain with value_id= "+dsActiveDetailToSet.getCategoryId()+" does not exist.");
            throw new EMFUserError(EMFErrorSeverity.ERROR, 1035);
          }
        }
        Date currentTStamp = new Date();

        hibDataSet.setTimeIn(currentTStamp);   
        hibDataSet.setActive(true);     

        hibDataSet.setTransformer(transformer);
        hibDataSet.setPivotColumnName(dsActiveDetailToSet.getPivotColumnName());
        hibDataSet.setPivotRowName(dsActiveDetailToSet.getPivotRowName());
        hibDataSet.setPivotColumnValue(dsActiveDetailToSet.getPivotColumnValue());
        hibDataSet.setNumRows(dsActiveDetailToSet.isNumRows());

        hibDataSet.setCategory(category);
        hibDataSet.setParameters(dsActiveDetailToSet.getParameters());
        hibDataSet.setDsMetadata(dsActiveDetailToSet.getDsMetadata());

        SbiDataSetConfig hibGenericDataSet = (SbiDataSetConfig) aSession.load(SbiDataSetConfig.class,dsId);         
        hibGenericDataSet.setLabel(dataSet.getLabel());
        hibGenericDataSet.setDescription(dataSet.getDescription());
        hibGenericDataSet.setName(dataSet.getName())
       
        updateSbiCommonInfo4Update(hibGenericDataSet);

        String userUp = hibGenericDataSet.getCommonInfo().getUserUp();
        String sbiVersionUp = hibGenericDataSet.getCommonInfo().getSbiVersionUp();
        hibDataSet.setUserIn(userUp);
        hibDataSet.setSbiVersionIn(sbiVersionUp)
        hibDataSet.setTimeIn(currentTStamp);

        Integer currenthigherVersion = getHigherVersionNumForDS(dsId);
        Integer newVersion = currenthigherVersion+1;
        hibDataSet.setVersionNum(newVersion);

        Query hibQuery = aSession.createQuery("from SbiDataSetHistory h where h.active = ? and h.sbiDsConfig = ?" );
        hibQuery.setBoolean(0, true);
        hibQuery.setInteger(1, dsId)
        SbiDataSetHistory dsActiveDetail =(SbiDataSetHistory)hibQuery.uniqueResult();
        dsActiveDetail.setActive(false);
        aSession.update(dsActiveDetail);

        aSession.update(hibGenericDataSet);
        hibDataSet.setSbiDsConfig(hibGenericDataSet);       
        aSession.save(hibDataSet);

        tx.commit();
      }
    } catch (HibernateException he) {
      logger.error("Error while modifing the data Set with id " + ((dataSet == null)?"":String.valueOf(dataSet.getDsId())), he);
      if (tx != null)
        tx.rollback();
      throw new EMFUserError(EMFErrorSeverity.ERROR, 100);
    } finally {
      if (aSession!=null){
        if (aSession.isOpen()) aSession.close();
        logger.debug("OUT");
      }
View Full Code Here

Examples of it.eng.spago.error.EMFUserError

    } catch (HibernateException he) {
      logger.error("Error while loading the list of Resources", he)
      if (tx != null)
        tx.rollback()
      throw new EMFUserError(EMFErrorSeverity.ERROR, 9104);   
    } finally {
      if (aSession != null) {
        if (aSession.isOpen())
          aSession.close();
        logger.debug("OUT");
View Full Code Here

Examples of it.eng.spago.error.EMFUserError

      logger.error("Error while loading the list of Threshold", he);

      if (tx != null)
        tx.rollback();

      throw new EMFUserError(EMFErrorSeverity.ERROR, 9104);

    } finally {
      if (aSession != null) {
        if (aSession.isOpen())
          aSession.close();
View Full Code Here

Examples of it.eng.spago.error.EMFUserError

      }     
    } catch (HibernateException he) {
      logger.error("Error while loading the list of Resources", he)
      if (tx != null)
        tx.rollback()
      throw new EMFUserError(EMFErrorSeverity.ERROR, 9104);   
    } finally {
      if (aSession != null) {
        if (aSession.isOpen())
          aSession.close();
        logger.debug("OUT");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.