Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShawn F. Cook2011-08-02 20:05:40 +0000
committerRyan D. Brooks2011-08-02 20:05:40 +0000
commitdad30d551e147defe4d124ec94b7c6aa704b08cf (patch)
treedf00bdb845c0acdda98346d6650f1b25c749ad25 /plugins/org.eclipse.osee.framework.core.datastore
parenta75fa5b6a515a19ae050b72a1d53ce1abc8b40c8 (diff)
downloadorg.eclipse.osee-dad30d551e147defe4d124ec94b7c6aa704b08cf.tar.gz
org.eclipse.osee-dad30d551e147defe4d124ec94b7c6aa704b08cf.tar.xz
org.eclipse.osee-dad30d551e147defe4d124ec94b7c6aa704b08cf.zip
refinement[bgz_350331]: Migrate PurgeTransactionBlam to server side command line
Diffstat (limited to 'plugins/org.eclipse.osee.framework.core.datastore')
-rw-r--r--plugins/org.eclipse.osee.framework.core.datastore/src/org/eclipse/osee/framework/core/datastore/cache/DatabaseTransactionRecordAccessor.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/plugins/org.eclipse.osee.framework.core.datastore/src/org/eclipse/osee/framework/core/datastore/cache/DatabaseTransactionRecordAccessor.java b/plugins/org.eclipse.osee.framework.core.datastore/src/org/eclipse/osee/framework/core/datastore/cache/DatabaseTransactionRecordAccessor.java
index b48433467d8..40bcf83fad6 100644
--- a/plugins/org.eclipse.osee.framework.core.datastore/src/org/eclipse/osee/framework/core/datastore/cache/DatabaseTransactionRecordAccessor.java
+++ b/plugins/org.eclipse.osee.framework.core.datastore/src/org/eclipse/osee/framework/core/datastore/cache/DatabaseTransactionRecordAccessor.java
@@ -43,6 +43,9 @@ public class DatabaseTransactionRecordAccessor implements ITransactionDataAccess
private static final String SELECT_TRANSACTIONS_BY_QUERY_ID =
"select * from osee_tx_details txd, osee_join_id oji where txd.transaction_id = oji.id and oji.query_id = ?";
+ private static final String GET_PRIOR_TRANSACTION =
+ "select transaction_id FROM osee_tx_details where branch_id = ? and transaction_id < ? order by transaction_id desc";
+
private final IOseeDatabaseService oseeDatabaseService;
private final BranchCache branchCache;
private final TransactionRecordFactory factory;
@@ -155,4 +158,11 @@ public class DatabaseTransactionRecordAccessor implements ITransactionDataAccess
public void load(TransactionCache transactionCache) throws OseeCoreException {
// Not implemented
}
+
+ @Override
+ public TransactionRecord getOrLoadPriorTransaction(TransactionCache cache, int transactionNumber, int branchId) throws OseeCoreException {
+ int priorTransactionId =
+ oseeDatabaseService.runPreparedQueryFetchObject(-1, GET_PRIOR_TRANSACTION, branchId, transactionNumber);
+ return cache.getOrLoad(priorTransactionId);
+ }
}

Back to the top