Examples of SbiObjMetadata


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

    Transaction tx = null;

    try {
      aSession = getSession();
      tx = aSession.beginTransaction();
      SbiObjMetadata hibDataSource = (SbiObjMetadata)aSession.load(SbiObjMetadata.class,  id);
      toReturn = toObjMetadata(hibDataSource);
      tx.commit();
     
    } catch (HibernateException he) {
      logger.error("Error while loading the metadata with id " + id.toString(), he);     
View Full Code Here

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

      tmpSession = getSession();
      tx = tmpSession.beginTransaction();
      Criterion labelCriterrion = Expression.eq("label", label);
      Criteria criteria = tmpSession.createCriteria(SbiObjMetadata.class);
      criteria.add(labelCriterrion)
      SbiObjMetadata hibMeta = (SbiObjMetadata) criteria.uniqueResult();
      if (hibMeta == null) return null;
      toReturn = toObjMetadata(hibMeta);       
     
      tx.commit();
    } catch (HibernateException he) {
View Full Code Here

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

      if (dataType == null){
        logger.error("The Domain with value_id= "+aObjMetadata.getDataType()+" does not exist.");
        throw new EMFUserError(EMFErrorSeverity.ERROR, 1035);
      }
     
      SbiObjMetadata hibMeta = (SbiObjMetadata)aSession.load(SbiObjMetadata.class, aObjMetadata.getObjMetaId());
      hibMeta.setLabel(aObjMetadata.getLabel());
      hibMeta.setName(aObjMetadata.getName());
      hibMeta.setDescription(aObjMetadata.getDescription());
      hibMeta.setDataType(dataType);
      updateSbiCommonInfo4Update(hibMeta);
      tx.commit();
    } catch (HibernateException he) {
      logException(he);
      if (tx != null)
View Full Code Here

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

        logger.error("The Domain with value_id= "+aObjMetadata.getDataType()+" does not exist.");
        throw new EMFUserError(EMFErrorSeverity.ERROR, 1035);
      }
      Date now = new Date();
      // store the object note
      SbiObjMetadata hibMeta = new SbiObjMetadata();
      hibMeta.setLabel(aObjMetadata.getLabel());
      hibMeta.setName(aObjMetadata.getName());
      hibMeta.setDescription(aObjMetadata.getDescription());
      hibMeta.setDataType(dataType);
      hibMeta.setCreationDate(now);
      updateSbiCommonInfo4Insert(hibMeta);
      aSession.save(hibMeta);
      tx.commit();
    } catch (HibernateException he) {
      logException(he);
View Full Code Here

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

    Session aSession = null;
    Transaction tx = null;
    try {
      aSession = getSession();
      tx = aSession.beginTransaction();
      SbiObjMetadata hibMeta = (SbiObjMetadata) aSession.load(SbiObjMetadata.class,
          new Integer(aObjMetadata.getObjMetaId()));
     
      //delete metadatacontents eventually associated
      List metaContents = DAOFactory.getObjMetacontentDAO().loadAllObjMetacontent();
      IObjMetacontentDAO objMetaContentDAO = DAOFactory.getObjMetacontentDAO();
      if (metaContents != null && !metaContents.isEmpty()) {
        Iterator it = metaContents.iterator();
        while (it.hasNext()) {
          ObjMetacontent objMetadataCont = (ObjMetacontent) it.next();
          if(objMetadataCont!=null && objMetadataCont.getObjmetaId().equals(hibMeta.getObjMetaId())){
            objMetaContentDAO.eraseObjMetadata(objMetadataCont);
          }
        }
      }     
View Full Code Here

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

   * @return the new hibernate parameter object
   */
  public static SbiObjMetadata makeNewSbiObjMetadata(SbiObjMetadata objMetadata,Session sessionCurrDB,
      MetadataAssociations metaAss, ImporterMetadata importer){
    logger.debug("IN");
    SbiObjMetadata newObjMetadata = new SbiObjMetadata();
    try{
      newObjMetadata.setLabel(objMetadata.getLabel());
      newObjMetadata.setName(objMetadata.getName());
      newObjMetadata.setDescription(objMetadata.getDescription());
      newObjMetadata.setCreationDate(objMetadata.getCreationDate());

      // associations
      entitiesAssociationsSbiObjMetadata(objMetadata, newObjMetadata, sessionCurrDB, metaAss, importer);

      logger.debug("OUT");
    }
    catch (Exception e) {
      logger.error("Error inc reating new ObjMetadata with label "+newObjMetadata.getLabel());     
    }
    finally{

    }
    return newObjMetadata;
View Full Code Here

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

   * @throws EMFUserError the EMF user error
   */
  public static SbiObjMetadata modifyExistingSbiObjMetadata(SbiObjMetadata exportedObjMetadata, Session sessionCurrDB,
      Integer existingId, MetadataAssociations metaAss, ImporterMetadata importer) throws EMFUserError {
    logger.debug("IN");
    SbiObjMetadata existingObjMetadata = null;
    try {
      existingObjMetadata= (SbiObjMetadata) sessionCurrDB.load(SbiObjMetadata.class, existingId);

      existingObjMetadata.setName(exportedObjMetadata.getName());
      existingObjMetadata.setDescription(exportedObjMetadata.getDescription());
      existingObjMetadata.setCreationDate(exportedObjMetadata.getCreationDate());

      // overwrite existging entities (maybe create a function speciic for domains, maybe not)
      entitiesAssociationsSbiObjMetadata(exportedObjMetadata, existingObjMetadata, sessionCurrDB, metaAss, importer);

    }
View Full Code Here

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

      Query hibQuery = session.createQuery(" from SbiObjMetadata where objMetaId = " + objMetadata.getObjMetaId());
      List hibList = hibQuery.list();
      if(!hibList.isEmpty()) {
        return;
      }
      SbiObjMetadata hibObjMeta = new SbiObjMetadata();
      hibObjMeta.setObjMetaId(objMetadata.getObjMetaId());
      hibObjMeta.setCreationDate(objMetadata.getCreationDate());
      hibObjMeta.setDescription(objMetadata.getDescription());
      hibObjMeta.setLabel(objMetadata.getLabel());
      hibObjMeta.setName(objMetadata.getName());

      if(objMetadata.getDataType() != null){
        SbiDomains dataType=(SbiDomains)session.load(SbiDomains.class, objMetadata.getDataType());
        hibObjMeta.setDataType(dataType);
      }

      session.save(hibObjMeta);
      tx.commit();
    } catch (Exception e) {
View Full Code Here

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

    }
    else if (hibObj instanceof SbiObjMetadata) {
      String metaName = (String) unique;
      hql = "from SbiObjMetadata er where er.label = '" + metaName + "'";
      hqlQuery = sessionCurrDB.createQuery(hql);
      SbiObjMetadata hibMeta = (SbiObjMetadata) hqlQuery.uniqueResult();
      return hibMeta;   
    }else if (hibObj instanceof SbiKpiRel) {
      Map uniqueMap = (Map) unique;
      Integer fatherId = (Integer) uniqueMap.get("fatherId");
      Integer childId = (Integer) uniqueMap.get("childId");
View Full Code Here

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

    // get Metadata
    logger.debug("get metadata with label "+metaLabel);
    hql = "from SbiObjMetadata s where s.label = '" + metaLabel + "'";
    hqlQuery = sessionCurrDB.createQuery(hql);
    SbiObjMetadata hibMetadata = (SbiObjMetadata) hqlQuery.uniqueResult();
    if(hibMetadata==null) return null;
    Integer idMeta = hibMetadata.getObjMetaId();
    logger.debug("Id meta is "+idMeta);


    // check now if association exists
    logger.debug("Get metacontent with label "+objLabel+", metaId "+idMeta);
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.