Examples of SbiObjects


Examples of it.eng.spagobi.analiticalmodel.document.metadata.SbiObjects

      toTransform = hibernateQuery.list()
     
      Iterator it = toTransform.iterator();
      while (it.hasNext()) {
        SbiObjects object = (SbiObjects) it.next();
        toReturn.add(toBIObject(object));
      }
    } catch (HibernateException he) {
      logger.error("Error while loading the list of Resources", he)
      if (tx != null)
View Full Code Here

Examples of it.eng.spagobi.analiticalmodel.document.metadata.SbiObjects

    Session aSession = null;
    Transaction tx = null;
    try {
      aSession = getSession();
      tx = aSession.beginTransaction();
      SbiObjects hibBIObject = (SbiObjects)aSession.load(SbiObjects.class,  biObjectID);
      toReturn = toBIObject(hibBIObject);
      tx.commit();
    } catch (HibernateException he) {
      logger.error(he);
      if (tx != null)
View Full Code Here

Examples of it.eng.spagobi.analiticalmodel.document.metadata.SbiObjects

      tx = aSession.beginTransaction();
      //String hql = " from SbiObjects where biobjId = " + id;
      String hql = " from SbiObjects where biobjId = ?";
      Query hqlQuery = aSession.createQuery(hql);
      hqlQuery.setInteger(0, id.intValue());
      SbiObjects hibObject = (SbiObjects)hqlQuery.uniqueResult();
      if (hibObject == null) return null;
      biObject = toBIObject(hibObject);
      tx.commit();
    } catch (HibernateException he) {
      logger.error(he);
View Full Code Here

Examples of it.eng.spagobi.analiticalmodel.document.metadata.SbiObjects

      tx = aSession.beginTransaction();
      Criterion labelCriterrion = Expression.eq("label",
          label);
      Criteria criteria = aSession.createCriteria(SbiObjects.class);
      criteria.add(labelCriterrion);
      SbiObjects hibObject = (SbiObjects) criteria.uniqueResult();
      if (hibObject == null) return null;
      biObject = toBIObject(hibObject);
      tx.commit();
    } catch (HibernateException he) {
      logger.error(he);
View Full Code Here

Examples of it.eng.spagobi.analiticalmodel.document.metadata.SbiObjects

      logger.debug("hibernate transaction started");
      Criterion domainCdCriterrion = Expression.eq("biobjId", id);
      Criteria criteria = aSession.createCriteria(SbiObjects.class);
      criteria.add(domainCdCriterrion);
      logger.debug( "hibernate criteria filled:" + criteria);
      SbiObjects hibObject = (SbiObjects) criteria.uniqueResult();
      logger.debug( "hibernate object retrived:" + hibObject);
      if (hibObject == null) {
        return null;
      }
      biObject = toBIObject(hibObject);
View Full Code Here

Examples of it.eng.spagobi.analiticalmodel.document.metadata.SbiObjects

    Session aSession = null;
    Transaction tx = null;
    try {
      aSession = getSession();
      tx = aSession.beginTransaction();
      SbiObjects hibBIObject = (SbiObjects) aSession.load(SbiObjects.class, biObject.getId());
     
      updateSbiCommonInfo4Update(hibBIObject);
     
      SbiEngines hibEngine = (SbiEngines) aSession.load(SbiEngines.class,  biObject.getEngine().getId());
      hibBIObject.setSbiEngines(hibEngine);
      SbiDataSource dSource = null;
      if (biObject.getDataSourceId() != null) {
        dSource = (SbiDataSource) aSession.load(SbiDataSource.class, biObject.getDataSourceId());
      }
      hibBIObject.setDataSource(dSource);

      SbiDataSetConfig dSet = null;
      if (biObject.getDataSetId() != null) {
        dSet = (SbiDataSetConfig) aSession.load(SbiDataSetConfig.class, biObject.getDataSetId());
      }
      hibBIObject.setDataSet(dSet);


      hibBIObject.setDescr(biObject.getDescription());
      hibBIObject.setLabel(biObject.getLabel());
      hibBIObject.setName(biObject.getName());
      hibBIObject.setEncrypt(new Short(biObject.getEncrypt().shortValue()));
      hibBIObject.setVisible(new Short(biObject.getVisible().shortValue()));
      hibBIObject.setProfiledVisibility(biObject.getProfiledVisibility());
      hibBIObject.setRelName(biObject.getRelName());
      SbiDomains hibState = (SbiDomains) aSession.load(SbiDomains.class, biObject.getStateID());
      hibBIObject.setState(hibState);
      hibBIObject.setStateCode(biObject.getStateCode());
      SbiDomains hibObjectType = (SbiDomains) aSession.load(SbiDomains.class, biObject.getBiObjectTypeID());
      hibBIObject.setObjectType(hibObjectType);
      hibBIObject.setObjectTypeCode(biObject.getBiObjectTypeCode());

      hibBIObject.setRefreshSeconds(biObject.getRefreshSeconds());

      // functionalities erasing
      Set hibFunctionalities = hibBIObject.getSbiObjFuncs();
      for (Iterator it = hibFunctionalities.iterator(); it.hasNext(); ) {
        aSession.delete((SbiObjFunc) it.next());
      }
      // functionalities storing
      Set hibObjFunc = new HashSet();
      List functionalities = biObject.getFunctionalities();
      for (Iterator it = functionalities.iterator(); it.hasNext(); ) {
        Integer functId = (Integer) it.next();
        SbiFunctions aSbiFunctions = (SbiFunctions) aSession.load(SbiFunctions.class, functId);
        SbiObjFuncId aSbiObjFuncId = new SbiObjFuncId();
        aSbiObjFuncId.setSbiFunctions(aSbiFunctions);
        aSbiObjFuncId.setSbiObjects(hibBIObject);
        SbiObjFunc aSbiObjFunc = new SbiObjFunc(aSbiObjFuncId);
        updateSbiCommonInfo4Update(aSbiObjFunc);
        aSession.save(aSbiObjFunc);
        hibObjFunc.add(aSbiObjFunc);
      }
      hibBIObject.setSbiObjFuncs(hibObjFunc);

      tx.commit();

      // update biobject template info
      if (objTemp != null) {
View Full Code Here

Examples of it.eng.spagobi.analiticalmodel.document.metadata.SbiObjects

    Integer idToReturn = null;
    try {

      aSession = getSession();
      tx = aSession.beginTransaction();
      SbiObjects hibBIObject = new SbiObjects();
      // add the common info
     
     
      SbiEngines hibEngine = (SbiEngines) aSession.load(SbiEngines.class,  obj.getEngine().getId());
      hibBIObject.setSbiEngines(hibEngine);
      hibBIObject.setDescr(obj.getDescription());

      hibBIObject.setLabel(obj.getLabel());
      hibBIObject.setName(obj.getName());
      if(obj.getEncrypt()!=null){
        hibBIObject.setEncrypt(new Short(obj.getEncrypt().shortValue()));
      }
      if(obj.getVisible()!=null){
        hibBIObject.setVisible(new Short(obj.getVisible().shortValue()));
      }
      hibBIObject.setProfiledVisibility(obj.getProfiledVisibility());
      hibBIObject.setRelName(obj.getRelName());

      SbiDomains hibState = (SbiDomains) aSession.load(SbiDomains.class, obj.getStateID());
      hibBIObject.setState(hibState);
      hibBIObject.setStateCode(obj.getStateCode());
      SbiDomains hibObjectType = (SbiDomains) aSession.load(SbiDomains.class, obj.getBiObjectTypeID());
      hibBIObject.setObjectType(hibObjectType);
      hibBIObject.setObjectTypeCode(obj.getBiObjectTypeCode());
      SbiDataSource dSource = null;
      if (obj.getDataSourceId() != null) {
        dSource = (SbiDataSource) aSession.load(SbiDataSource.class, obj.getDataSourceId());
      }
      hibBIObject.setDataSource(dSource);

      SbiDataSetConfig dSet= null;
      if (obj.getDataSetId() != null) {
        dSet = (SbiDataSetConfig) aSession.load(SbiDataSetConfig.class, obj.getDataSetId());
      }
      hibBIObject.setDataSet(dSet);

      Integer refreshSeconds=obj.getRefreshSeconds();
      if(refreshSeconds==null)refreshSeconds=new Integer(0);
      hibBIObject.setRefreshSeconds(refreshSeconds);

      // uuid generation
      UUIDGenerator uuidGenerator = UUIDGenerator.getInstance();
      UUID uuidObj = uuidGenerator.generateTimeBasedUUID();
      String uuid = uuidObj.toString();
      hibBIObject.setUuid(uuid);

      hibBIObject.setCreationDate(new Date());
      hibBIObject.setCreationUser(obj.getCreationUser());

      updateSbiCommonInfo4Insert(hibBIObject);
     
      // save biobject
      Integer id = (Integer) aSession.save(hibBIObject);
      idToReturn = id;
      // recover the saved hibernate object
      hibBIObject = (SbiObjects) aSession.load(SbiObjects.class, id);
      // functionalities storing
      Set hibObjFunc = new HashSet();
      List functionalities = obj.getFunctionalities();
      for (Iterator it = functionalities.iterator(); it.hasNext(); ) {
        Integer functId = (Integer) it.next();
        SbiFunctions aSbiFunctions = (SbiFunctions) aSession.load(SbiFunctions.class, functId);
        SbiObjFuncId aSbiObjFuncId = new SbiObjFuncId();
        aSbiObjFuncId.setSbiFunctions(aSbiFunctions);
        aSbiObjFuncId.setSbiObjects(hibBIObject);
        SbiObjFunc aSbiObjFunc = new SbiObjFunc(aSbiObjFuncId);
        updateSbiCommonInfo4Insert(aSbiObjFunc);
        aSession.save(aSbiObjFunc);
        hibObjFunc.add(aSbiObjFunc);
      }
      hibBIObject.setSbiObjFuncs(hibObjFunc)

      // we must close transaction before saving ObjTemplate, since ObjTemplateDAO opens a new transaction and it would fail in Ingres
      tx.commit();
      obj.setId(id);
View Full Code Here

Examples of it.eng.spagobi.analiticalmodel.document.metadata.SbiObjects

    Session aSession = null;
    Transaction tx = null;
    aSession = getSession();
    tx = aSession.beginTransaction();
    SbiSubreportsId hibSubreportid = new SbiSubreportsId();
    SbiObjects masterReport = (SbiObjects) aSession.load(SbiObjects.class, aSubreport.getMaster_rpt_id());
    SbiObjects subReport = (SbiObjects) aSession.load(SbiObjects.class, aSubreport.getSub_rpt_id());
    hibSubreportid.setMasterReport(masterReport);
    hibSubreportid.setSubReport(subReport);
    SbiSubreports hibSubreport = new SbiSubreports(hibSubreportid);
    updateSbiCommonInfo4Insert(hibSubreport);
    aSession.save(hibSubreport)
View Full Code Here

Examples of it.eng.spagobi.analiticalmodel.document.metadata.SbiObjects

    Transaction tx = null;
    try {
      aSession = getSession();
      tx = aSession.beginTransaction();
       
      SbiObjects hibBIObject = (SbiObjects)aSession.load(SbiObjects.class,  obj.getId());
      SbiObjectsRating hibBIObjectsRating = new SbiObjectsRating();
     
      hibBIObjectsRating = loadBIObjectRatingById(obj, userid);
      Integer newRating = new Integer(rating);
      if(newRating!= null && newRating.intValue()> 5){
View Full Code Here

Examples of it.eng.spagobi.analiticalmodel.document.metadata.SbiObjects

   *
   * @return the new hibernate biobject
   */
  public static SbiObjects makeNewSbiObject(SbiObjects obj){
    logger.debug("IN");
    SbiObjects newObj = new SbiObjects();
    newObj.setDescr(obj.getDescr());
    newObj.setEncrypt(obj.getEncrypt());
    newObj.setExecMode(obj.getExecMode());
    newObj.setExecModeCode(obj.getExecModeCode());
    newObj.setLabel(obj.getLabel());
    newObj.setName(obj.getName());
    newObj.setObjectType(obj.getObjectType());
    //newObj.setObjectTypeCode(obj.getObjectTypeCode());
    newObj.setPath(obj.getPath());
    newObj.setRelName(obj.getRelName());
    //newObj.setSbiEngines(obj.getSbiEngines());
    newObj.setSbiObjPars(new HashSet());
    newObj.setSbiObjFuncs(new HashSet());
    newObj.setSbiObjStates(new HashSet());
    newObj.setSchedFl(obj.getSchedFl());
    newObj.setState(obj.getState());
    newObj.setStateCode(obj.getStateCode());
    newObj.setStateConsideration(obj.getStateConsideration());
    newObj.setStateConsiderationCode(obj.getStateConsiderationCode());
    newObj.setVisible(obj.getVisible());
    newObj.setProfiledVisibility(obj.getProfiledVisibility());
    newObj.setUuid(obj.getUuid());
    newObj.setCreationDate(obj.getCreationDate());
    newObj.setCreationUser(obj.getCreationUser());
    newObj.setRefreshSeconds(obj.getRefreshSeconds());
    //newObj.setDataSource(obj.getDataSource());
    logger.debug("OUT");
    return newObj;
  }
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.