Package it.eng.spagobi.commons.metadata

Examples of it.eng.spagobi.commons.metadata.SbiConfig


      String confIsActive=((String) aConfigSB.getAttribute("isActive"));
      String confValueCheck=((String) aConfigSB.getAttribute("valueCheck"))
      String confCategory=((String) aConfigSB.getAttribute("category"));
     

      SbiConfig aConfig=new SbiConfig();
      //aConfig.setId(exporterId);
      aConfig.setLabel(confLabel);
      aConfig.setName(confName);
      aConfig.setDescription(confDesc);
      aConfig.setValueCheck(confValueCheck);
      aConfig.setSbiDomains(hibDomain);
      aConfig.setCategory(confCategory);

      Boolean value = confIsActive!=null ? Boolean.valueOf(confIsActive) : Boolean.FALSE;
      aConfig.setIsActive(value.booleanValue());

      logger.debug("Inserting Config parameter "+aConfig.getLabel());

      aSession.save(aConfig);

    }
    logger.debug("OUT");
View Full Code Here


     
      Query hibQuery = aSession.createQuery(" from SbiConfig");
      List hibList = hibQuery.list();
      Iterator it = hibList.iterator();     
      while (it.hasNext()) {     
        SbiConfig hibMap = (SbiConfig) it.next()
        if (hibMap != null) {
          Config biMap = hibMap.toConfig()
          toReturn.add(biMap);
        }
      }
      tx.commit();
    }catch(HibernateException he){
View Full Code Here

    Transaction tx = null;

    try {
      tmpSession = getSession();
      tx = tmpSession.beginTransaction();
      SbiConfig hibMap = (SbiConfig)tmpSession.load(SbiConfig.class,  id);
      toReturn = hibMap.toConfig();
      tx.commit();

    } catch (HibernateException he) {
      logException(he);
View Full Code Here

      tx = tmpSession.beginTransaction();
      Criterion labelCriterrion = Expression.eq("label",label);
      Criteria criteria = tmpSession.createCriteria(SbiConfig.class);
      criteria.add(labelCriterrion)
 
      SbiConfig hibConfig = (SbiConfig) criteria.uniqueResult();
      if (hibConfig == null) return null;
      toReturn = hibConfig.toConfig();       

      tx.commit();
    } catch (HibernateException he) {
      logException(he);
      if (tx != null)
View Full Code Here

   
    return toReturn;
    }
   
    public SbiConfig fromConfig(Config config){
    SbiConfig hibConfig = new SbiConfig();
    hibConfig.setValueCheck(config.getValueCheck());
    hibConfig.setId(config.getId());
    hibConfig.setName(config.getName());
    hibConfig.setLabel(config.getLabel());
    hibConfig.setDescription(config.getDescription());
    hibConfig.setCategory(config.getCategory());
    return hibConfig;
  }
View Full Code Here

    try {
      aSession = getSession();
      tx = aSession.beginTransaction();
     
      SbiConfig hibConfig = null;
      Integer id = config.getId();
     
      Criterion domainCriterrion = Expression.eq("valueId",config.getValueTypeId());
      Criteria domainCriteria = aSession.createCriteria(SbiDomains.class);
      domainCriteria.add(domainCriterrion)
     
      SbiDomains hibDomains = (SbiDomains) domainCriteria.uniqueResult()
     
      if(id!=null){
        //modification
        logger.debug("Update Config");
        hibConfig = (SbiConfig) aSession.load(SbiConfig.class, id);
        updateSbiCommonInfo4Update(hibConfig);
        hibConfig.setLabel(config.getLabel());
        hibConfig.setDescription(config.getDescription());
        hibConfig.setName(config.getName());
        hibConfig.setValueCheck(config.getValueCheck());
        hibConfig.setIsActive(config.isActive());
        hibConfig.setSbiDomains(hibDomains);
        hibConfig.setCategory(config.getCategory());
      }
      else{
        //insertion
        logger.debug("Insert new Config");
        hibConfig = fromConfig(config);
        updateSbiCommonInfo4Insert(hibConfig);
        hibConfig.setSbiDomains(hibDomains);
      }
     
      Integer newId = (Integer) aSession.save(hibConfig);
       
      tx.commit();
View Full Code Here

        tx = sess.beginTransaction();
       
        Criterion aCriterion = Expression.eq("id", idConfig);
        Criteria criteria = sess.createCriteria(SbiConfig.class);
        criteria.add(aCriterion);
        SbiConfig aSbiConfig = (SbiConfig) criteria.uniqueResult();
        if (aSbiConfig!=null) sess.delete(aSbiConfig);
        tx.commit();
       
      } catch (HibernateException he) {
        logger.error("HibernateException",he);
View Full Code Here

TOP

Related Classes of it.eng.spagobi.commons.metadata.SbiConfig

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.