Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjphillips2008-06-13 20:30:05 +0000
committerjphillips2008-06-13 20:30:05 +0000
commit735480125917fe558d5ead60f2a83fc05c5815b7 (patch)
tree774fafcb00592203f821e99b0415ad9b12208234
parent585003d63ead2da73f31938b7933ad6c6fe5395e (diff)
downloadorg.eclipse.osee-735480125917fe558d5ead60f2a83fc05c5815b7.tar.gz
org.eclipse.osee-735480125917fe558d5ead60f2a83fc05c5815b7.tar.xz
org.eclipse.osee-735480125917fe558d5ead60f2a83fc05c5815b7.zip
-rw-r--r--org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/Change.java7
-rw-r--r--org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/RevisionManager.java11
2 files changed, 16 insertions, 2 deletions
diff --git a/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/Change.java b/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/Change.java
index 8526dff1544..23f062fabff 100644
--- a/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/Change.java
+++ b/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/change/Change.java
@@ -158,4 +158,11 @@ public abstract class Change implements IAdaptable {
public abstract String getName() throws IllegalArgumentException, ArtifactDoesNotExist, MultipleArtifactsExist, SQLException;
public abstract String getItemKind();
+
+ /**
+ * @param branch the branch to set
+ */
+ public void setBranch(Branch branch) {
+ this.branch = branch;
+ }
}
diff --git a/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/RevisionManager.java b/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/RevisionManager.java
index 85650d89845..fa936dda771 100644
--- a/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/RevisionManager.java
+++ b/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/RevisionManager.java
@@ -101,7 +101,7 @@ public class RevisionManager implements PersistenceManager, IEventReceiver {
"SELECT t8.art_type_id, t3.art_id, t3.attr_id, t3.gamma_id, t3.attr_type_id, t3.value as is_value, t1.mod_type FROM osee_define_txs t1, osee_define_tx_details t2, osee_define_attribute t3, osee_define_artifact t8 WHERE t2.branch_id = ? AND t2.transaction_id = t1.transaction_id AND t1.tx_current = 1 AND t2.tx_type = 0 AND t8.art_id = t3.art_id AND t3.gamma_id = t1.gamma_id";
private static final String TRANSACTION_ATTRIBUTE_CHANGES =
- "SELECT t8.art_type_id, t3.art_id, t3.attr_id, t3.gamma_id, t3.attr_type_id, t3.is_value, t1.mod_type FROM osee_define_txs t1, osee_define_tx_details t2, osee_define_attribute t3, osee_define_artifact t8 WHERE t2.transaction_id = ? AND t2.transaction_id = t1.transaction_id AND t1.tx_current = 1 AND t2.tx_type = 0 AND t8.art_id = t3.art_id AND t3.gamma_id = t1.gamma_id";
+ "SELECT t8.art_type_id, t3.art_id, t3.attr_id, t3.gamma_id, t3.attr_type_id, t3.value as is_value, t1.mod_type FROM osee_define_txs t1, osee_define_tx_details t2, osee_define_attribute t3, osee_define_artifact t8 WHERE t2.transaction_id = ? AND t2.transaction_id = t1.transaction_id AND t1.tx_current = 1 AND t2.tx_type = 0 AND t8.art_id = t3.art_id AND t3.gamma_id = t1.gamma_id";
private static final String BRANCH_REL_CHANGES =
"SELECT tx1.mod_type, rl3.gamma_id, rl3.b_art_id, rl3.a_art_id, rl3.a_order, rl3.b_order, rl3.rationale, rl3.rel_link_id, rl3.rel_link_type_id from osee_define_txs tx1, osee_define_tx_details td2, osee_define_rel_link rl3 where tx1.tx_current = 1 AND td2.tx_type = 0 AND td2.branch_id = ? AND tx1.transaction_id = td2.transaction_id AND tx1.gamma_id = rl3.gamma_id";
@@ -424,15 +424,22 @@ public class RevisionManager implements PersistenceManager, IEventReceiver {
private Collection<Change> getChangesPerBranch(Branch sourceBranch, int transactionNumber) throws SQLException, OseeCoreException {
ArrayList<Change> changes = new ArrayList<Change>();
Set<Integer> artIds = new HashSet<Integer>();
+ boolean hasBranch = sourceBranch != null;
loadNewOrDeletedArtifactChanges(sourceBranch, transactionNumber, artIds, changes);
loadAttributeChanges(sourceBranch, transactionNumber, artIds, changes);
loadRelationChanges(sourceBranch, transactionNumber, artIds, changes);
Branch branch =
- sourceBranch != null ? sourceBranch : BranchPersistenceManager.getInstance().getBranchForTransactionNumber(
+ hasBranch ? sourceBranch : BranchPersistenceManager.getInstance().getBranchForTransactionNumber(
transactionNumber);
+ if (!hasBranch) {
+ for (Change change : changes) {
+ change.setBranch(branch);
+ }
+ }
+
if (!artIds.isEmpty()) {
int queryId = ArtifactLoader.getNewQueryId();

Back to the top