Search in sources :

Example 1 with TransactionDependencySweeperView

use of org.jaffa.transaction.domain.TransactionDependencySweeperView in project jaffa-framework by jaffa-projects.

the class JaffaTransactionMessageService method getDependencySweeperViewsIfOpenNoDependsOnTx.

/**
 * Returns all of the TransactionDependencySweeperViews of the TransactionDependencies in the Open state that have
 * no dependsOn Transaction or have a dependsOn Transaction in the S state.
 * The TransactionDependencySweeperView is a subset of the TransactionDependency model.
 *
 * @return all TransactionSweeperViews created from the Transactions in the Hold state that have
 *         no TransactionDependency in the Open state.
 * @throws FrameworkException
 */
@Override
public Collection<TransactionDependencySweeperView> getDependencySweeperViewsIfOpenNoDependsOnTx() throws FrameworkException {
    UOW uow = null;
    Collection<TransactionDependencySweeperView> results = new ArrayList<TransactionDependencySweeperView>();
    try {
        uow = new UOW();
        Criteria criteria = new Criteria();
        criteria.setTable(TransactionDependencySweeperViewMeta.getName());
        // create a list of transactionDependencySweeperViews from the results
        for (Object result : uow.query(criteria)) {
            if (!(result instanceof TransactionDependencySweeperView)) {
                continue;
            }
            results.add((TransactionDependencySweeperView) result);
        }
    } finally {
        if (uow != null) {
            uow.close();
        }
    }
    return results;
}
Also used : TransactionDependencySweeperView(org.jaffa.transaction.domain.TransactionDependencySweeperView) ArrayList(java.util.ArrayList) Criteria(org.jaffa.persistence.Criteria) TransactionFieldCriteria(org.jaffa.transaction.apis.data.TransactionFieldCriteria) AtomicCriteria(org.jaffa.persistence.AtomicCriteria) TransactionCriteria(org.jaffa.transaction.apis.data.TransactionCriteria) UOW(org.jaffa.persistence.UOW)

Aggregations

ArrayList (java.util.ArrayList)1 AtomicCriteria (org.jaffa.persistence.AtomicCriteria)1 Criteria (org.jaffa.persistence.Criteria)1 UOW (org.jaffa.persistence.UOW)1 TransactionCriteria (org.jaffa.transaction.apis.data.TransactionCriteria)1 TransactionFieldCriteria (org.jaffa.transaction.apis.data.TransactionFieldCriteria)1 TransactionDependencySweeperView (org.jaffa.transaction.domain.TransactionDependencySweeperView)1