Package it.eng.spagobi.commons.metadata

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


    /*
     * <STATEMENT name="SELECT_DOMAIN_FROM_CODE_VALUE" query="SELECT
     * D.VALUE_NM AS VALUE_NAME, D.VALUE_ID AS VALUE_ID, D.VALUE_CD AS
     * VALUE_CD FROM SBI_DOMAINS D WHERE DOMAIN_CD = ? AND VALUE_CD = ? "/>
     */
    SbiDomains aSbiDomains = null;
    Session aSession = null;
    Transaction tx = null;
    try {
      aSession = getSession();
      tx = aSession.beginTransaction();
View Full Code Here


    try {
      aSession = getSession();
      tx = aSession.beginTransaction();

      SbiDomains hibDomain = (SbiDomains) aSession.load(SbiDomains.class,
          id);

      toReturn = toDomain(hibDomain);
      tx.commit();
View Full Code Here

   *            object
   *
   * @return The corrispondent <code>SbiDomain</code>
   */
  public SbiDomains fromDomain(Domain Domain) {
    SbiDomains hibDomain = new SbiDomains();
    hibDomain.setValueCd(Domain.getValueCd());
    hibDomain.setValueId(Domain.getValueId());
    hibDomain.setValueNm(Domain.getValueName());
    hibDomain.setDomainCd(Domain.getDomainCode());
    hibDomain.setDomainNm(Domain.getDomainName());
    hibDomain.setValueDs(Domain.getValueDescription());
    return hibDomain;
  }
View Full Code Here

        SbiExtRoles newRole = ImportUtilities.makeNewSbiExtRole(role);
        String roleCd = role.getRoleTypeCode();
        Map unique = new HashMap();
        unique.put("valuecd", roleCd);
        unique.put("domaincd", "ROLE_TYPE");
        SbiDomains existDom = (SbiDomains) importer.checkExistence(unique, sessionCurrDB, new SbiDomains());
        if (existDom != null) {
          newRole.setRoleType(existDom);
          newRole.setRoleTypeCode(existDom.getValueCd());
        }
        sessionCurrDB.save(newRole);
        metaLog.log("Inserted new role " + newRole.getName());
        Integer newId = newRole.getExtRoleId();
        metaAss.insertCoupleRole(oldId, newId);
View Full Code Here

              + " because it has been associated to an existing engine or it has the same label "
              + " of an existing engine");
          continue;
        }
        SbiEngines newEng = ImportUtilities.makeNewSbiEngine(engine);
        SbiDomains engineTypeDomain = engine.getEngineType();
        Map uniqueEngineType = new HashMap();
        uniqueEngineType.put("valuecd", engineTypeDomain.getValueCd());
        uniqueEngineType.put("domaincd", "ENGINE_TYPE");
        SbiDomains existEngineTypeDomain = (SbiDomains) importer.checkExistence(uniqueEngineType,
            sessionCurrDB, new SbiDomains());
        if (existEngineTypeDomain != null) {
          newEng.setEngineType(existEngineTypeDomain);
        }
        SbiDomains biobjectTypeDomain = engine.getBiobjType();
        Map uniqueBiobjectType = new HashMap();
        uniqueBiobjectType.put("valuecd", biobjectTypeDomain.getValueCd());
        uniqueBiobjectType.put("domaincd", "BIOBJ_TYPE");
        SbiDomains existBiobjectTypeDomain = (SbiDomains) importer.checkExistence(uniqueBiobjectType,
            sessionCurrDB, new SbiDomains());
        if (existBiobjectTypeDomain != null) {
          newEng.setBiobjType(existBiobjectTypeDomain);
        }
        // check datasource link
        SbiDataSource expDs = engine.getDataSource();
