Package org.infoglue.cms.entities.management

Examples of org.infoglue.cms.entities.management.TransactionHistory


      oql.bind(entityId);
      QueryResults results = oql.execute(Database.READONLY);

      if (results.hasMore())
      {
        TransactionHistory transactionHistory = (TransactionHistory)results.next();
        transactionHistoryVO = transactionHistory.getValueObject();
      }
     
      results.close();
      oql.close();
View Full Code Here


     
      int currentRow = 0;
        QueryResults results = oql.execute(Database.READONLY);
      while(results.hasMore() && currentRow < rowLimit)
      {
        TransactionHistory transactionHistory = (TransactionHistory)results.next();
        //transactionHistoryVO = transactionHistory.getValueObject();
        resultList.add(transactionHistory.getValueObject());
        currentRow++;
      }
     
      results.close();
      oql.close();
View Full Code Here

    public TransactionHistoryVO update(TransactionHistoryVO transactionHistoryVO) throws ConstraintException, SystemException
    {
        Database db = CastorDatabaseService.getDatabase();
        ConstraintExceptionBuffer ceb = new ConstraintExceptionBuffer();

        TransactionHistory transactionHistory = null;

        beginTransaction(db);

        try
        {
            //add validation here if needed
            transactionHistory = getTransactionHistoryWithId(transactionHistoryVO.getTransactionHistoryId(), db);
            transactionHistory.setValueObject(transactionHistoryVO);

            //If any of the validations or setMethods reported an error, we throw them up now before create.
            ceb.throwIfNotEmpty();
           
            commitTransaction(db);
        }
        catch(ConstraintException ce)
        {
            logger.warn("An error occurred so we should not complete the transaction:" + ce, ce);
            rollbackTransaction(db);
            throw ce;
        }
        catch(Exception e)
        {
            logger.error("An error occurred so we should not complete the transaction:" + e, e);
            rollbackTransaction(db);
            throw new SystemException(e.getMessage());
        }

        return transactionHistory.getValueObject();
    }       
View Full Code Here

 
  public Integer create(NotificationMessage notificationMessage) throws SystemException
  {
    logger.info("Creating a transactionHistory object...");
        Database db = CastorDatabaseService.getDatabase();
        TransactionHistory transactionHistory = null;

        try
        {
          beginTransaction(db);
      logger.info("Began transaction...");
         
            TransactionHistoryVO transVO = new TransactionHistoryVO()
            transactionHistory = new TransactionHistoryImpl();

            transVO.setName(notificationMessage.getName());
            transVO.setSystemUserName(notificationMessage.getSystemUserName());
            transVO.setTransactionDateTime(java.util.Calendar.getInstance().getTime());
            transVO.setTransactionTypeId(new Integer(notificationMessage.getType()));
            transVO.setTransactionObjectId(notificationMessage.getObjectId().toString());
            transVO.setTransactionObjectName(notificationMessage.getObjectName());
           
      transactionHistory.setValueObject(transVO)
      if(logger.isInfoEnabled())
      {
        logger.info("Created the transaction object and filled it with values...");
        logger.info("transactionHistory.getId():" + transactionHistory.getId());
        logger.info("transactionHistory.getName():" + transactionHistory.getName());
        logger.info("transactionHistory.getSystemUserName():" + transactionHistory.getSystemUserName());
        logger.info("transactionHistory.getTransactionDateTime():" + transactionHistory.getTransactionDateTime());
        logger.info("transactionHistory.getTransactionObjectId():" + transactionHistory.getTransactionObjectId());
        logger.info("transactionHistory.getTransactionObjectName():" + transactionHistory.getTransactionObjectName());
        logger.info("transactionHistory.getTransactionTypeId():" + transactionHistory.getTransactionTypeId());
        logger.info("isActive=" + db.isActive());
      }
     
      db.create(transactionHistory);
      logger.info("Created the transaction object in the database..");
           
            commitTransaction(db);
            logger.info("Committed the transaction..");
        }
        catch(Exception e)
        {
            logger.info("An error occurred so we should not complete the transaction:" + e, e);
      rollbackTransaction(db);
      return null;
        }

    logger.info("TransactionHistory object all done..");

        return transactionHistory.getValueObject().getTransactionHistoryId();
  }
View Full Code Here

TOP

Related Classes of org.infoglue.cms.entities.management.TransactionHistory

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.