Package it.eng.spagobi.kpi.config.metadata

Examples of it.eng.spagobi.kpi.config.metadata.SbiMeasureUnit


    Session aSession = null;
    Transaction tx = null;
    try {
      aSession = getSession();
      tx = aSession.beginTransaction();
      SbiMeasureUnit hibMeasureUnit = (SbiMeasureUnit) aSession.load(
          SbiMeasureUnit.class, id);
      toReturn = new MeasureUnit();
      toReturn.setId(hibMeasureUnit.getIdMeasureUnit());
      toReturn.setName(hibMeasureUnit.getName());
      toReturn.setScaleCd(hibMeasureUnit.getScaleCd());
      toReturn.setScaleNm(hibMeasureUnit.getScaleNm());
      toReturn.setScaleTypeId(hibMeasureUnit.getScaleType().getValueId());
     
    } catch (HibernateException he) {
      logger.error("Error while loading the MeasureUnit with id "
          + ((id == null) ? "" : id.toString()), he);
View Full Code Here


      aSession = getSession();
      tx = aSession.beginTransaction();
      Criterion labelCriterrion = Expression.eq("scaleCd",cd);
      Criteria criteria = aSession.createCriteria(SbiMeasureUnit.class);
      criteria.add(labelCriterrion);
      SbiMeasureUnit hibMu = (SbiMeasureUnit) criteria.uniqueResult();
   
     
      toReturn = new MeasureUnit();
      toReturn.setId(hibMu.getIdMeasureUnit());
      toReturn.setName(hibMu.getName());
      toReturn.setScaleCd(hibMu.getScaleCd());
      toReturn.setScaleNm(hibMu.getScaleNm());
      toReturn.setScaleTypeId(hibMu.getScaleType().getValueId());
     
    } catch (HibernateException he) {
      logger.error("Error while loading the MeasureUnit with id "+ cd , he);

      if (tx != null)
View Full Code Here

      // Measure Unit   ???
      if(kpi.getScaleCode()!=null && !kpi.getScaleCode().equalsIgnoreCase("")){
        IMeasureUnitDAO muDao=DAOFactory.getMeasureUnitDAO();
        MeasureUnit mu=muDao.loadMeasureUnitByCd(kpi.getScaleCode());
        insertMeasureUnit(mu, session);
        SbiMeasureUnit sbiMu= (SbiMeasureUnit) session.load(SbiMeasureUnit.class, mu.getId());
        hibKpi.setSbiMeasureUnit(sbiMu);
      }

      Transaction tx = session.beginTransaction();
      Integer kpiIdReturned = (Integer)session.save(hibKpi);
View Full Code Here

      // Measure Unit   ???
      if(kpi.getScaleCode()!=null && !kpi.getScaleCode().equalsIgnoreCase("")){
        IMeasureUnitDAO muDao=DAOFactory.getMeasureUnitDAO();
        MeasureUnit mu=muDao.loadMeasureUnitByCd(kpi.getScaleCode());
        insertMeasureUnit(mu, session);
        SbiMeasureUnit sbiMu= (SbiMeasureUnit) session.load(SbiMeasureUnit.class, mu.getId());
        hibKpi.setSbiMeasureUnit(sbiMu);
      }

      Transaction tx = session.beginTransaction();
      Integer kpiIdReturned = (Integer)session.save(hibKpi);
View Full Code Here

      // load measureUnit!
      if(kpiInst.getScaleCode()!=null){
        IMeasureUnitDAO muDao=DAOFactory.getMeasureUnitDAO();
        MeasureUnit mu=muDao.loadMeasureUnitByCd(kpiInst.getScaleCode());
        insertMeasureUnit(mu, session);
        SbiMeasureUnit sbiMu= (SbiMeasureUnit) session.load(SbiMeasureUnit.class, mu.getId());
        hibKpiInst.setSbiMeasureUnit(sbiMu);
      }

      // Insert KPI Instance
View Full Code Here

      if(!hibList.isEmpty()) {
        return;
      }

      // main attributes     
      SbiMeasureUnit hibMu = new SbiMeasureUnit();
      hibMu.setIdMeasureUnit(mu.getId());
      hibMu.setName(mu.getName());
      hibMu.setScaleCd(mu.getScaleCd());
      hibMu.setScaleNm(mu.getScaleNm());

      SbiDomains scaleType=(SbiDomains)session.load(SbiDomains.class, mu.getScaleTypeId());

      hibMu.setScaleType(scaleType);

      Transaction tx = session.beginTransaction();     
      session.save(hibMu);
      tx.commit();
    } catch (Exception e) {
View Full Code Here

          }
        }
      }
    }

    SbiMeasureUnit unit = kpiInst.getSbiMeasureUnit();
    String scaleCode = null;
    String scaleName = null;
    if (unit != null) {
      scaleCode = unit.getScaleCd();
      scaleName = unit.getScaleNm();
    }

    toReturn.setWeight(weight);
    logger.debug("KpiInstance weight setted");
    toReturn.setTarget(target);
View Full Code Here

          }
        }
      }
    }

    SbiMeasureUnit unit = kpiInstHist.getSbiMeasureUnit();
    String scaleCode = null;
    String scaleName = null;
    if (unit != null) {
      scaleCode = unit.getScaleCd();
      scaleName = unit.getScaleNm();
    }

    toReturn.setWeight(weight);
    logger.debug("KpiInstance weight setted");
    toReturn.setTarget(target);
View Full Code Here

TOP

Related Classes of it.eng.spagobi.kpi.config.metadata.SbiMeasureUnit

Copyright © 2018 www.massapicom. 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.