Search in sources :

Example 6 with TransactionQueryEntity

use of org.alfresco.repo.domain.node.TransactionQueryEntity in project alfresco-repository by Alfresco.

the class NodeDAOImpl method selectTxnsUnused.

@Override
protected List<Long> selectTxnsUnused(Long minTxnId, Long maxCommitTime, Integer count) {
    TransactionQueryEntity query = new TransactionQueryEntity();
    query.setMinId(minTxnId);
    query.setMaxCommitTime(maxCommitTime);
    if (count == null) {
        return template.selectList(SELECT_TXNS_UNUSED, query);
    } else {
        return template.selectList(SELECT_TXNS_UNUSED, query, new RowBounds(0, count));
    }
}
Also used : TransactionQueryEntity(org.alfresco.repo.domain.node.TransactionQueryEntity) RowBounds(org.apache.ibatis.session.RowBounds)

Example 7 with TransactionQueryEntity

use of org.alfresco.repo.domain.node.TransactionQueryEntity in project alfresco-repository by Alfresco.

the class NodeDAOImpl method selectTxnById.

@Override
protected Transaction selectTxnById(Long txnId) {
    TransactionQueryEntity query = new TransactionQueryEntity();
    query.setId(txnId);
    return template.selectOne(SELECT_TXNS, query);
}
Also used : TransactionQueryEntity(org.alfresco.repo.domain.node.TransactionQueryEntity)

Example 8 with TransactionQueryEntity

use of org.alfresco.repo.domain.node.TransactionQueryEntity in project alfresco-repository by Alfresco.

the class NodeDAOImpl method selectMinTxnCommitTimeForDeletedNodes.

@Override
protected Long selectMinTxnCommitTimeForDeletedNodes() {
    // Get the deleted nodes
    Pair<Long, QName> deletedTypePair = qnameDAO.getQName(ContentModel.TYPE_DELETED);
    if (deletedTypePair == null) {
        // Nothing to do
        return LONG_ZERO;
    }
    TransactionQueryEntity txnQuery = new TransactionQueryEntity();
    txnQuery.setTypeQNameId(deletedTypePair.getFirst());
    return (Long) template.selectOne(SELECT_TXN_MIN_COMMIT_TIME_FOR_NODE_TYPE, txnQuery);
}
Also used : QName(org.alfresco.service.namespace.QName) TransactionQueryEntity(org.alfresco.repo.domain.node.TransactionQueryEntity)

Example 9 with TransactionQueryEntity

use of org.alfresco.repo.domain.node.TransactionQueryEntity in project alfresco-repository by Alfresco.

the class NodeDAOImpl method selectLastTxnBeforeCommitTime.

@Override
protected Transaction selectLastTxnBeforeCommitTime(Long maxCommitTime) {
    Assert.notNull(maxCommitTime, "maxCommitTime");
    TransactionQueryEntity query = new TransactionQueryEntity();
    query.setMaxCommitTime(maxCommitTime);
    List<Transaction> txns = template.selectList(SELECT_TXN_LAST, query, new RowBounds(0, 1));
    if (txns.size() > 0) {
        return txns.get(0);
    } else {
        return null;
    }
}
Also used : Transaction(org.alfresco.repo.domain.node.Transaction) TransactionQueryEntity(org.alfresco.repo.domain.node.TransactionQueryEntity) RowBounds(org.apache.ibatis.session.RowBounds)

Example 10 with TransactionQueryEntity

use of org.alfresco.repo.domain.node.TransactionQueryEntity in project alfresco-repository by Alfresco.

the class NodeDAOImpl method selectTxnChanges.

@Override
protected List<NodeEntity> selectTxnChanges(Long txnId, Long storeId) {
    TransactionQueryEntity query = new TransactionQueryEntity();
    query.setId(txnId);
    if (storeId != null) {
        query.setStoreId(storeId);
    }
    // TODO: Return List<Node> for quicker node_deleted access
    return template.selectList(SELECT_TXN_NODES, query);
}
Also used : TransactionQueryEntity(org.alfresco.repo.domain.node.TransactionQueryEntity)

Aggregations

TransactionQueryEntity (org.alfresco.repo.domain.node.TransactionQueryEntity)10 QName (org.alfresco.service.namespace.QName)3 RowBounds (org.apache.ibatis.session.RowBounds)3 HashMap (java.util.HashMap)1 Map (java.util.Map)1 Transaction (org.alfresco.repo.domain.node.Transaction)1 Pair (org.alfresco.util.Pair)1 DefaultResultContext (org.apache.ibatis.executor.result.DefaultResultContext)1 ResultContext (org.apache.ibatis.session.ResultContext)1 ResultHandler (org.apache.ibatis.session.ResultHandler)1