Examples of SbiObjMetacontents


Examples of it.eng.spagobi.tools.objmetadata.metadata.SbiObjMetacontents

    Transaction tx = null;

    try {
      aSession = getSession();
      tx = aSession.beginTransaction();
      SbiObjMetacontents hibContent = (SbiObjMetacontents)aSession.load(SbiObjMetacontents.class, id);
      toReturn = toObjMetacontent(hibContent);
      tx.rollback();
    } catch (HibernateException he) {
      logger.error("Error while loading the metadata content with id = " + id, he);     
      if (tx != null)
View Full Code Here

Examples of it.eng.spagobi.tools.objmetadata.metadata.SbiObjMetacontents

      aQuery.setInteger(0, objMetaId.intValue());
      aQuery.setInteger(1, biObjId.intValue());
      if(subObjId!=null){
        aQuery.setInteger(2, subObjId.intValue());
      }
      SbiObjMetacontents res =(SbiObjMetacontents) aQuery.uniqueResult();
      if(res!=null){
        realResult = toObjMetacontent(res);
      }
      tx.rollback();
    } catch (HibernateException he) {
View Full Code Here

Examples of it.eng.spagobi.tools.objmetadata.metadata.SbiObjMetacontents

    Criteria criteria = null;
    try {
      aSession = getSession();
      tx = aSession.beginTransaction();

      SbiObjMetacontents hibContents = (SbiObjMetacontents) aSession.load(SbiObjMetacontents.class,
          new Integer(aObjMetacontent.getObjMetacontentId()))

      // update biobject reference
      if (hibContents.getSbiObjects().getBiobjId() != aObjMetacontent.getBiobjId()) {
        aCriterion = Expression.eq("biobjId", aObjMetacontent.getBiobjId());
        criteria = aSession.createCriteria(SbiObjects.class);
        criteria.add(aCriterion);
        SbiObjects biobj = (SbiObjects) criteria.uniqueResult();
        hibContents.setSbiObjects(biobj);
      }

      // update subobject reference
      if (aObjMetacontent.getSubobjId() == null) {
        hibContents.setSbiSubObjects(null);
      } else {
        SbiSubObjects previousSubobject = hibContents.getSbiSubObjects();
        if (previousSubobject == null || previousSubobject.getSubObjId() != aObjMetacontent.getSubobjId()) {
          aCriterion = Expression.eq("subObjId", aObjMetacontent.getSubobjId());
          criteria = aSession.createCriteria(SbiSubObjects.class);
          criteria.add(aCriterion);
          SbiSubObjects subobj = (SbiSubObjects) criteria.uniqueResult();
          hibContents.setSbiSubObjects(subobj);
        }
      }
      updateSbiCommonInfo4Update(hibContents);
      // update content
      SbiBinContents binaryContent = hibContents.getSbiBinContents();
      if (binaryContent == null) {
        binaryContent = new SbiBinContents();
        binaryContent.setContent(aObjMetacontent.getContent());
      } else {
        binaryContent.setContent(aObjMetacontent.getContent());
      }
      updateSbiCommonInfo4Insert(binaryContent);
      aSession.save(binaryContent);
      hibContents.setSbiBinContents(binaryContent);

      // update metadata reference
      hibContents.setObjmetaId(aObjMetacontent.getObjmetaId());

      // update last change date
      hibContents.setLastChangeDate(aObjMetacontent.getLastChangeDate());

      tx.commit();
    } catch (HibernateException he) {
      logger.error("Error while modifing the meta content with id " + ((aObjMetacontent == null)?"":String.valueOf(aObjMetacontent.getObjMetacontentId())), he);
      if (tx != null)
View Full Code Here

Examples of it.eng.spagobi.tools.objmetadata.metadata.SbiObjMetacontents

    Criteria criteria = null;
    try {
      aSession = getSession();
      tx = aSession.beginTransaction();

      SbiObjMetacontents hibContents = new SbiObjMetacontents()

      // get biobject reference   
      aCriterion = Expression.eq("biobjId", aObjMetacontent.getBiobjId());
      criteria = aSession.createCriteria(SbiObjects.class);
      criteria.add(aCriterion);
      SbiObjects biobj = (SbiObjects) criteria.uniqueResult();
      hibContents.setSbiObjects(biobj);

      // get subobject reference
      if (aObjMetacontent.getSubobjId() == null) {
        hibContents.setSbiSubObjects(null);
      } else {
        aCriterion = Expression.eq("subObjId", aObjMetacontent.getSubobjId());
        criteria = aSession.createCriteria(SbiSubObjects.class);
        criteria.add(aCriterion);
        SbiSubObjects subobj = (SbiSubObjects) criteria.uniqueResult();
        hibContents.setSbiSubObjects(subobj);
      }

      SbiBinContents binaryContent = new SbiBinContents();
      binaryContent.setContent(aObjMetacontent.getContent());
      updateSbiCommonInfo4Insert(binaryContent);
      aSession.save(binaryContent);
      hibContents.setSbiBinContents(binaryContent);

      hibContents.setObjmetaId(aObjMetacontent.getObjmetaId());

      hibContents.setCreationDate(aObjMetacontent.getCreationDate());;
      hibContents.setLastChangeDate(aObjMetacontent.getLastChangeDate());
      updateSbiCommonInfo4Insert(hibContents);
      aSession.save(hibContents);
      tx.commit();
    } catch (HibernateException he) {
      logger.error("Error while inserting the metadata content with id " + ((aObjMetacontent == null)?"":String.valueOf(aObjMetacontent.getObjMetacontentId())), he);
View Full Code Here

Examples of it.eng.spagobi.tools.objmetadata.metadata.SbiObjMetacontents

    Session aSession = null;
    Transaction tx = null;
    try {
      aSession = getSession();
      tx = aSession.beginTransaction();
      SbiObjMetacontents hibContents = (SbiObjMetacontents) aSession.load(SbiObjMetacontents.class,
          new Integer(aObjMetacontent.getObjMetacontentId()));

      aSession.delete(hibContents);
      tx.commit();
    } catch (HibernateException he) {
View Full Code Here

Examples of it.eng.spagobi.tools.objmetadata.metadata.SbiObjMetacontents

   * @throws EMFUserError the EMF user error
   */
  public static SbiObjMetacontents modifyExistingSbiObjMetacontents(SbiObjMetacontents exportedMetacontents, Session sessionCurrDB,
      Integer existingId, MetadataAssociations metaAss, ImporterMetadata importer) throws EMFUserError {
    logger.debug("IN");
    SbiObjMetacontents existingMetacontents = null;
    try {
      // update Alarm
      existingMetacontents= (SbiObjMetacontents) sessionCurrDB.load(SbiObjMetacontents.class, existingId);

      existingMetacontents.setCreationDate(exportedMetacontents.getCreationDate());
      existingMetacontents.setLastChangeDate(exportedMetacontents.getLastChangeDate());

      // associations
      entitiesAssociationsSbiObjMetacontents(exportedMetacontents, existingMetacontents, sessionCurrDB, metaAss, importer);
    }

View Full Code Here

Examples of it.eng.spagobi.tools.objmetadata.metadata.SbiObjMetacontents

   *
   * @return the new hibernate parameter object
   */
  public static SbiObjMetacontents makeNewSbiObjMetacontent(SbiObjMetacontents metacontents,Session sessionCurrDB, MetadataAssociations metaAss, ImporterMetadata importer){
    logger.debug("IN");
    SbiObjMetacontents newMetacontents = new SbiObjMetacontents();
    try{
      newMetacontents.setCreationDate(metacontents.getCreationDate());
      newMetacontents.setLastChangeDate(metacontents.getLastChangeDate());
      // associations
      entitiesAssociationsSbiObjMetacontents(metacontents, newMetacontents, sessionCurrDB, metaAss, importer);

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

Examples of it.eng.spagobi.tools.objmetadata.metadata.SbiObjMetacontents

        insertBinContet(objMetacontent.getBinaryContentId(), content, session);
      }

      Transaction tx = session.beginTransaction();

      SbiObjMetacontents hibObjMetacontents = new SbiObjMetacontents();

      hibObjMetacontents.setObjMetacontentId(objMetacontent.getObjMetacontentId());
      hibObjMetacontents.setCreationDate(objMetacontent.getCreationDate());
      hibObjMetacontents.setLastChangeDate(objMetacontent.getLastChangeDate());
      hibObjMetacontents.setObjmetaId(objMetacontent.getObjmetaId());

      // get the object to insert if present
      if (objMetacontent.getBiobjId() != null) {
        SbiObjects sbiObjects = (SbiObjects) session.load(SbiObjects.class, objMetacontent.getBiobjId());
        hibObjMetacontents.setSbiObjects(sbiObjects);
        logger.debug("inserted sbi " + objMetacontent.getBiobjId() + " Object metacontent");
      }
      // get the sub object to insert if present
      if (objMetacontent.getSubobjId() != null) {
        SbiSubObjects sbiSubObjects = (SbiSubObjects) session.load(SbiSubObjects.class, objMetacontent.getSubobjId());
        hibObjMetacontents.setSbiSubObjects(sbiSubObjects);
        logger.debug("inserted sbi " + objMetacontent.getSubobjId() + " SubObject metacontent");
      }
      // get the content
      if (objMetacontent.getBinaryContentId() != null) {
        SbiBinContents sbiBinContents = (SbiBinContents) session.load(SbiBinContents.class, objMetacontent.getBinaryContentId());
        hibObjMetacontents.setSbiBinContents(sbiBinContents);
        // insert the binary content!!       
        logger.debug("inserted sbi " + objMetacontent.getBinaryContentId() + " Binary Content metacontent");
      }

      session.save(hibObjMetacontents);
View Full Code Here

Examples of it.eng.spagobi.tools.objmetadata.metadata.SbiObjMetacontents

    " AND so.objmetaId ='"+ idMeta +"'";     
    //    }


    hqlQuery = sessionCurrDB.createQuery(hql);
    SbiObjMetacontents hibMetacontents = (SbiObjMetacontents) hqlQuery.uniqueResult();

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

Examples of it.eng.spagobi.tools.objmetadata.metadata.SbiObjMetacontents

    logger.debug("check existence of Object MetaContent, only for Objects!");
    List exportedMetaContent = importer.getAllExportedSbiObjects(sessionExpDB, "SbiObjMetacontents", null);
    Iterator iterSbiModMetaContent = exportedMetaContent.iterator();
    while (iterSbiModMetaContent.hasNext()) {
      SbiObjMetacontents contExp = (SbiObjMetacontents) iterSbiModMetaContent.next();
      String objectLabel = contExp.getSbiObjects().getLabel();
      // metacontent referring to subobjects not referred here because of a previous structure
      if( contExp.getSbiSubObjects() != null ){
        continue;
        //        SbiSubObjects sub = contExp.getSbiSubObjects();
        //        subObjectName = sub.getName();
      }
      Integer objMetaId = contExp.getObjmetaId();

      // I want metadata label
      String metaLabel = exportedMetadatasMap.get(objMetaId.toString());

      Object existObj = importer.checkExistenceObjMetacontent(objectLabel,metaLabel, sessionCurrDB, new SbiObjMetacontents());
      if (existObj != null) {
        SbiObjMetacontents contCurr = (SbiObjMetacontents) existObj;
        //metaAss.insertCoupleObjMeIDAssociation(metaExp.getKpiModelResourcesId(), metaCurr.getKpiModelResourcesId());       
        metaAss.insertCoupleObjMetacontentsIDAssociation(contExp.getObjMetacontentId(), contCurr.getObjMetacontentId());
        metaLog.log("Found an existing metacontents with id " + contCurr.getObjMetacontentId()+ "" +
            "referring to the same object label "+contCurr.getSbiObjects().getLabel()+", " +
            "referring to meta with id "+ contCurr.getObjmetaId()
        );
      }
    }
    // Kpi Relations
    List exportedKpiRelList = importer.getAllExportedSbiObjects(sessionExpDB, "SbiKpiRel", null);
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.