Package it.eng.spagobi.kpi.config.bo

Examples of it.eng.spagobi.kpi.config.bo.MeasureUnit


  static private Logger logger = Logger.getLogger(MeasureUnitDAOImpl.class);
 
  public MeasureUnit loadMeasureUnitById(Integer id) throws EMFUserError {
    logger.debug("IN");
    MeasureUnit toReturn = null;
    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


 
 
 
  public MeasureUnit loadMeasureUnitByCd(String cd) throws EMFUserError {
    logger.debug("IN");
    MeasureUnit toReturn = null;
    Session aSession = null;
    Transaction tx = null;
    try {
      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

TOP

Related Classes of it.eng.spagobi.kpi.config.bo.MeasureUnit

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.