View Full Code Here

        SbiFunctions newFunct = ImportUtilities.makeNewSbiFunction(functToInsert);
        String functCd = functToInsert.getFunctTypeCd();
        Map unique = new HashMap();
        unique.put("valuecd", functCd);
        unique.put("domaincd", "FUNCT_TYPE");
        SbiDomains existDom = (SbiDomains) importer.checkExistence(unique, sessionCurrDB, new SbiDomains());
        if (existDom != null) {
          newFunct.setFunctType(existDom);
          newFunct.setFunctTypeCd(existDom.getValueCd());
        }
        String path = newFunct.getPath();
        String parentPath = path.substring(0, path.lastIndexOf('/'));
        Query hibQuery = sessionCurrDB.createQuery(" from SbiFunctions where path = '" + parentPath + "'");
        SbiFunctions functParent = (SbiFunctions) hibQuery.uniqueResult();
View Full Code Here

    logger.debug("IN");
    try {
      aSession = getSession();
      tx = aSession.beginTransaction();
     
      SbiDomains hibDomains = null;
      Integer id = domain.getValueId();
     
      if(id!=null){
        //modification
        logger.debug("Update Domain");
        hibDomains = (SbiDomains) aSession.load(SbiDomains.class, id);
        updateSbiCommonInfo4Update(hibDomains);
        hibDomains.setDomainCd(domain.getDomainCode());
        hibDomains.setDomainNm(domain.getDomainName());
        hibDomains.setValueCd(domain.getValueCd());
        hibDomains.setValueDs(domain.getValueDescription());
        hibDomains.setValueId(domain.getValueId());
        hibDomains.setValueNm(domain.getValueName());
      }
      else{
        //insertion
        logger.debug("Insert new Domain");
        hibDomains = fromDomain(domain);
        updateSbiCommonInfo4Insert(hibDomains);
        hibDomains.setValueId(domain.getValueId());
      }
     
      Integer newId = (Integer) aSession.save(hibDomains);
       
      tx.commit();
View Full Code Here

        SbiChecks newck = ImportUtilities.makeNewSbiCheck(check);
        String valueCd = check.getValueTypeCd();
        Map unique = new HashMap();
        unique.put("valuecd", valueCd);
        unique.put("domaincd", "CHECK");
        SbiDomains existDom = (SbiDomains) importer.checkExistence(unique, sessionCurrDB, new SbiDomains());
        if (existDom != null) {
          newck.setCheckType(existDom);
          newck.setValueTypeCd(existDom.getValueCd());
        }
        sessionCurrDB.save(newck);

        metaLog.log("Inserted new check " + newck.getName());
        Integer newId = newck.getCheckId();
View Full Code Here

        // get sbidomain of the current system
        String stateCd = functrole.getStateCd();
        Map uniqueDom = new HashMap();
        uniqueDom.put("valuecd", stateCd);
        uniqueDom.put("domaincd", SpagoBIConstants.PERMISSION_ON_FOLDER);
        SbiDomains existDom = (SbiDomains) importer.checkExistence(uniqueDom, sessionCurrDB, new SbiDomains());
        if (existDom != null) {
          newFunctRole.getId().setState(existDom);
          newFunctRole.setStateCd(existDom.getValueCd());
        }
        // check if the association between metadata already exist
        Map unique = new HashMap();
        unique.put("stateid", existDom.getValueId());
        unique.put("roleid", newRoleid);
        unique.put("functionid", newFunctid);
        Object existObj = importer.checkExistence(unique, sessionCurrDB, new SbiFuncRole());
        if (existObj == null) {
          sessionCurrDB.save(newFunctRole);
View Full Code Here

      tx = sess.beginTransaction();

      Criterion aCriterion = Expression.eq("valueId",idDomain);
      Criteria criteria = sess.createCriteria(SbiDomains.class);
      criteria.add(aCriterion);
      SbiDomains aSbiDomains = (SbiDomains) criteria.uniqueResult();
      if (aSbiDomains != null)
        sess.delete(aSbiDomains);
      tx.commit();

    } catch (HibernateException he) {
View Full Code Here

TOP

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

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.