Package com.cloud.bridge.model

Examples of com.cloud.bridge.model.SMeta


    Session session;

    session = CloudSessionFactory.getInstance().openSession();
      try {
      Transaction txn = session.beginTransaction();
        SMeta meta = new SMeta();
        meta.setTarget("SObject");
        meta.setTargetId(1);
        meta.setName("param1");
        meta.setValue("value1");
        session.save(meta);
       
        logger.info("Meta 1: " + meta.getId());
       
        meta = new SMeta();
        meta.setTarget("SObject");
        meta.setTargetId(1);
        meta.setName("param2");
        meta.setValue("value2");
        session.save(meta);
       
        logger.info("Meta 2: " + meta.getId());
       
        txn.commit();
      } finally {
        session.close();
      }
     
      session = CloudSessionFactory.getInstance().openSession();
      try {
      Transaction txn = session.beginTransaction();
        Query query = session.createQuery("from SMeta where target=? and targetId=?");
        QueryHelper.bindParameters(query, new Object[] {
          "SObject", new Long(1)
        });
        List<SMeta> l = QueryHelper.executeQuery(query);
        txn.commit();
       
        for(SMeta meta: l) {
          logger.info("" + meta.getName() + "=" + meta.getValue());
        }
      } finally {
        session.close();
      }
     
View Full Code Here


    Session session;

    session = CloudSessionFactory.getInstance().openSession();
      try {
      Transaction txn = session.beginTransaction();
        SMeta meta = new SMeta();
        meta.setTarget("SObject");
        meta.setTargetId(1);
        meta.setName("param1");
        meta.setValue("value1");
        session.save(meta);
       
        logger.info("Meta 1: " + meta.getId());
       
        meta = new SMeta();
        meta.setTarget("SObject");
        meta.setTargetId(1);
        meta.setName("param2");
        meta.setValue("value2");
        session.save(meta);
       
        logger.info("Meta 2: " + meta.getId());
       
        txn.commit();
      } finally {
        session.close();
      }
     
      session = CloudSessionFactory.getInstance().openSession();
      try {
      Transaction txn = session.beginTransaction();
        Query query = session.createQuery("from SMeta where target=? and targetId=?");
        QueryHelper.bindParameters(query, new Object[] {
          "SObject", new Long(1)
        });
        List<SMeta> l = QueryHelper.executeQuery(query);
        txn.commit();
       
        for(SMeta meta: l) {
          logger.info("" + meta.getName() + "=" + meta.getValue());
        }
      } finally {
        session.close();
      }
     
View Full Code Here

    {
      int i = 0;
      S3MetaDataEntry[] metaEntries = new S3MetaDataEntry[ itemMetaData.size() ];
        ListIterator it = itemMetaData.listIterator();
        while( it.hasNext()) {
          SMeta oneTag = (SMeta)it.next();
          S3MetaDataEntry oneEntry = new S3MetaDataEntry();
          oneEntry.setName( oneTag.getName());
          oneEntry.setValue( oneTag.getValue());
          metaEntries[i++] = oneEntry;
        }
        response.setMetaEntries( metaEntries );
    }
       
View Full Code Here

      List<SMeta> itemMetaData = metaDao.getByTarget( "SObjectItem", itemId );
      if (null != itemMetaData)
      {
          ListIterator it = itemMetaData.listIterator();
        while( it.hasNext()) {
           SMeta oneTag = (SMeta)it.next();
           metaDao.delete( oneTag );
        }
    }
  }
View Full Code Here

  public List<SMeta> getByTarget(String target, long targetId) {
    return queryEntities("from SMeta where target=? and targetId=?", new Object[] {target, targetId});
  }

  public SMeta save(String target, long targetId, S3MetaDataEntry entry) {
    SMeta meta = new SMeta();
    meta.setTarget(target);
    meta.setTargetId(targetId);
    meta.setName(entry.getName());
    meta.setValue(entry.getValue());
   
    PersistContext.getSession().save(meta);
    return meta;
  }
View Full Code Here

TOP

Related Classes of com.cloud.bridge.model.SMeta

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.