Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrescobar2010-11-03 17:39:53 +0000
committerRyan D. Brooks2010-11-03 17:39:53 +0000
commit489952c3cc822596638d3ecb7d3c793af77e646c (patch)
tree961a6c22bb180d63da3aac0145d8cd6136a75999
parentcbf64db559f231e2432182f2a9ebf53b15dc652a (diff)
downloadorg.eclipse.osee-489952c3cc822596638d3ecb7d3c793af77e646c.tar.gz
org.eclipse.osee-489952c3cc822596638d3ecb7d3c793af77e646c.tar.xz
org.eclipse.osee-489952c3cc822596638d3ecb7d3c793af77e646c.zip
refactor: Split JoinUtility into top-level classes
Separate database access for testability Add getAllQueryIds to base join query class Remove getAllTagQueuQueryIds from JoinUtility Remove JoinUtility.deleteQuery methods
-rw-r--r--plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/change/ChangeItemLoader.java2
-rw-r--r--plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/change/LoadDeltasBetweenBranches.java4
-rw-r--r--plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/change/LoadDeltasBetweenTxsOnTheSameBranch.java4
-rw-r--r--plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/commit/UpdatePreviousTxCurrent.java37
-rw-r--r--plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/exchange/ExportController.java2
-rw-r--r--plugins/org.eclipse.osee.framework.core.datastore/src/org/eclipse/osee/framework/core/datastore/cache/DatabaseTransactionRecordAccessor.java2
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/AbstractJoinQuery.java118
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/ArtifactJoinQuery.java65
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/CharJoinQuery.java50
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/DatabaseJoinAccessor.java142
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/ExportImportJoinQuery.java64
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/IJoinAccessor.java28
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/IdJoinQuery.java62
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/JoinUtility.java565
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/SearchTagJoinQuery.java62
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/TagQueueJoinQuery.java62
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/TransactionJoinQuery.java85
-rw-r--r--plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/operation/ConsolidateArtifactVersionTxOperation.java2
-rw-r--r--plugins/org.eclipse.osee.framework.search.engine.test/src/org/eclipse/osee/framework/search/engine/test/utility/SearchTagDataStoreTest.java2
-rw-r--r--plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/attribute/AttributeDataStore.java2
-rw-r--r--plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/internal/tagger/InputToTagQueueTx.java2
-rw-r--r--plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/internal/tagger/StartUpRunnable.java6
-rw-r--r--plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/internal/tagger/TaggerRunnable.java8
-rw-r--r--plugins/org.eclipse.osee.framework.server.admin/src/org/eclipse/osee/framework/server/admin/search/TagItemWorker.java2
-rw-r--r--plugins/org.eclipse.osee.framework.server.admin/src/org/eclipse/osee/framework/server/admin/search/TaggerAllWorker.java2
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/ArtifactQueryBuilder.java2
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/AttributeCriteria.java2
-rw-r--r--plugins/org.eclipse.osee.framework.ui.branch.graph/src/org/eclipse/osee/framework/ui/branch/graph/model/GraphLoader.java2
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/ConsolidateRelationsTxOperation.java2
29 files changed, 813 insertions, 575 deletions
diff --git a/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/change/ChangeItemLoader.java b/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/change/ChangeItemLoader.java
index 8fc6c3c74a0..3081d952298 100644
--- a/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/change/ChangeItemLoader.java
+++ b/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/change/ChangeItemLoader.java
@@ -20,7 +20,7 @@ import org.eclipse.osee.framework.core.message.ChangeItem;
import org.eclipse.osee.framework.core.message.RelationChangeItem;
import org.eclipse.osee.framework.database.IOseeDatabaseServiceProvider;
import org.eclipse.osee.framework.database.core.IOseeStatement;
-import org.eclipse.osee.framework.database.core.JoinUtility.IdJoinQuery;
+import org.eclipse.osee.framework.database.core.IdJoinQuery;
/**
* @author Roberto E. Escobar
diff --git a/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/change/LoadDeltasBetweenBranches.java b/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/change/LoadDeltasBetweenBranches.java
index 4f426a64c53..6ab82de5826 100644
--- a/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/change/LoadDeltasBetweenBranches.java
+++ b/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/change/LoadDeltasBetweenBranches.java
@@ -25,9 +25,9 @@ import org.eclipse.osee.framework.core.operation.AbstractOperation;
import org.eclipse.osee.framework.core.util.Conditions;
import org.eclipse.osee.framework.database.IOseeDatabaseServiceProvider;
import org.eclipse.osee.framework.database.core.IOseeStatement;
+import org.eclipse.osee.framework.database.core.IdJoinQuery;
import org.eclipse.osee.framework.database.core.JoinUtility;
-import org.eclipse.osee.framework.database.core.JoinUtility.IdJoinQuery;
-import org.eclipse.osee.framework.database.core.JoinUtility.TransactionJoinQuery;
+import org.eclipse.osee.framework.database.core.TransactionJoinQuery;
/**
* @author Ryan D. Brooks
diff --git a/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/change/LoadDeltasBetweenTxsOnTheSameBranch.java b/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/change/LoadDeltasBetweenTxsOnTheSameBranch.java
index 77f54e26e51..b0a6e345a17 100644
--- a/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/change/LoadDeltasBetweenTxsOnTheSameBranch.java
+++ b/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/change/LoadDeltasBetweenTxsOnTheSameBranch.java
@@ -23,9 +23,9 @@ import org.eclipse.osee.framework.core.operation.AbstractOperation;
import org.eclipse.osee.framework.core.util.Conditions;
import org.eclipse.osee.framework.database.IOseeDatabaseServiceProvider;
import org.eclipse.osee.framework.database.core.IOseeStatement;
+import org.eclipse.osee.framework.database.core.IdJoinQuery;
import org.eclipse.osee.framework.database.core.JoinUtility;
-import org.eclipse.osee.framework.database.core.JoinUtility.IdJoinQuery;
-import org.eclipse.osee.framework.database.core.JoinUtility.TransactionJoinQuery;
+import org.eclipse.osee.framework.database.core.TransactionJoinQuery;
/**
* @author Ryan D. Brooks
diff --git a/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/commit/UpdatePreviousTxCurrent.java b/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/commit/UpdatePreviousTxCurrent.java
index 069dafb6e64..b490efdb9bd 100644
--- a/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/commit/UpdatePreviousTxCurrent.java
+++ b/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/commit/UpdatePreviousTxCurrent.java
@@ -14,39 +14,50 @@ import java.util.ArrayList;
import java.util.List;
import org.eclipse.osee.framework.core.enums.TxChange;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.core.exception.OseeDataStoreException;
import org.eclipse.osee.framework.core.model.Branch;
import org.eclipse.osee.framework.database.core.ConnectionHandler;
import org.eclipse.osee.framework.database.core.IOseeStatement;
+import org.eclipse.osee.framework.database.core.IdJoinQuery;
import org.eclipse.osee.framework.database.core.JoinUtility;
-import org.eclipse.osee.framework.database.core.JoinUtility.IdJoinQuery;
import org.eclipse.osee.framework.database.core.OseeConnection;
/**
* @author Ryan D. Brooks
*/
public class UpdatePreviousTxCurrent {
- private final Branch branch;
- private final OseeConnection connection;
- private final IdJoinQuery artifactJoin = JoinUtility.createIdJoinQuery();
- private final IdJoinQuery attributeJoin = JoinUtility.createIdJoinQuery();
- private final IdJoinQuery relationJoin = JoinUtility.createIdJoinQuery();
private static final String UPDATE_TXS_NOT_CURRENT =
"update osee_txs SET tx_current = " + TxChange.NOT_CURRENT.getValue() + " where branch_id = ? AND gamma_id = ? and tx_current <> ? and transaction_id = ?";
+ private final Branch branch;
+ private final OseeConnection connection;
+ private IdJoinQuery artifactJoin;
+ private IdJoinQuery attributeJoin;
+ private IdJoinQuery relationJoin;
+
public UpdatePreviousTxCurrent(Branch branch, OseeConnection connection) {
this.branch = branch;
this.connection = connection;
}
- public void addAttribute(int attributeId) {
+ public void addAttribute(int attributeId) throws OseeDataStoreException {
+ if (attributeJoin == null) {
+ attributeJoin = JoinUtility.createIdJoinQuery();
+ }
attributeJoin.add(attributeId);
}
- public void addArtifact(int artifactId) {
+ public void addArtifact(int artifactId) throws OseeDataStoreException {
+ if (artifactJoin == null) {
+ artifactJoin = JoinUtility.createIdJoinQuery();
+ }
artifactJoin.add(artifactId);
}
- public void addRelation(int relationId) {
+ public void addRelation(int relationId) throws OseeDataStoreException {
+ if (relationJoin == null) {
+ relationJoin = JoinUtility.createIdJoinQuery();
+ }
relationJoin.add(relationId);
}
@@ -57,9 +68,11 @@ public class UpdatePreviousTxCurrent {
}
private void updateTxNotCurrents(String tableName, String columnName, IdJoinQuery idJoin) throws OseeCoreException {
- idJoin.store(connection);
- updateNoLongerCurrentGammas(tableName, columnName, idJoin.getQueryId());
- idJoin.delete(connection);
+ if (idJoin != null) {
+ idJoin.store(connection);
+ updateNoLongerCurrentGammas(tableName, columnName, idJoin.getQueryId());
+ idJoin.delete(connection);
+ }
}
private void updateNoLongerCurrentGammas(String tableName, String columnName, int queryId) throws OseeCoreException {
diff --git a/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/exchange/ExportController.java b/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/exchange/ExportController.java
index 1ecaec7468b..defb5eb202b 100644
--- a/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/exchange/ExportController.java
+++ b/plugins/org.eclipse.osee.framework.branch.management/src/org/eclipse/osee/framework/branch/management/exchange/ExportController.java
@@ -30,8 +30,8 @@ import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.exception.OseeExceptions;
import org.eclipse.osee.framework.core.server.ServerThreads;
import org.eclipse.osee.framework.database.core.DbTransaction;
+import org.eclipse.osee.framework.database.core.ExportImportJoinQuery;
import org.eclipse.osee.framework.database.core.JoinUtility;
-import org.eclipse.osee.framework.database.core.JoinUtility.ExportImportJoinQuery;
import org.eclipse.osee.framework.database.core.OseeConnection;
import org.eclipse.osee.framework.jdk.core.util.Lib;
import org.eclipse.osee.framework.jdk.core.util.Strings;
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 f391eb44ddd..b48433467d8 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
@@ -24,8 +24,8 @@ import org.eclipse.osee.framework.core.model.cache.ITransactionDataAccessor;
import org.eclipse.osee.framework.core.model.cache.TransactionCache;
import org.eclipse.osee.framework.database.IOseeDatabaseService;
import org.eclipse.osee.framework.database.core.IOseeStatement;
+import org.eclipse.osee.framework.database.core.IdJoinQuery;
import org.eclipse.osee.framework.database.core.JoinUtility;
-import org.eclipse.osee.framework.database.core.JoinUtility.IdJoinQuery;
/**
* @author Roberto E. Escobar
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/AbstractJoinQuery.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/AbstractJoinQuery.java
new file mode 100644
index 00000000000..e1d7b221582
--- /dev/null
+++ b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/AbstractJoinQuery.java
@@ -0,0 +1,118 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.framework.database.core;
+
+import java.sql.Timestamp;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.core.exception.OseeDataStoreException;
+import org.eclipse.osee.framework.database.core.DatabaseJoinAccessor.JoinItem;
+import org.eclipse.osee.framework.jdk.core.util.time.GlobalTime;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public abstract class AbstractJoinQuery {
+
+ protected static interface IJoinRow {
+ Object[] toArray();
+
+ @Override
+ String toString();
+ }
+
+ private final IJoinAccessor joinAccessor;
+ private final JoinItem joinItem;
+ private final int queryId;
+
+ private final Timestamp insertTime;
+ protected final Set<IJoinRow> entries = new HashSet<IJoinRow>();
+
+ private boolean wasStored;
+ private int storedSize;
+
+ protected AbstractJoinQuery(IJoinAccessor joinAccessor, JoinItem joinItem, int queryId) {
+ this.joinAccessor = joinAccessor;
+ this.joinItem = joinItem;
+ this.queryId = queryId;
+ this.insertTime = GlobalTime.GreenwichMeanTimestamp();
+ this.storedSize = -1;
+ this.wasStored = false;
+ }
+
+ public boolean isEmpty() {
+ return this.wasStored != true ? entries.isEmpty() : this.storedSize > 0;
+ }
+
+ public int size() {
+ return this.wasStored != true ? entries.size() : this.storedSize;
+ }
+
+ public int getQueryId() {
+ return queryId;
+ }
+
+ public Timestamp getInsertTime() {
+ return insertTime;
+ }
+
+ public String getJoinTableName() {
+ return joinItem.getJoinTableName();
+ }
+
+ public boolean wasStored() {
+ return wasStored;
+ }
+
+ public void store(OseeConnection connection) throws OseeCoreException {
+ if (this.wasStored != true) {
+ List<Object[]> data = new ArrayList<Object[]>();
+ for (IJoinRow joinArray : entries) {
+ data.add(joinArray.toArray());
+ }
+ joinAccessor.store(connection, joinItem, getQueryId(), data);
+ this.storedSize = this.entries.size();
+ this.wasStored = true;
+ this.entries.clear();
+ } else {
+ throw new OseeDataStoreException("Cannot store query id twice");
+ }
+ }
+
+ public int delete(OseeConnection connection) throws OseeCoreException {
+ return joinAccessor.delete(connection, joinItem, getQueryId());
+ }
+
+ public void store() throws OseeCoreException {
+ store(null);
+ }
+
+ public int delete() throws OseeCoreException {
+ return delete(null);
+ }
+
+ public Collection<Integer> getAllQueryIds(OseeConnection connection) throws OseeCoreException {
+ return joinAccessor.getAllQueryIds(connection, joinItem);
+ }
+
+ public Collection<Integer> getAllQueryIds() throws OseeCoreException {
+ return joinAccessor.getAllQueryIds(null, joinItem);
+ }
+
+ @Override
+ public String toString() {
+ return String.format("id: [%s] entrySize: [%d]", getQueryId(), size());
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/ArtifactJoinQuery.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/ArtifactJoinQuery.java
new file mode 100644
index 00000000000..2ba4510fd72
--- /dev/null
+++ b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/ArtifactJoinQuery.java
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.framework.database.core;
+
+import org.eclipse.osee.framework.database.core.DatabaseJoinAccessor.JoinItem;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public final class ArtifactJoinQuery extends AbstractJoinQuery {
+
+ private final class Entry implements IJoinRow {
+ private final int artId;
+ private final int branchId;
+
+ private Entry(Integer artId, Integer branchId) {
+ this.artId = artId;
+ this.branchId = branchId;
+ }
+
+ @Override
+ public Object[] toArray() {
+ return new Object[] {getQueryId(), getInsertTime(), artId, branchId};
+ }
+
+ @Override
+ public String toString() {
+ return String.format("art_id=%s, branch_id=%s", artId, branchId);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (obj == this) {
+ return true;
+ }
+ if (!(obj instanceof Entry)) {
+ return false;
+ }
+ Entry other = (Entry) obj;
+ return other.artId == this.artId && other.branchId == this.branchId;
+ }
+
+ @Override
+ public int hashCode() {
+ return 37 * artId * branchId;
+ }
+ }
+
+ protected ArtifactJoinQuery(IJoinAccessor joinAccessor, int queryId) {
+ super(joinAccessor, JoinItem.ARTIFACT, queryId);
+ }
+
+ public void add(Integer art_id, Integer branchId) {
+ entries.add(new Entry(art_id, branchId));
+ }
+
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/CharJoinQuery.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/CharJoinQuery.java
new file mode 100644
index 00000000000..7a092f6457e
--- /dev/null
+++ b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/CharJoinQuery.java
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.framework.database.core;
+
+import org.eclipse.osee.framework.database.core.DatabaseJoinAccessor.JoinItem;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public final class CharJoinQuery extends AbstractJoinQuery {
+
+ private final class CharJoinEntry implements IJoinRow {
+ private final String value;
+
+ private CharJoinEntry(String value) {
+ this.value = value;
+ }
+
+ @Override
+ public Object[] toArray() {
+ return new Object[] {getQueryId(), value};
+ }
+
+ @Override
+ public int hashCode() {
+ return 37 * value.hashCode();
+ }
+
+ @Override
+ public String toString() {
+ return value;
+ }
+ }
+
+ protected CharJoinQuery(IJoinAccessor joinAccessor, int queryId) {
+ super(joinAccessor, JoinItem.CHAR_ID, queryId);
+ }
+
+ public void add(String value) {
+ entries.add(new CharJoinEntry(value));
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/DatabaseJoinAccessor.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/DatabaseJoinAccessor.java
new file mode 100644
index 00000000000..e3ea1d05f13
--- /dev/null
+++ b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/DatabaseJoinAccessor.java
@@ -0,0 +1,142 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.framework.database.core;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.database.IOseeDatabaseService;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class DatabaseJoinAccessor implements IJoinAccessor {
+
+ private static final String SELECT_QUERY_IDS = "select DISTINCT query_id from %s";
+
+ private static final String INSERT_INTO_JOIN_ARTIFACT =
+ "INSERT INTO osee_join_artifact (query_id, insert_time, art_id, branch_id) VALUES (?, ?, ?, ?)";
+
+ private static final String INSERT_INTO_JOIN_TRANSACTION =
+ "INSERT INTO osee_join_transaction (query_id, insert_time, gamma_id, transaction_id) VALUES (?, ?, ?, ?)";
+
+ private static final String INSERT_INTO_JOIN_SEARCH_TAGS =
+ "INSERT INTO osee_join_search_tags (query_id, insert_time, coded_tag_id) VALUES (?, ?, ?)";
+
+ private static final String INSERT_INTO_TAG_GAMMA_QUEUE =
+ "INSERT INTO osee_tag_gamma_queue (query_id, insert_time, gamma_id) VALUES (?, ?, ?)";
+
+ private static final String INSERT_INTO_JOIN_EXPORT_IMPORT =
+ "INSERT INTO osee_join_export_import (query_id, insert_time, id1, id2) VALUES (?, ?, ?, ?)";
+
+ private static final String INSERT_INTO_JOIN_ID =
+ "INSERT INTO osee_join_id (query_id, insert_time, id) VALUES (?, ?, ?)";
+
+ private static final String INSERT_INTO_JOIN_CLEANUP =
+ "INSERT INTO osee_join_cleanup (query_id, table_name, session_id) VALUES (?, ?, ?)";
+
+ private static final String INSERT_INTO_JOIN_CHAR_ID = "INSERT INTO osee_join_char_id (query_id, id) VALUES (?, ?)";
+
+ private static final String DELETE_FROM_JOIN_ID = "DELETE FROM osee_join_id WHERE query_id = ?";
+ private static final String DELETE_FROM_JOIN_TRANSACTION = "DELETE FROM osee_join_transaction WHERE query_id = ?";
+ private static final String DELETE_FROM_JOIN_ARTIFACT = "DELETE FROM osee_join_artifact WHERE query_id = ?";
+ private static final String DELETE_FROM_JOIN_SEARCH_TAGS = "DELETE FROM osee_join_search_tags WHERE query_id = ?";
+ private static final String DELETE_FROM_TAG_GAMMA_QUEUE = "DELETE FROM osee_tag_gamma_queue WHERE query_id = ?";
+ private static final String DELETE_FROM_JOIN_EXPORT_IMPORT = "DELETE FROM osee_join_export_import WHERE query_id =?";
+ private static final String DELETE_FROM_JOIN = "DELETE FROM osee_join_cleanup WHERE query_id =?";
+ private static final String DELETE_FROM_JOIN_CHAR_ID = "DELETE FROM osee_join_char_id WHERE query_id =?";
+
+ public enum JoinItem {
+ TRANSACTION("osee_join_transaction", INSERT_INTO_JOIN_TRANSACTION, DELETE_FROM_JOIN_TRANSACTION),
+ ARTIFACT("osee_join_artifact", INSERT_INTO_JOIN_ARTIFACT, DELETE_FROM_JOIN_ARTIFACT),
+ SEARCH_TAGS("osee_join_search_tags", INSERT_INTO_JOIN_SEARCH_TAGS, DELETE_FROM_JOIN_SEARCH_TAGS),
+ TAG_GAMMA_QUEUE("osee_tag_gamma_queue", INSERT_INTO_TAG_GAMMA_QUEUE, DELETE_FROM_TAG_GAMMA_QUEUE),
+ EXPORT_IMPORT("osee_join_export_import", INSERT_INTO_JOIN_EXPORT_IMPORT, DELETE_FROM_JOIN_EXPORT_IMPORT),
+ ID("osee_join_id", INSERT_INTO_JOIN_ID, DELETE_FROM_JOIN_ID),
+ JOIN("osee_join_cleanup", INSERT_INTO_JOIN_CLEANUP, DELETE_FROM_JOIN),
+ CHAR_ID("osee_join_char_id", INSERT_INTO_JOIN_CHAR_ID, DELETE_FROM_JOIN_CHAR_ID);
+
+ private final String tableName;
+ private final String deleteSql;
+ private final String insertSql;
+
+ JoinItem(String tableName, String insertSql, String deleteSql) {
+ this.tableName = tableName;
+ this.deleteSql = deleteSql;
+ this.insertSql = insertSql;
+ }
+
+ public String getDeleteSql() {
+ return deleteSql;
+ }
+
+ public String getInsertSql() {
+ return insertSql;
+ }
+
+ public String getJoinTableName() {
+ return tableName;
+ }
+ }
+
+ private final IOseeDatabaseService databaseService;
+ private final String sessionId;
+
+ public DatabaseJoinAccessor(IOseeDatabaseService databaseService, String sessionId) {
+ super();
+ this.databaseService = databaseService;
+ this.sessionId = sessionId;
+ }
+
+ public DatabaseJoinAccessor(IOseeDatabaseService databaseService) {
+ this(databaseService, null);
+ }
+
+ @Override
+ public int delete(OseeConnection connection, JoinItem joinItem, int queryId) throws OseeCoreException {
+ int updated = 0;
+ if (queryId != -1) {
+ updated = databaseService.runPreparedUpdate(connection, joinItem.getDeleteSql(), queryId);
+ if (sessionId != null) {
+ databaseService.runPreparedUpdate(connection, DELETE_FROM_JOIN, queryId);
+ }
+ }
+ return updated;
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public void store(OseeConnection connection, JoinItem joinItem, int queryId, List<Object[]> dataList) throws OseeCoreException {
+ databaseService.runBatchUpdate(connection, joinItem.getInsertSql(), dataList);
+ if (sessionId != null) {
+ databaseService.runPreparedUpdate(connection, INSERT_INTO_JOIN_CLEANUP, queryId, joinItem.getJoinTableName(),
+ sessionId);
+ }
+ }
+
+ @Override
+ public Collection<Integer> getAllQueryIds(OseeConnection connection, JoinItem joinItem) throws OseeCoreException {
+ Collection<Integer> queryIds = new ArrayList<Integer>();
+ IOseeStatement chStmt = databaseService.getStatement();
+ try {
+ String query = String.format(SELECT_QUERY_IDS, joinItem.getJoinTableName());
+ chStmt.runPreparedQuery(query);
+ while (chStmt.next()) {
+ queryIds.add(chStmt.getInt("query_id"));
+ }
+ } finally {
+ chStmt.close();
+ }
+ return queryIds;
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/ExportImportJoinQuery.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/ExportImportJoinQuery.java
new file mode 100644
index 00000000000..9109688c0c5
--- /dev/null
+++ b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/ExportImportJoinQuery.java
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.framework.database.core;
+
+import org.eclipse.osee.framework.database.core.DatabaseJoinAccessor.JoinItem;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public final class ExportImportJoinQuery extends AbstractJoinQuery {
+
+ private final class ExportImportEntry implements IJoinRow {
+ private final long id1;
+ private final long id2;
+
+ private ExportImportEntry(Long id1, Long id2) {
+ this.id1 = id1;
+ this.id2 = id2;
+ }
+
+ @Override
+ public Object[] toArray() {
+ return new Object[] {getQueryId(), getInsertTime(), id1, id2};
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (obj == this) {
+ return true;
+ }
+ if (!(obj instanceof ExportImportEntry)) {
+ return false;
+ }
+ ExportImportEntry other = (ExportImportEntry) obj;
+ return this.id1 == other.id1 && this.id2 == other.id2;
+ }
+
+ @Override
+ public int hashCode() {
+ return Long.valueOf(37 * id1 * id2).hashCode();
+ }
+
+ @Override
+ public String toString() {
+ return String.format("id1=%s id2=%s", id1, id2);
+ }
+ }
+
+ protected ExportImportJoinQuery(IJoinAccessor joinAccessor, int queryId) {
+ super(joinAccessor, JoinItem.EXPORT_IMPORT, queryId);
+ }
+
+ public void add(Long id1, Long id2) {
+ entries.add(new ExportImportEntry(id1, id2));
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/IJoinAccessor.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/IJoinAccessor.java
new file mode 100644
index 00000000000..6b84a9e0cc4
--- /dev/null
+++ b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/IJoinAccessor.java
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.framework.database.core;
+
+import java.util.Collection;
+import java.util.List;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.database.core.DatabaseJoinAccessor.JoinItem;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public interface IJoinAccessor {
+
+ void store(OseeConnection connection, JoinItem joinItem, int queryId, List<Object[]> dataList) throws OseeCoreException;
+
+ int delete(OseeConnection connection, JoinItem joinItem, int queryId) throws OseeCoreException;
+
+ Collection<Integer> getAllQueryIds(OseeConnection connection, JoinItem joinItem) throws OseeCoreException;
+}
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/IdJoinQuery.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/IdJoinQuery.java
new file mode 100644
index 00000000000..5bd47720bda
--- /dev/null
+++ b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/IdJoinQuery.java
@@ -0,0 +1,62 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.framework.database.core;
+
+import org.eclipse.osee.framework.database.core.DatabaseJoinAccessor.JoinItem;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public final class IdJoinQuery extends AbstractJoinQuery {
+
+ private final class TempIdEntry implements IJoinRow {
+ private final int id;
+
+ private TempIdEntry(Integer id) {
+ this.id = id;
+ }
+
+ @Override
+ public Object[] toArray() {
+ return new Object[] {getQueryId(), getInsertTime(), id};
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (obj == this) {
+ return true;
+ }
+ if (!(obj instanceof TempIdEntry)) {
+ return false;
+ }
+ TempIdEntry other = (TempIdEntry) obj;
+ return other.id == this.id;
+ }
+
+ @Override
+ public int hashCode() {
+ return 37 * id;
+ }
+
+ @Override
+ public String toString() {
+ return "id = " + id;
+ }
+ }
+
+ protected IdJoinQuery(IJoinAccessor joinAccessor, int queryId) {
+ super(joinAccessor, JoinItem.ID, queryId);
+ }
+
+ public void add(Integer id) {
+ entries.add(new TempIdEntry(id));
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/JoinUtility.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/JoinUtility.java
index fcd76f707c0..127eb256bc2 100644
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/JoinUtility.java
+++ b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/JoinUtility.java
@@ -10,582 +10,65 @@
*******************************************************************************/
package org.eclipse.osee.framework.database.core;
-import java.sql.Timestamp;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
import java.util.Random;
-import java.util.Set;
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.exception.OseeDataStoreException;
import org.eclipse.osee.framework.database.IOseeDatabaseService;
import org.eclipse.osee.framework.database.internal.Activator;
-import org.eclipse.osee.framework.jdk.core.util.time.GlobalTime;
/**
* @author Roberto E. Escobar
*/
public class JoinUtility {
- private static final String INSERT_INTO_JOIN_ARTIFACT =
- "INSERT INTO osee_join_artifact (query_id, insert_time, art_id, branch_id) VALUES (?, ?, ?, ?)";
-
- private static final String INSERT_INTO_JOIN_TRANSACTION =
- "INSERT INTO osee_join_transaction (query_id, insert_time, gamma_id, transaction_id) VALUES (?, ?, ?, ?)";
-
- private static final String INSERT_INTO_JOIN_SEARCH_TAGS =
- "INSERT INTO osee_join_search_tags (query_id, insert_time, coded_tag_id) VALUES (?, ?, ?)";
-
- private static final String INSERT_INTO_TAG_GAMMA_QUEUE =
- "INSERT INTO osee_tag_gamma_queue (query_id, insert_time, gamma_id) VALUES (?, ?, ?)";
-
- private static final String INSERT_INTO_JOIN_EXPORT_IMPORT =
- "INSERT INTO osee_join_export_import (query_id, insert_time, id1, id2) VALUES (?, ?, ?, ?)";
- private static final String INSERT_INTO_JOIN_ID =
- "INSERT INTO osee_join_id (query_id, insert_time, id) VALUES (?, ?, ?)";
-
- private static final String INSERT_INTO_JOIN_CLEANUP =
- "INSERT INTO osee_join_cleanup (query_id, table_name, session_id) VALUES (?, ?, ?)";
-
- private static final String INSERT_INTO_JOIN_CHAR_ID = "INSERT INTO osee_join_char_id (query_id, id) VALUES (?, ?)";
-
- private static final String DELETE_FROM_JOIN_ID = "DELETE FROM osee_join_id WHERE query_id = ?";
- private static final String DELETE_FROM_JOIN_TRANSACTION = "DELETE FROM osee_join_transaction WHERE query_id = ?";
- private static final String DELETE_FROM_JOIN_ARTIFACT = "DELETE FROM osee_join_artifact WHERE query_id = ?";
- private static final String DELETE_FROM_JOIN_SEARCH_TAGS = "DELETE FROM osee_join_search_tags WHERE query_id = ?";
- private static final String DELETE_FROM_TAG_GAMMA_QUEUE = "DELETE FROM osee_tag_gamma_queue WHERE query_id = ?";
- private static final String DELETE_FROM_JOIN_EXPORT_IMPORT = "DELETE FROM osee_join_export_import WHERE query_id =?";
- private static final String DELETE_FROM_JOIN = "DELETE FROM osee_join_cleanup WHERE query_id =?";
- private static final String DELETE_FROM_JOIN_CHAR_ID = "DELETE FROM osee_join_char_id WHERE query_id =?";
- private static final String SELECT_TAG_GAMMA_QUEUE_QUERIES = "select DISTINCT query_id from osee_tag_gamma_queue";
private static final Random random = new Random();
- public enum JoinItem {
- TRANSACTION(INSERT_INTO_JOIN_TRANSACTION, DELETE_FROM_JOIN_TRANSACTION),
- ARTIFACT(INSERT_INTO_JOIN_ARTIFACT, DELETE_FROM_JOIN_ARTIFACT),
- SEARCH_TAGS(INSERT_INTO_JOIN_SEARCH_TAGS, DELETE_FROM_JOIN_SEARCH_TAGS),
- TAG_GAMMA_QUEUE(INSERT_INTO_TAG_GAMMA_QUEUE, DELETE_FROM_TAG_GAMMA_QUEUE),
- EXPORT_IMPORT(INSERT_INTO_JOIN_EXPORT_IMPORT, DELETE_FROM_JOIN_EXPORT_IMPORT),
- ID(INSERT_INTO_JOIN_ID, DELETE_FROM_JOIN_ID),
- JOIN(INSERT_INTO_JOIN_CLEANUP, DELETE_FROM_JOIN),
- CHAR_ID(INSERT_INTO_JOIN_CHAR_ID, DELETE_FROM_JOIN_CHAR_ID);
-
- private final String deleteSql;
- private final String insertSql;
-
- JoinItem(String insertSql, String deleteSql) {
- this.deleteSql = deleteSql;
- this.insertSql = insertSql;
- }
-
- String getDeleteSql() {
- return deleteSql;
- }
-
- String getInsertSql() {
- return insertSql;
- }
- }
-
private JoinUtility() {
+ // Utility Class
}
- public static int getNewQueryId() {
+ private static int getNewQueryId() {
return random.nextInt();
}
- public static TransactionJoinQuery createTransactionJoinQuery() {
- return new TransactionJoinQuery(null);
+ private static IOseeDatabaseService getDatabase() throws OseeDataStoreException {
+ return Activator.getInstance().getOseeDatabaseService();
}
- public static IdJoinQuery createIdJoinQuery() {
- return new IdJoinQuery(null);
+ private static IJoinAccessor createAccessor() throws OseeDataStoreException {
+ IOseeDatabaseService service = getDatabase();
+ return new DatabaseJoinAccessor(service);
}
- public static ArtifactJoinQuery createArtifactJoinQuery() {
- return new ArtifactJoinQuery(null);
+ private static IJoinAccessor createAccessor(String sessionId) throws OseeDataStoreException {
+ IOseeDatabaseService service = getDatabase();
+ return new DatabaseJoinAccessor(service, sessionId);
}
- public static SearchTagJoinQuery createSearchTagJoinQuery() {
- return new SearchTagJoinQuery(null);
+ public static TransactionJoinQuery createTransactionJoinQuery() throws OseeDataStoreException {
+ return new TransactionJoinQuery(createAccessor(), getNewQueryId());
}
- public static TagQueueJoinQuery createTagQueueJoinQuery() {
- return new TagQueueJoinQuery(null);
+ public static IdJoinQuery createIdJoinQuery() throws OseeDataStoreException {
+ return new IdJoinQuery(createAccessor(), getNewQueryId());
}
- public static ExportImportJoinQuery createExportImportJoinQuery() {
- return new ExportImportJoinQuery(null);
+ public static ArtifactJoinQuery createArtifactJoinQuery() throws OseeDataStoreException {
+ return new ArtifactJoinQuery(createAccessor(), getNewQueryId());
}
- public static CharJoinQuery createCharJoinQuery(String sessionId) {
- return new CharJoinQuery(sessionId);
- }
-
- public static List<Integer> getAllTagQueueQueryIds() throws OseeCoreException {
- List<Integer> queryIds = new ArrayList<Integer>();
- IOseeStatement chStmt = ConnectionHandler.getStatement();
- try {
- chStmt.runPreparedQuery(SELECT_TAG_GAMMA_QUEUE_QUERIES);
- while (chStmt.next()) {
- queryIds.add(chStmt.getInt("query_id"));
- }
- } finally {
- chStmt.close();
- }
- return queryIds;
- }
- public static abstract class JoinQueryEntry {
- public final JoinItem joinItem;
- private final int queryId;
- private final Timestamp insertTime;
- protected Set<IJoinRow> entries;
- private boolean wasStored;
- private int storedSize;
- private final String sessionId;
-
- protected JoinQueryEntry(JoinItem joinItem, String sessionId) {
- this.wasStored = false;
- this.joinItem = joinItem;
- this.queryId = getNewQueryId();
- this.insertTime = GlobalTime.GreenwichMeanTimestamp();
- this.entries = new HashSet<IJoinRow>();
- this.storedSize = -1;
- this.sessionId = sessionId;
- }
-
- public abstract String getJoinTableName();
-
- public boolean isEmpty() {
- return this.wasStored != true ? entries.isEmpty() : this.storedSize > 0;
- }
-
- public int size() {
- return this.wasStored != true ? entries.size() : this.storedSize;
- }
-
- public int getQueryId() {
- return queryId;
- }
-
- public Timestamp getInsertTime() {
- return insertTime;
- }
-
- @SuppressWarnings("unchecked")
- public void store(OseeConnection connection) throws OseeCoreException {
- if (this.wasStored != true) {
- List<Object[]> data = new ArrayList<Object[]>();
- for (IJoinRow joinArray : entries) {
- data.add(joinArray.toArray());
- }
- ConnectionHandler.runBatchUpdate(connection, joinItem.getInsertSql(), data);
- if (sessionId != null) {
- Activator.getInstance().getOseeDatabaseService().runPreparedUpdate(connection, INSERT_INTO_JOIN_CLEANUP,
- getQueryId(), getJoinTableName(), sessionId);
- }
- this.storedSize = this.entries.size();
- this.wasStored = true;
- this.entries.clear();
- } else {
- throw new OseeDataStoreException("Cannot store query id twice");
- }
- }
-
- public int delete(OseeConnection connection) throws OseeCoreException {
- int updated = 0;
- IOseeDatabaseService databaseService = Activator.getInstance().getOseeDatabaseService();
- if (queryId != -1) {
- updated = databaseService.runPreparedUpdate(connection, joinItem.getDeleteSql(), queryId);
- if (sessionId != null) {
- databaseService.runPreparedUpdate(connection, DELETE_FROM_JOIN, getQueryId());
- }
- }
- return updated;
- }
-
- public void store() throws OseeCoreException {
- store(null);
- }
-
- public int delete() throws OseeCoreException {
- return delete(null);
- }
-
- @Override
- public String toString() {
- return String.format("id: [%s] entrySize: [%d]", getQueryId(), size());
- }
+ public static SearchTagJoinQuery createSearchTagJoinQuery() throws OseeDataStoreException {
+ return new SearchTagJoinQuery(createAccessor(), getNewQueryId());
}
- public static void deleteQuery(OseeConnection connection, JoinItem item, int queryId) throws Exception {
- if (item != null) {
- ConnectionHandler.runPreparedUpdate(connection, item.getDeleteSql(), queryId);
- }
+ public static TagQueueJoinQuery createTagQueueJoinQuery() throws OseeDataStoreException {
+ return new TagQueueJoinQuery(createAccessor(), getNewQueryId());
}
- public static void deleteQuery(JoinItem item, int queryId) throws Exception {
- if (item != null) {
- ConnectionHandler.runPreparedUpdate(item.getDeleteSql(), queryId);
- }
+ public static ExportImportJoinQuery createExportImportJoinQuery() throws OseeDataStoreException {
+ return new ExportImportJoinQuery(createAccessor(), getNewQueryId());
}
- private interface IJoinRow {
- public Object[] toArray();
-
- @Override
- public String toString();
- }
-
- public static final class IdJoinQuery extends JoinQueryEntry {
-
- private final class TempIdEntry implements IJoinRow {
- private final int id;
-
- private TempIdEntry(Integer id) {
- this.id = id;
- }
-
- @Override
- public Object[] toArray() {
- return new Object[] {getQueryId(), getInsertTime(), id};
- }
-
- @Override
- public boolean equals(Object obj) {
- if (obj == this) {
- return true;
- }
- if (!(obj instanceof TempIdEntry)) {
- return false;
- }
- TempIdEntry other = (TempIdEntry) obj;
- return other.id == this.id;
- }
-
- @Override
- public int hashCode() {
- return 37 * id;
- }
-
- @Override
- public String toString() {
- return "id = " + id;
- }
- }
-
- private IdJoinQuery(String sessionId) {
- super(JoinItem.ID, sessionId);
- }
-
- public void add(Integer id) {
- entries.add(new TempIdEntry(id));
- }
-
- @Override
- public String getJoinTableName() {
- return "osee_join_id";
- }
- }
-
- public static final class TransactionJoinQuery extends JoinQueryEntry {
-
- private final class TempTransactionEntry implements IJoinRow {
- private final long gammaId;
- private final int transactionId;
-
- private TempTransactionEntry(Long gammaId, Integer transactionId) {
- this.gammaId = gammaId;
- this.transactionId = transactionId;
- }
-
- @Override
- public Object[] toArray() {
- return new Object[] {getQueryId(), getInsertTime(), gammaId, transactionId};
- }
-
- @Override
- public boolean equals(Object obj) {
- if (obj == this) {
- return true;
- }
- if (!(obj instanceof TempTransactionEntry)) {
- return false;
- }
- TempTransactionEntry other = (TempTransactionEntry) obj;
- return other.gammaId == this.gammaId && other.transactionId == this.transactionId;
- }
-
- @Override
- public int hashCode() {
- return Long.valueOf(37 * gammaId * transactionId).hashCode();
- }
-
- @Override
- public String toString() {
- return String.format("gamma_id=%s, tx_id=%s", gammaId, transactionId);
- }
- }
-
- private TransactionJoinQuery(String sessionId) {
- super(JoinItem.TRANSACTION, sessionId);
- }
-
- public void add(Long gammaId, Integer transactionId) {
- entries.add(new TempTransactionEntry(gammaId, transactionId));
- }
-
- @Override
- public String getJoinTableName() {
- return "osee_join_transaction";
- }
- }
-
- public static final class ArtifactJoinQuery extends JoinQueryEntry {
-
- private final class Entry implements IJoinRow {
- private final int artId;
- private final int branchId;
-
- private Entry(Integer artId, Integer branchId) {
- this.artId = artId;
- this.branchId = branchId;
- }
-
- @Override
- public Object[] toArray() {
- return new Object[] {getQueryId(), getInsertTime(), artId, branchId};
- }
-
- @Override
- public String toString() {
- return String.format("art_id=%s, branch_id=%s", artId, branchId);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (obj == this) {
- return true;
- }
- if (!(obj instanceof Entry)) {
- return false;
- }
- Entry other = (Entry) obj;
- return other.artId == this.artId && other.branchId == this.branchId;
- }
-
- @Override
- public int hashCode() {
- return 37 * artId * branchId;
- }
- }
-
- private ArtifactJoinQuery(String sessionId) {
- super(JoinItem.ARTIFACT, sessionId);
- }
-
- public void add(Integer art_id, Integer branchId) {
- entries.add(new Entry(art_id, branchId));
- }
-
- @Override
- public String getJoinTableName() {
- return "osee_join_artifact";
- }
- }
-
- public static final class SearchTagJoinQuery extends JoinQueryEntry {
-
- private final class TagEntry implements IJoinRow {
- private final long value;
-
- private TagEntry(Long value) {
- this.value = value;
- }
-
- @Override
- public Object[] toArray() {
- return new Object[] {getQueryId(), getInsertTime(), value};
- }
-
- @Override
- public boolean equals(Object obj) {
- if (obj == this) {
- return true;
- }
- if (!(obj instanceof TagEntry)) {
- return false;
- }
- TagEntry other = (TagEntry) obj;
- return this.value == other.value;
- }
-
- @Override
- public int hashCode() {
- return Long.valueOf(37 * value).hashCode();
- }
-
- @Override
- public String toString() {
- return String.format("tag=%s", value);
- }
- }
-
- private SearchTagJoinQuery(String sessionId) {
- super(JoinItem.SEARCH_TAGS, sessionId);
- }
-
- public void add(Long tag) {
- entries.add(new TagEntry(tag));
- }
-
- @Override
- public String getJoinTableName() {
- return "osee_join_search_tags";
- }
- }
-
- public static final class TagQueueJoinQuery extends JoinQueryEntry {
-
- private final class GammaEntry implements IJoinRow {
- private final long gammaId;
-
- private GammaEntry(Long gammaId) {
- this.gammaId = gammaId;
- }
-
- @Override
- public Object[] toArray() {
- return new Object[] {getQueryId(), getInsertTime(), gammaId};
- }
-
- @Override
- public boolean equals(Object obj) {
- if (obj == this) {
- return true;
- }
- if (!(obj instanceof GammaEntry)) {
- return false;
- }
- GammaEntry other = (GammaEntry) obj;
- return this.gammaId == other.gammaId;
- }
-
- @Override
- public int hashCode() {
- return Long.valueOf(37 * gammaId).hashCode();
- }
-
- @Override
- public String toString() {
- return String.format("gammaId=%s", gammaId);
- }
- }
-
- private TagQueueJoinQuery(String sessionId) {
- super(JoinItem.TAG_GAMMA_QUEUE, sessionId);
- }
-
- public void add(Long gammaId) {
- entries.add(new GammaEntry(gammaId));
- }
-
- @Override
- public String getJoinTableName() {
- return "osee_tag_gamma_queue";
- }
- }
-
- public static final class ExportImportJoinQuery extends JoinQueryEntry {
-
- private final class ExportImportEntry implements IJoinRow {
- private final long id1;
- private final long id2;
-
- private ExportImportEntry(Long id1, Long id2) {
- this.id1 = id1;
- this.id2 = id2;
- }
-
- @Override
- public Object[] toArray() {
- return new Object[] {getQueryId(), getInsertTime(), id1, id2};
- }
-
- @Override
- public boolean equals(Object obj) {
- if (obj == this) {
- return true;
- }
- if (!(obj instanceof ExportImportEntry)) {
- return false;
- }
- ExportImportEntry other = (ExportImportEntry) obj;
- return this.id1 == other.id1 && this.id2 == other.id2;
- }
-
- @Override
- public int hashCode() {
- return Long.valueOf(37 * id1 * id2).hashCode();
- }
-
- @Override
- public String toString() {
- return String.format("id1=%s id2=%s", id1, id2);
- }
- }
-
- private ExportImportJoinQuery(String sessionId) {
- super(JoinItem.EXPORT_IMPORT, sessionId);
- }
-
- public void add(Long id1, Long id2) {
- entries.add(new ExportImportEntry(id1, id2));
- }
-
- @Override
- public String getJoinTableName() {
- return null;
- }
- }
-
- public static final class CharJoinQuery extends JoinQueryEntry {
-
- protected CharJoinQuery(String sessionId) {
- super(JoinItem.CHAR_ID, sessionId);
- }
-
- private final class CharJoinEntry implements IJoinRow {
- private final String value;
-
- private CharJoinEntry(String value) {
- this.value = value;
- }
-
- @Override
- public Object[] toArray() {
- return new Object[] {getQueryId(), value};
- }
-
- @Override
- public int hashCode() {
- return 37 * value.hashCode();
- }
-
- @Override
- public String toString() {
- return value;
- }
-
- }
-
- public void add(String value) {
- entries.add(new CharJoinEntry(value));
- }
-
- @Override
- public String getJoinTableName() {
- return "osee_join_char_id";
- }
+ public static CharJoinQuery createCharJoinQuery(String sessionId) throws OseeDataStoreException {
+ return new CharJoinQuery(createAccessor(sessionId), getNewQueryId());
}
}
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/SearchTagJoinQuery.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/SearchTagJoinQuery.java
new file mode 100644
index 00000000000..c367bd80205
--- /dev/null
+++ b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/SearchTagJoinQuery.java
@@ -0,0 +1,62 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.framework.database.core;
+
+import org.eclipse.osee.framework.database.core.DatabaseJoinAccessor.JoinItem;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public final class SearchTagJoinQuery extends AbstractJoinQuery {
+
+ private final class TagEntry implements IJoinRow {
+ private final long value;
+
+ private TagEntry(Long value) {
+ this.value = value;
+ }
+
+ @Override
+ public Object[] toArray() {
+ return new Object[] {getQueryId(), getInsertTime(), value};
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (obj == this) {
+ return true;
+ }
+ if (!(obj instanceof TagEntry)) {
+ return false;
+ }
+ TagEntry other = (TagEntry) obj;
+ return this.value == other.value;
+ }
+
+ @Override
+ public int hashCode() {
+ return Long.valueOf(37 * value).hashCode();
+ }
+
+ @Override
+ public String toString() {
+ return String.format("tag=%s", value);
+ }
+ }
+
+ protected SearchTagJoinQuery(IJoinAccessor joinAccessor, int queryId) {
+ super(joinAccessor, JoinItem.SEARCH_TAGS, queryId);
+ }
+
+ public void add(Long tag) {
+ entries.add(new TagEntry(tag));
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/TagQueueJoinQuery.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/TagQueueJoinQuery.java
new file mode 100644
index 00000000000..b1c996a5792
--- /dev/null
+++ b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/TagQueueJoinQuery.java
@@ -0,0 +1,62 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.framework.database.core;
+
+import org.eclipse.osee.framework.database.core.DatabaseJoinAccessor.JoinItem;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public final class TagQueueJoinQuery extends AbstractJoinQuery {
+
+ private final class GammaEntry implements IJoinRow {
+ private final long gammaId;
+
+ private GammaEntry(Long gammaId) {
+ this.gammaId = gammaId;
+ }
+
+ @Override
+ public Object[] toArray() {
+ return new Object[] {getQueryId(), getInsertTime(), gammaId};
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (obj == this) {
+ return true;
+ }
+ if (!(obj instanceof GammaEntry)) {
+ return false;
+ }
+ GammaEntry other = (GammaEntry) obj;
+ return this.gammaId == other.gammaId;
+ }
+
+ @Override
+ public int hashCode() {
+ return Long.valueOf(37 * gammaId).hashCode();
+ }
+
+ @Override
+ public String toString() {
+ return String.format("gammaId=%s", gammaId);
+ }
+ }
+
+ protected TagQueueJoinQuery(IJoinAccessor joinAccessor, int queryId) {
+ super(joinAccessor, JoinItem.TAG_GAMMA_QUEUE, queryId);
+ }
+
+ public void add(Long gammaId) {
+ entries.add(new GammaEntry(gammaId));
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/TransactionJoinQuery.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/TransactionJoinQuery.java
new file mode 100644
index 00000000000..77c6520897e
--- /dev/null
+++ b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/core/TransactionJoinQuery.java
@@ -0,0 +1,85 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.framework.database.core;
+
+import org.eclipse.osee.framework.database.core.DatabaseJoinAccessor.JoinItem;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public final class TransactionJoinQuery extends AbstractJoinQuery {
+
+ private final class TempTransactionEntry implements IJoinRow {
+ private final long gammaId;
+ private final int transactionId;
+
+ private TempTransactionEntry(Long gammaId, Integer transactionId) {
+ this.gammaId = gammaId;
+ this.transactionId = transactionId;
+ }
+
+ @Override
+ public Object[] toArray() {
+ return new Object[] {getQueryId(), getInsertTime(), gammaId, transactionId};
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + getOuterType().hashCode();
+ result = prime * result + (int) (gammaId ^ (gammaId >>> 32));
+ result = prime * result + transactionId;
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ TempTransactionEntry other = (TempTransactionEntry) obj;
+ if (!getOuterType().equals(other.getOuterType())) {
+ return false;
+ }
+ if (gammaId != other.gammaId) {
+ return false;
+ }
+ if (transactionId != other.transactionId) {
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ return String.format("gamma_id=%s, tx_id=%s", gammaId, transactionId);
+ }
+
+ private TransactionJoinQuery getOuterType() {
+ return TransactionJoinQuery.this;
+ }
+ }
+
+ protected TransactionJoinQuery(IJoinAccessor joinAccessor, int queryId) {
+ super(joinAccessor, JoinItem.TRANSACTION, queryId);
+ }
+
+ public void add(Long gammaId, Integer transactionId) {
+ entries.add(new TempTransactionEntry(gammaId, transactionId));
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/operation/ConsolidateArtifactVersionTxOperation.java b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/operation/ConsolidateArtifactVersionTxOperation.java
index fb5752a9730..d75f4310043 100644
--- a/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/operation/ConsolidateArtifactVersionTxOperation.java
+++ b/plugins/org.eclipse.osee.framework.database/src/org/eclipse/osee/framework/database/operation/ConsolidateArtifactVersionTxOperation.java
@@ -20,9 +20,9 @@ import org.eclipse.osee.framework.core.exception.OseeStateException;
import org.eclipse.osee.framework.core.operation.OperationReporter;
import org.eclipse.osee.framework.database.IOseeDatabaseService;
import org.eclipse.osee.framework.database.core.AbstractDbTxOperation;
+import org.eclipse.osee.framework.database.core.ExportImportJoinQuery;
import org.eclipse.osee.framework.database.core.IOseeStatement;
import org.eclipse.osee.framework.database.core.JoinUtility;
-import org.eclipse.osee.framework.database.core.JoinUtility.ExportImportJoinQuery;
import org.eclipse.osee.framework.database.core.OseeConnection;
import org.eclipse.osee.framework.database.internal.Activator;
diff --git a/plugins/org.eclipse.osee.framework.search.engine.test/src/org/eclipse/osee/framework/search/engine/test/utility/SearchTagDataStoreTest.java b/plugins/org.eclipse.osee.framework.search.engine.test/src/org/eclipse/osee/framework/search/engine/test/utility/SearchTagDataStoreTest.java
index 3703ff2b424..3a912113d4e 100644
--- a/plugins/org.eclipse.osee.framework.search.engine.test/src/org/eclipse/osee/framework/search/engine/test/utility/SearchTagDataStoreTest.java
+++ b/plugins/org.eclipse.osee.framework.search.engine.test/src/org/eclipse/osee/framework/search/engine/test/utility/SearchTagDataStoreTest.java
@@ -16,8 +16,8 @@ import java.util.Set;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.database.core.DbTransaction;
import org.eclipse.osee.framework.database.core.JoinUtility;
-import org.eclipse.osee.framework.database.core.JoinUtility.TransactionJoinQuery;
import org.eclipse.osee.framework.database.core.OseeConnection;
+import org.eclipse.osee.framework.database.core.TransactionJoinQuery;
import org.eclipse.osee.framework.search.engine.data.IAttributeLocator;
import org.eclipse.osee.framework.search.engine.data.SearchTag;
import org.eclipse.osee.framework.search.engine.utility.SearchTagDataStore;
diff --git a/plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/attribute/AttributeDataStore.java b/plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/attribute/AttributeDataStore.java
index 5035cba685c..da8f42d95a8 100644
--- a/plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/attribute/AttributeDataStore.java
+++ b/plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/attribute/AttributeDataStore.java
@@ -21,8 +21,8 @@ import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.model.type.AttributeType;
import org.eclipse.osee.framework.database.core.ConnectionHandler;
import org.eclipse.osee.framework.database.core.IOseeStatement;
+import org.eclipse.osee.framework.database.core.IdJoinQuery;
import org.eclipse.osee.framework.database.core.JoinUtility;
-import org.eclipse.osee.framework.database.core.JoinUtility.IdJoinQuery;
import org.eclipse.osee.framework.database.core.OseeConnection;
import org.eclipse.osee.framework.search.engine.utility.SearchTagQueryBuilder;
diff --git a/plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/internal/tagger/InputToTagQueueTx.java b/plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/internal/tagger/InputToTagQueueTx.java
index 62aed94fe04..a150d4f20b5 100644
--- a/plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/internal/tagger/InputToTagQueueTx.java
+++ b/plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/internal/tagger/InputToTagQueueTx.java
@@ -17,8 +17,8 @@ import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.exception.OseeExceptions;
import org.eclipse.osee.framework.database.core.DbTransaction;
import org.eclipse.osee.framework.database.core.JoinUtility;
-import org.eclipse.osee.framework.database.core.JoinUtility.TagQueueJoinQuery;
import org.eclipse.osee.framework.database.core.OseeConnection;
+import org.eclipse.osee.framework.database.core.TagQueueJoinQuery;
import org.eclipse.osee.framework.search.engine.ISearchEngineTagger;
import org.eclipse.osee.framework.search.engine.ITagListener;
diff --git a/plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/internal/tagger/StartUpRunnable.java b/plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/internal/tagger/StartUpRunnable.java
index 9f1746960d9..8c1763e9d76 100644
--- a/plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/internal/tagger/StartUpRunnable.java
+++ b/plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/internal/tagger/StartUpRunnable.java
@@ -10,11 +10,12 @@
*******************************************************************************/
package org.eclipse.osee.framework.search.engine.internal.tagger;
-import java.util.List;
+import java.util.Collection;
import java.util.TimerTask;
import java.util.logging.Level;
import org.eclipse.osee.framework.core.server.OseeServerProperties;
import org.eclipse.osee.framework.database.core.JoinUtility;
+import org.eclipse.osee.framework.database.core.TagQueueJoinQuery;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.search.engine.ISearchEngineTagger;
@@ -32,7 +33,8 @@ final class StartUpRunnable extends TimerTask {
public void run() {
try {
if (OseeServerProperties.isCheckTagQueueOnStartupAllowed()) {
- List<Integer> queries = JoinUtility.getAllTagQueueQueryIds();
+ TagQueueJoinQuery joinQuery = JoinUtility.createTagQueueJoinQuery();
+ Collection<Integer> queries = joinQuery.getAllQueryIds();
OseeLog.log(SearchEngineTagger.class, Level.INFO,
String.format("On Start-Up Tagging - [%d] tag queue items.", queries.size()));
for (Integer queryId : queries) {
diff --git a/plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/internal/tagger/TaggerRunnable.java b/plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/internal/tagger/TaggerRunnable.java
index e9aecf2875d..6511302e765 100644
--- a/plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/internal/tagger/TaggerRunnable.java
+++ b/plugins/org.eclipse.osee.framework.search.engine/src/org/eclipse/osee/framework/search/engine/internal/tagger/TaggerRunnable.java
@@ -17,9 +17,9 @@ import java.util.LinkedList;
import java.util.Set;
import java.util.logging.Level;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.database.core.ConnectionHandler;
+import org.eclipse.osee.framework.database.core.DatabaseJoinAccessor.JoinItem;
import org.eclipse.osee.framework.database.core.DbTransaction;
-import org.eclipse.osee.framework.database.core.JoinUtility;
-import org.eclipse.osee.framework.database.core.JoinUtility.JoinItem;
import org.eclipse.osee.framework.database.core.OseeConnection;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.search.engine.IAttributeTaggerProviderManager;
@@ -167,7 +167,9 @@ class TaggerRunnable implements Runnable {
}
}
store(connection, this.searchTags);
- JoinUtility.deleteQuery(connection, JoinItem.TAG_GAMMA_QUEUE, getTagQueueQueryId());
+
+ ConnectionHandler.runPreparedUpdate(connection, JoinItem.TAG_GAMMA_QUEUE.getDeleteSql(),
+ getTagQueueQueryId());
} catch (Exception ex) {
OseeLog.log(Activator.class, Level.SEVERE,
String.format("Unable to store tags - tagQueueQueryId [%d]", getTagQueueQueryId()), ex);
diff --git a/plugins/org.eclipse.osee.framework.server.admin/src/org/eclipse/osee/framework/server/admin/search/TagItemWorker.java b/plugins/org.eclipse.osee.framework.server.admin/src/org/eclipse/osee/framework/server/admin/search/TagItemWorker.java
index 164b74a93e5..48b15c1bbc9 100644
--- a/plugins/org.eclipse.osee.framework.server.admin/src/org/eclipse/osee/framework/server/admin/search/TagItemWorker.java
+++ b/plugins/org.eclipse.osee.framework.server.admin/src/org/eclipse/osee/framework/server/admin/search/TagItemWorker.java
@@ -15,7 +15,7 @@ import java.util.Set;
import java.util.logging.Level;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.osee.framework.database.core.JoinUtility;
-import org.eclipse.osee.framework.database.core.JoinUtility.TagQueueJoinQuery;
+import org.eclipse.osee.framework.database.core.TagQueueJoinQuery;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.search.engine.TagListenerAdapter;
import org.eclipse.osee.framework.server.admin.BaseServerCommand;
diff --git a/plugins/org.eclipse.osee.framework.server.admin/src/org/eclipse/osee/framework/server/admin/search/TaggerAllWorker.java b/plugins/org.eclipse.osee.framework.server.admin/src/org/eclipse/osee/framework/server/admin/search/TaggerAllWorker.java
index 759e85e8cd8..2ff11422425 100644
--- a/plugins/org.eclipse.osee.framework.server.admin/src/org/eclipse/osee/framework/server/admin/search/TaggerAllWorker.java
+++ b/plugins/org.eclipse.osee.framework.server.admin/src/org/eclipse/osee/framework/server/admin/search/TaggerAllWorker.java
@@ -19,8 +19,8 @@ import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.database.core.ConnectionHandler;
import org.eclipse.osee.framework.database.core.IOseeStatement;
import org.eclipse.osee.framework.database.core.JoinUtility;
-import org.eclipse.osee.framework.database.core.JoinUtility.TagQueueJoinQuery;
import org.eclipse.osee.framework.database.core.OseeConnection;
+import org.eclipse.osee.framework.database.core.TagQueueJoinQuery;
import org.eclipse.osee.framework.jdk.core.util.Lib;
import org.eclipse.osee.framework.search.engine.TagListenerAdapter;
import org.eclipse.osee.framework.search.engine.attribute.AttributeDataStore;
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/ArtifactQueryBuilder.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/ArtifactQueryBuilder.java
index 827b3985d46..2e99c86d48d 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/ArtifactQueryBuilder.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/ArtifactQueryBuilder.java
@@ -30,10 +30,10 @@ import org.eclipse.osee.framework.core.exception.OseeArgumentException;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.exception.OseeWrappedException;
import org.eclipse.osee.framework.core.model.TransactionRecord;
+import org.eclipse.osee.framework.database.core.CharJoinQuery;
import org.eclipse.osee.framework.database.core.ConnectionHandler;
import org.eclipse.osee.framework.database.core.IOseeStatement;
import org.eclipse.osee.framework.database.core.JoinUtility;
-import org.eclipse.osee.framework.database.core.JoinUtility.CharJoinQuery;
import org.eclipse.osee.framework.database.core.OseeSql;
import org.eclipse.osee.framework.jdk.core.util.Collections;
import org.eclipse.osee.framework.jdk.core.util.GUID;
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/AttributeCriteria.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/AttributeCriteria.java
index c23fd105e9f..545badfea04 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/AttributeCriteria.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/AttributeCriteria.java
@@ -17,8 +17,8 @@ import org.eclipse.osee.framework.core.exception.OseeArgumentException;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.exception.OseeDataStoreException;
import org.eclipse.osee.framework.core.model.type.AttributeType;
+import org.eclipse.osee.framework.database.core.CharJoinQuery;
import org.eclipse.osee.framework.database.core.JoinUtility;
-import org.eclipse.osee.framework.database.core.JoinUtility.CharJoinQuery;
import org.eclipse.osee.framework.jdk.core.util.Collections;
import org.eclipse.osee.framework.skynet.core.attribute.AttributeTypeManager;
diff --git a/plugins/org.eclipse.osee.framework.ui.branch.graph/src/org/eclipse/osee/framework/ui/branch/graph/model/GraphLoader.java b/plugins/org.eclipse.osee.framework.ui.branch.graph/src/org/eclipse/osee/framework/ui/branch/graph/model/GraphLoader.java
index be9ad56b07a..efbe044e92d 100644
--- a/plugins/org.eclipse.osee.framework.ui.branch.graph/src/org/eclipse/osee/framework/ui/branch/graph/model/GraphLoader.java
+++ b/plugins/org.eclipse.osee.framework.ui.branch.graph/src/org/eclipse/osee/framework/ui/branch/graph/model/GraphLoader.java
@@ -18,7 +18,7 @@ import org.eclipse.osee.framework.core.model.Branch;
import org.eclipse.osee.framework.database.core.ConnectionHandler;
import org.eclipse.osee.framework.database.core.IOseeStatement;
import org.eclipse.osee.framework.database.core.JoinUtility;
-import org.eclipse.osee.framework.database.core.JoinUtility.TransactionJoinQuery;
+import org.eclipse.osee.framework.database.core.TransactionJoinQuery;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.artifact.BranchManager;
import org.eclipse.osee.framework.ui.branch.graph.Activator;
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/ConsolidateRelationsTxOperation.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/ConsolidateRelationsTxOperation.java
index 4fafa163491..49be47b3cdd 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/ConsolidateRelationsTxOperation.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/ConsolidateRelationsTxOperation.java
@@ -26,9 +26,9 @@ import org.eclipse.osee.framework.core.exception.OseeStateException;
import org.eclipse.osee.framework.database.IOseeDatabaseService;
import org.eclipse.osee.framework.database.core.AbstractDbTxOperation;
import org.eclipse.osee.framework.database.core.ConnectionHandler;
+import org.eclipse.osee.framework.database.core.ExportImportJoinQuery;
import org.eclipse.osee.framework.database.core.IOseeStatement;
import org.eclipse.osee.framework.database.core.JoinUtility;
-import org.eclipse.osee.framework.database.core.JoinUtility.ExportImportJoinQuery;
import org.eclipse.osee.framework.database.core.OseeConnection;
import org.eclipse.osee.framework.jdk.core.util.Lib;
import org.eclipse.osee.framework.jdk.core.util.Strings;

Back to the top