Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAngel Avila2016-06-29 21:48:48 +0000
committerRyan D. Brooks2016-07-29 06:18:20 +0000
commit05ac0786c30885cf11f1c9e78ba69a5ea8ce65cc (patch)
tree62cbf48228ed120e5e553f12eeadb324235abaf7
parent2331c622a566f15b2496802d8bdce3f088cb5fc0 (diff)
downloadorg.eclipse.osee-05ac0786c30885cf11f1c9e78ba69a5ea8ce65cc.tar.gz
org.eclipse.osee-05ac0786c30885cf11f1c9e78ba69a5ea8ce65cc.tar.xz
org.eclipse.osee-05ac0786c30885cf11f1c9e78ba69a5ea8ce65cc.zip
feature: Add ability to set Applicability on Orcs Ojbects
-rw-r--r--plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/TokenFactory.java19
-rw-r--r--plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/DirtyState.java28
-rw-r--r--plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/graph/impl/GraphBuilderImplTest.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/RelationTest.java12
-rw-r--r--plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/transaction/TxDataManagerTest.java46
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/OrcsData.java14
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/artifact/ArtifactImpl.java7
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/primitives/AttributeImpl.java7
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/graph/impl/GraphBuilderImpl.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/Relation.java12
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/RelationManager.java3
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/impl/RelationManagerImpl.java8
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/transaction/TransactionBuilderImpl.java25
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/transaction/TxDataManager.java16
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/util/OrcsPredicates.java4
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/loader/DataLoaderFactoryImplTest.java362
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/DataFactoryImpl.java8
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/LoadSqlWriter.java3
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/ArtifactDataImpl.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/ArtifactObjectFactory.java5
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/AttributeDataImpl.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/AttributeObjectFactory.java5
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/OrcsObjectFactoryImpl.java46
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/OrcsVersionedObjectImpl.java49
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/RelationDataImpl.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/RelationObjectFactory.java5
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/TupleDataImpl.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/processor/ArtifactLoadProcessor.java4
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/processor/AttributeLoadProcessor.java4
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/processor/RelationLoadProcessor.java4
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/transaction/TxSqlBuilderImpl.java34
-rw-r--r--plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/transaction/TransactionBuilder.java8
32 files changed, 464 insertions, 286 deletions
diff --git a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/TokenFactory.java b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/TokenFactory.java
index 3b42ce1b2ec..39eeaeba63c 100644
--- a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/TokenFactory.java
+++ b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/data/TokenFactory.java
@@ -11,7 +11,6 @@
package org.eclipse.osee.framework.core.data;
import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
-import org.eclipse.osee.framework.core.enums.CoreTupleFamilyTypes;
import org.eclipse.osee.framework.core.enums.RelationSide;
import org.eclipse.osee.framework.jdk.core.type.BaseId;
import org.eclipse.osee.framework.jdk.core.type.BaseIdentity;
@@ -318,24 +317,6 @@ public final class TokenFactory {
}
}
- private static class TupleTypeImpl extends BaseId implements TupleTypeToken {
- private final TupleFamilyId family;
-
- public TupleTypeImpl(Long tupleTypeId) {
- this(CoreTupleFamilyTypes.DefaultFamily, tupleTypeId);
- }
-
- public TupleTypeImpl(TupleFamilyId family, Long tupleTypeId) {
- super(tupleTypeId);
- this.family = family;
- }
-
- @Override
- public TupleFamilyId getFamily() {
- return family;
- }
- }
-
private static final class Tuple2TypeImpl<E1, E2> extends TupleTypeImpl implements Tuple2Type<E1, E2> {
public Tuple2TypeImpl(TupleFamilyId family, Long tupleTypeId) {
super(family, tupleTypeId);
diff --git a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/DirtyState.java b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/DirtyState.java
new file mode 100644
index 00000000000..7086ed0e8fa
--- /dev/null
+++ b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/DirtyState.java
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2016 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.core.enums;
+
+/**
+ * @author Angel Avila
+ */
+public enum DirtyState {
+ CLEAN,
+ APPLICABILITY_ONLY,
+ OTHER_CHANGES;
+
+ public boolean isDirty() {
+ return this != CLEAN;
+ }
+
+ public boolean isApplicOnly() {
+ return this == DirtyState.APPLICABILITY_ONLY;
+ }
+}
diff --git a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/graph/impl/GraphBuilderImplTest.java b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/graph/impl/GraphBuilderImplTest.java
index 01710250c75..31df7b7001f 100644
--- a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/graph/impl/GraphBuilderImplTest.java
+++ b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/graph/impl/GraphBuilderImplTest.java
@@ -125,7 +125,7 @@ public class GraphBuilderImplTest {
when(graphData.getNode(artifactData)).thenReturn(null);
when(artifactFactory.createArtifact(session, artifactData)).thenReturn(artifact);
when(artifact.getOrcsData()).thenReturn(artifactData);
- when(artifactData.isUseBackingData()).thenReturn(false);
+ when(artifactData.isExistingVersionUsed()).thenReturn(false);
when(graphData.getNode(60)).thenReturn(null);
when(graphData.getNode(relationData)).thenReturn(null);
diff --git a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/RelationTest.java b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/RelationTest.java
index 7f7480dff17..6ecfe4c7970 100644
--- a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/RelationTest.java
+++ b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/relation/RelationTest.java
@@ -14,9 +14,11 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import org.eclipse.osee.framework.core.data.IRelationType;
+import org.eclipse.osee.framework.core.enums.DirtyState;
import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.core.enums.RelationSide;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
@@ -30,7 +32,7 @@ import org.mockito.MockitoAnnotations;
/**
* Test Case for {@link Relation}
- *
+ *
* @author Roberto E. Escobar
*/
public class RelationTest {
@@ -59,6 +61,7 @@ public class RelationTest {
relation.delete();
verify(data).setModType(ModificationType.DELETED);
+ when(data.isDirty()).thenReturn(true);
assertTrue(relation.isDirty());
}
@@ -76,6 +79,7 @@ public class RelationTest {
relation.setRationale("new rationale");
verify(data).setRationale("new rationale");
verify(data).setModType(ModificationType.MODIFIED);
+ when(data.isDirty()).thenReturn(true);
assertTrue(relation.isDirty());
}
@@ -99,11 +103,17 @@ public class RelationTest {
@Test
public void testDirty() {
+ when(data.calculateDirtyState(true)).thenReturn(DirtyState.OTHER_CHANGES);
+ when(data.isDirty()).thenReturn(true);
relation.setDirty();
assertTrue(relation.isDirty());
+ verify(data, times(1)).calculateDirtyState(true);
+ when(data.calculateDirtyState(false)).thenReturn(DirtyState.CLEAN);
+ when(data.isDirty()).thenReturn(false);
relation.clearDirty();
assertFalse(relation.isDirty());
+ verify(data, times(1)).calculateDirtyState(false);
}
@Test
diff --git a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/transaction/TxDataManagerTest.java b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/transaction/TxDataManagerTest.java
index 05aaf794724..6cbc0b86d3e 100644
--- a/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/transaction/TxDataManagerTest.java
+++ b/plugins/org.eclipse.osee.orcs.core.test/src/org/eclipse/osee/orcs/core/internal/transaction/TxDataManagerTest.java
@@ -214,7 +214,7 @@ public class TxDataManagerTest {
ArtifactData data = Mockito.mock(ArtifactData.class);
when(artifact1.getOrcsData()).thenReturn(data);
- when(data.isUseBackingData()).thenReturn(false);
+ when(data.isExistingVersionUsed()).thenReturn(false);
Artifact actual = txDataManager.getForWrite(txData, artifactId1);
@@ -234,7 +234,7 @@ public class TxDataManagerTest {
ArtifactData data = Mockito.mock(ArtifactData.class);
when(artifact1.getOrcsData()).thenReturn(data);
when(artifact2.getOrcsData()).thenReturn(data);
- when(data.isUseBackingData()).thenReturn(false);
+ when(data.isExistingVersionUsed()).thenReturn(false);
when(txData.isOnSameBranch(artifact1)).thenReturn(true);
Artifact actual = txDataManager.getForWrite(txData, readable1);
@@ -255,7 +255,7 @@ public class TxDataManagerTest {
ArtifactData data = Mockito.mock(ArtifactData.class);
when(artifact1.getOrcsData()).thenReturn(data);
when(artifact2.getOrcsData()).thenReturn(data);
- when(data.isUseBackingData()).thenReturn(false);
+ when(data.isExistingVersionUsed()).thenReturn(false);
when(txData.isOnSameBranch(artifact1)).thenReturn(true);
Artifact actual = txDataManager.getForWrite(txData, readable1);
@@ -275,7 +275,7 @@ public class TxDataManagerTest {
ArtifactData data = Mockito.mock(ArtifactData.class);
when(artifact1.getOrcsData()).thenReturn(data);
when(artifact2.getOrcsData()).thenReturn(data);
- when(data.isUseBackingData()).thenReturn(false);
+ when(data.isExistingVersionUsed()).thenReturn(false);
when(txData.isOnSameBranch(artifact1)).thenReturn(true);
Artifact actual = txDataManager.getForWrite(txData, artifact1);
@@ -294,7 +294,7 @@ public class TxDataManagerTest {
ArtifactData data = Mockito.mock(ArtifactData.class);
when(artifact1.getOrcsData()).thenReturn(data);
when(artifact2.getOrcsData()).thenReturn(data);
- when(data.isUseBackingData()).thenReturn(false);
+ when(data.isExistingVersionUsed()).thenReturn(false);
Artifact actual = txDataManager.getForWrite(txDataReal, artifact1);
@@ -319,7 +319,7 @@ public class TxDataManagerTest {
when(artifact1.getOrcsData()).thenReturn(data);
when(artifact2.getOrcsData()).thenReturn(data);
when(artifact3.getOrcsData()).thenReturn(data);
- when(data.isUseBackingData()).thenReturn(false);
+ when(data.isExistingVersionUsed()).thenReturn(false);
Iterable<Artifact> actual = txDataManager.getForWrite(txData, ids);
@@ -341,7 +341,7 @@ public class TxDataManagerTest {
ArtifactData data = Mockito.mock(ArtifactData.class);
when(artifact1.getOrcsData()).thenReturn(data);
- when(data.isUseBackingData()).thenReturn(false);
+ when(data.isExistingVersionUsed()).thenReturn(false);
when(txData.isOnSameBranch(artifact1)).thenReturn(true);
thrown.expect(OseeArgumentException.class);
@@ -384,7 +384,7 @@ public class TxDataManagerTest {
ArtifactData data = Mockito.mock(ArtifactData.class);
when(artifact1.getOrcsData()).thenReturn(data);
- when(data.isUseBackingData()).thenReturn(false);
+ when(data.isExistingVersionUsed()).thenReturn(false);
ArtifactReadable actual =
txDataManager.createArtifact(txDataReal, DirectSoftwareRequirement, "Direct SW requirement", guid);
@@ -403,7 +403,7 @@ public class TxDataManagerTest {
ArtifactData data = Mockito.mock(ArtifactData.class);
when(artifact1.getOrcsData()).thenReturn(data);
when(artifact2.getOrcsData()).thenReturn(data);
- when(data.isUseBackingData()).thenReturn(false);
+ when(data.isExistingVersionUsed()).thenReturn(false);
ArtifactReadable actual = txDataManager.copyArtifact(txDataReal, BRANCH_ID, readable1);
@@ -420,7 +420,7 @@ public class TxDataManagerTest {
ArtifactData data = Mockito.mock(ArtifactData.class);
when(artifact1.getOrcsData()).thenReturn(data);
when(artifact2.getOrcsData()).thenReturn(data);
- when(data.isUseBackingData()).thenReturn(false);
+ when(data.isExistingVersionUsed()).thenReturn(false);
when(artifactFactory.copyArtifact(session, artifact1, types, BRANCH_ID)).thenReturn(artifact2);
when(proxyManager.asExternalArtifact(session, artifact2)).thenReturn(readable2);
@@ -451,7 +451,7 @@ public class TxDataManagerTest {
when(sourceArtifact.getExistingAttributeTypes()).thenAnswer(answerValue(copyTypes));
when(artifact2.getOrcsData()).thenReturn(data);
- when(data.isUseBackingData()).thenReturn(false);
+ when(data.isExistingVersionUsed()).thenReturn(false);
when(artifactFactory.copyArtifact(session, sourceArtifact, copyTypes, BRANCH_ID)).thenReturn(artifact2);
when(proxyManager.asExternalArtifact(session, artifact2)).thenReturn(readable2);
@@ -474,7 +474,7 @@ public class TxDataManagerTest {
ArtifactData data = Mockito.mock(ArtifactData.class);
when(artifact1.getOrcsData()).thenReturn(data);
when(artifact2.getOrcsData()).thenReturn(data);
- when(data.isUseBackingData()).thenReturn(false);
+ when(data.isExistingVersionUsed()).thenReturn(false);
ArtifactReadable actual = txDataManager.copyArtifact(txDataReal, BRANCH_ID, artifactId1);
@@ -496,7 +496,7 @@ public class TxDataManagerTest {
ArtifactData data = Mockito.mock(ArtifactData.class);
when(artifact1.getOrcsData()).thenReturn(data);
when(artifact2.getOrcsData()).thenReturn(data);
- when(data.isUseBackingData()).thenReturn(false);
+ when(data.isExistingVersionUsed()).thenReturn(false);
ArtifactReadable actual = txDataManager.introduceArtifact(txDataReal, COMMON_ID, readable1, readable2);
@@ -512,7 +512,7 @@ public class TxDataManagerTest {
ArtifactData data = Mockito.mock(ArtifactData.class);
when(artifact1.getOrcsData()).thenReturn(data);
when(artifact2.getOrcsData()).thenReturn(data);
- when(data.isUseBackingData()).thenReturn(false);
+ when(data.isExistingVersionUsed()).thenReturn(false);
when(txData.isOnSameBranch(artifact1)).thenReturn(true);
txDataManager.deleteArtifact(txData, artifact1);
@@ -531,7 +531,7 @@ public class TxDataManagerTest {
ArtifactData data = Mockito.mock(ArtifactData.class);
when(artifact1.getOrcsData()).thenReturn(data);
- when(data.isUseBackingData()).thenReturn(false);
+ when(data.isExistingVersionUsed()).thenReturn(false);
TransactionData changeData = txDataManager.createChangeData(txData);
assertNotNull(changeData);
@@ -547,7 +547,7 @@ public class TxDataManagerTest {
ArtifactData data = Mockito.mock(ArtifactData.class);
when(artifact1.getOrcsData()).thenReturn(data);
when(artifact3.getOrcsData()).thenReturn(data);
- when(data.isUseBackingData()).thenReturn(false);
+ when(data.isExistingVersionUsed()).thenReturn(false);
txDataManager.setRationale(txData, readable1, DEFAULT_HIERARCHY, readable2, rationale);
@@ -563,7 +563,7 @@ public class TxDataManagerTest {
ArtifactData data = Mockito.mock(ArtifactData.class);
when(artifact1.getOrcsData()).thenReturn(data);
when(artifact2.getOrcsData()).thenReturn(data);
- when(data.isUseBackingData()).thenReturn(false);
+ when(data.isExistingVersionUsed()).thenReturn(false);
txDataManager.relate(txData, readable1, DEFAULT_HIERARCHY, readable2);
@@ -579,7 +579,7 @@ public class TxDataManagerTest {
ArtifactData data = Mockito.mock(ArtifactData.class);
when(artifact1.getOrcsData()).thenReturn(data);
when(artifact2.getOrcsData()).thenReturn(data);
- when(data.isUseBackingData()).thenReturn(false);
+ when(data.isExistingVersionUsed()).thenReturn(false);
txDataManager.relate(txData, readable1, DEFAULT_HIERARCHY, readable2, LEXICOGRAPHICAL_DESC);
@@ -599,7 +599,7 @@ public class TxDataManagerTest {
when(artifact1.getOrcsData()).thenReturn(data);
when(artifact2.getOrcsData()).thenReturn(data);
when(artifact3.getOrcsData()).thenReturn(data);
- when(data.isUseBackingData()).thenReturn(false);
+ when(data.isExistingVersionUsed()).thenReturn(false);
txDataManager.addChildren(txData, readable1, children);
@@ -621,7 +621,7 @@ public class TxDataManagerTest {
when(artifact1.getOrcsData()).thenReturn(data);
when(artifact2.getOrcsData()).thenReturn(data);
when(artifact3.getOrcsData()).thenReturn(data);
- when(data.isUseBackingData()).thenReturn(false);
+ when(data.isExistingVersionUsed()).thenReturn(false);
ResultSet<Artifact> related = ResultSets.singleton(artifact3);
when(relationManager.<Artifact> getRelated(session, DEFAULT_HIERARCHY, artifact1, SIDE_A)).thenReturn(related);
@@ -642,7 +642,7 @@ public class TxDataManagerTest {
ArtifactData data = Mockito.mock(ArtifactData.class);
when(artifact1.getOrcsData()).thenReturn(data);
when(artifact2.getOrcsData()).thenReturn(data);
- when(data.isUseBackingData()).thenReturn(false);
+ when(data.isExistingVersionUsed()).thenReturn(false);
txDataManager.unrelate(txData, readable1, DEFAULT_HIERARCHY, readable2);
@@ -656,7 +656,7 @@ public class TxDataManagerTest {
ArtifactData data = Mockito.mock(ArtifactData.class);
when(artifact1.getOrcsData()).thenReturn(data);
- when(data.isUseBackingData()).thenReturn(false);
+ when(data.isExistingVersionUsed()).thenReturn(false);
txDataManager.unrelateFromAll(txData, DEFAULT_HIERARCHY, readable1, IS_CHILD);
@@ -670,7 +670,7 @@ public class TxDataManagerTest {
ArtifactData data = Mockito.mock(ArtifactData.class);
when(artifact1.getOrcsData()).thenReturn(data);
- when(data.isUseBackingData()).thenReturn(false);
+ when(data.isExistingVersionUsed()).thenReturn(false);
txDataManager.unrelateFromAll(txData, readable1);
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/OrcsData.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/OrcsData.java
index 478da121013..9d10344f4f7 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/OrcsData.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/OrcsData.java
@@ -10,7 +10,9 @@
*******************************************************************************/
package org.eclipse.osee.orcs.core.ds;
+import org.eclipse.osee.framework.core.data.ApplicabilityId;
import org.eclipse.osee.framework.core.data.HasLocalId;
+import org.eclipse.osee.framework.core.enums.DirtyState;
import org.eclipse.osee.framework.core.enums.ModificationType;
public interface OrcsData extends HasLocalId<Integer>, HasVersion {
@@ -39,7 +41,17 @@ public interface OrcsData extends HasLocalId<Integer>, HasVersion {
boolean hasModTypeChange();
- public boolean isUseBackingData();
+ public boolean isExistingVersionUsed();
public void setUseBackingData(boolean useBackingData);
+
+ public void setApplicabilityId(ApplicabilityId applicId);
+
+ public ApplicabilityId getApplicabilityId();
+
+ public DirtyState getDirtyState();
+
+ public DirtyState calculateDirtyState(boolean dirty);
+
+ public boolean isDirty();
}
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/artifact/ArtifactImpl.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/artifact/ArtifactImpl.java
index ce809a2fb8e..0fc84dfdbc1 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/artifact/ArtifactImpl.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/artifact/ArtifactImpl.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.orcs.core.internal.artifact;
+import static org.eclipse.osee.framework.core.enums.DirtyState.APPLICABILITY_ONLY;
import java.util.Collection;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.data.IAttributeType;
@@ -126,11 +127,11 @@ public class ArtifactImpl extends AttributeManagerImpl implements Artifact {
@Override
public boolean isDirty() {
- return areAttributesDirty() || hasDirtyArtifactType() || isReplaceWithVersion();
+ return areAttributesDirty() || hasDirtyArtifactType() || isReplaceWithVersion() || APPLICABILITY_ONLY == getOrcsData().getDirtyState();
}
private boolean isReplaceWithVersion() {
- return getModificationType() == ModificationType.REPLACED_WITH_VERSION || artifactData.isUseBackingData();
+ return getModificationType() == ModificationType.REPLACED_WITH_VERSION || artifactData.isExistingVersionUsed();
}
private boolean hasDirtyArtifactType() {
@@ -219,4 +220,4 @@ public class ArtifactImpl extends AttributeManagerImpl implements Artifact {
public Long getUuid() {
return Long.valueOf(getLocalId());
}
-}
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/primitives/AttributeImpl.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/primitives/AttributeImpl.java
index d16a20cec09..03b027ba224 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/primitives/AttributeImpl.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/primitives/AttributeImpl.java
@@ -32,7 +32,6 @@ import org.eclipse.osee.orcs.data.AttributeTypes;
public abstract class AttributeImpl<T> implements Comparable<AttributeImpl<T>>, Attribute<T> {
private AttributeTypes attributeTypeCache;
private Reference<AttributeContainer> containerReference;
- private boolean dirty;
private String defaultValue;
private Log logger;
private AttributeData attributeData;
@@ -46,7 +45,7 @@ public abstract class AttributeImpl<T> implements Comparable<AttributeImpl<T>>,
if (setDefaultValue) {
setToDefaultValue();
}
- dirty = isDirty;
+ getOrcsData().calculateDirtyState(isDirty);
uponInitialize();
}
@@ -155,7 +154,7 @@ public abstract class AttributeImpl<T> implements Comparable<AttributeImpl<T>>,
*/
@Override
public boolean isDirty() {
- return dirty;
+ return getOrcsData().isDirty();
}
protected void markAsChanged(ModificationType modificationType) {
@@ -169,7 +168,7 @@ public abstract class AttributeImpl<T> implements Comparable<AttributeImpl<T>>,
}
private void setDirtyFlag(boolean dirty) {
- this.dirty = dirty;
+ getOrcsData().calculateDirtyState(dirty);
}
@Override
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/graph/impl/GraphBuilderImpl.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/graph/impl/GraphBuilderImpl.java
index 7c9795021ef..9717b80356e 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/graph/impl/GraphBuilderImpl.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/graph/impl/GraphBuilderImpl.java
@@ -77,7 +77,7 @@ public class GraphBuilderImpl extends LoadDataHandlerAdapter implements GraphBui
Artifact artifact = graph.getNode(data);
if (artifact == null) {
artifact = artifactFactory.createArtifact(graph.getSession(), data);
- graph.addNode(artifact, artifact.getOrcsData().isUseBackingData());
+ graph.addNode(artifact, artifact.getOrcsData().isExistingVersionUsed());
RelationNodeAdjacencies adjacencies = relationFactory.createRelationContainer();
graph.addAdjacencies(data.getLocalId(), adjacencies);
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/Relation.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/Relation.java
index ff45518dd61..98cdf3187c8 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/Relation.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/Relation.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.orcs.core.internal.relation;
+import org.eclipse.osee.framework.core.data.ApplicabilityId;
import org.eclipse.osee.framework.core.data.IRelationType;
import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.core.enums.RelationSide;
@@ -27,7 +28,6 @@ public class Relation implements HasOrcsData<RelationData>, OrcsWriteable {
private final RelationTypes relationTypes;
private RelationData relationData;
- private boolean isDirty;
public Relation(RelationTypes relationTypes, RelationData relationData) {
super();
@@ -65,7 +65,7 @@ public class Relation implements HasOrcsData<RelationData>, OrcsWriteable {
@Override
public boolean isDirty() {
- return isDirty;
+ return getOrcsData().isDirty();
}
public void clearDirty() {
@@ -77,7 +77,7 @@ public class Relation implements HasOrcsData<RelationData>, OrcsWriteable {
}
private void setDirtyFlag(boolean dirty) {
- this.isDirty = dirty;
+ getOrcsData().calculateDirtyState(dirty);
}
public String getRationale() {
@@ -99,6 +99,10 @@ public class Relation implements HasOrcsData<RelationData>, OrcsWriteable {
}
}
+ public void setApplicabilityId(ApplicabilityId applicId) {
+ getOrcsData().setApplicabilityId(applicId);
+ }
+
protected void markAsChanged(ModificationType modificationType) {
ModificationType modType = computeModType(getOrcsData().getModType(), modificationType);
getOrcsData().setModType(modType);
@@ -159,7 +163,7 @@ public class Relation implements HasOrcsData<RelationData>, OrcsWriteable {
@Override
public String toString() {
- return "Relation [relationData=" + relationData + ", isDirty=" + isDirty + "]";
+ return "Relation [relationData=" + relationData + ", isDirty=" + getOrcsData().isDirty() + "]";
}
}
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/RelationManager.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/RelationManager.java
index 26da6bc4c85..7700769b3ba 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/RelationManager.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/RelationManager.java
@@ -12,6 +12,7 @@ package org.eclipse.osee.orcs.core.internal.relation;
import java.util.Collection;
import java.util.List;
+import org.eclipse.osee.framework.core.data.ApplicabilityId;
import org.eclipse.osee.framework.core.data.IRelationSorterId;
import org.eclipse.osee.framework.core.data.IRelationType;
import org.eclipse.osee.framework.core.enums.DeletionFlag;
@@ -84,5 +85,7 @@ public interface RelationManager {
void introduce(OrcsSession session, Long branch, RelationNode source, RelationNode destination) throws OseeCoreException;
+ void setApplicabilityId(OrcsSession session, RelationNode aNode, IRelationType type, RelationNode bNode, ApplicabilityId applicId);
+
///////////////////////////////////////
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/impl/RelationManagerImpl.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/impl/RelationManagerImpl.java
index 33c90d8551a..f32bbde2605 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/impl/RelationManagerImpl.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/relation/impl/RelationManagerImpl.java
@@ -32,6 +32,7 @@ import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
+import org.eclipse.osee.framework.core.data.ApplicabilityId;
import org.eclipse.osee.framework.core.data.IRelationSorterId;
import org.eclipse.osee.framework.core.data.IRelationType;
import org.eclipse.osee.framework.core.data.IRelationTypeSide;
@@ -491,6 +492,13 @@ public class RelationManagerImpl implements RelationManager {
}
}
+ @Override
+ public void setApplicabilityId(OrcsSession session, RelationNode aNode, IRelationType type, RelationNode bNode, ApplicabilityId applicId) {
+ ResultSet<Relation> result = getRelation(session, aNode, type, bNode, EXCLUDE_DELETED);
+ Relation relation = result.getExactlyOne();
+ relation.setApplicabilityId(applicId);
+ }
+
private ArtifactReadable doesRelatedArtifactExist(OrcsSession session, Relation rel, RelationNode destination, Long branch) {
// need to check if the related artifact exists
int artIdA = rel.getOrcsData().getArtIdA();
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/transaction/TransactionBuilderImpl.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/transaction/TransactionBuilderImpl.java
index 37d1b468fd0..9eb1972fab4 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/transaction/TransactionBuilderImpl.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/transaction/TransactionBuilderImpl.java
@@ -14,6 +14,7 @@ import java.io.InputStream;
import java.util.Arrays;
import java.util.Collection;
import org.eclipse.osee.executor.admin.CancellableCallable;
+import org.eclipse.osee.framework.core.data.ApplicabilityId;
import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.AttributeId;
import org.eclipse.osee.framework.core.data.BranchId;
@@ -33,6 +34,7 @@ import org.eclipse.osee.framework.jdk.core.util.Conditions;
import org.eclipse.osee.orcs.KeyValueOps;
import org.eclipse.osee.orcs.OrcsSession;
import org.eclipse.osee.orcs.core.internal.artifact.Artifact;
+import org.eclipse.osee.orcs.core.internal.attribute.Attribute;
import org.eclipse.osee.orcs.core.internal.relation.RelationUtil;
import org.eclipse.osee.orcs.core.internal.search.QueryModule;
import org.eclipse.osee.orcs.data.ArtifactReadable;
@@ -233,6 +235,13 @@ public class TransactionBuilderImpl implements TransactionBuilder {
}
@Override
+ public void setAttributeApplicability(ArtifactId art, AttributeId attrId, ApplicabilityId applicId) {
+ Artifact asArtifact = getForWrite(art);
+ Attribute<Object> attribute = asArtifact.getAttributeById(attrId.getLocalId());
+ attribute.getOrcsData().setApplicabilityId(applicId);
+ }
+
+ @Override
public void deleteByAttributeId(ArtifactId sourceArtifact, AttributeId attrId) throws OseeCoreException {
Artifact asArtifact = getForWrite(sourceArtifact);
asArtifact.getAttributeById(attrId.getLocalId()).delete();
@@ -313,6 +322,11 @@ public class TransactionBuilderImpl implements TransactionBuilder {
}
@Override
+ public void setRelationApplicability(ArtifactId artA, IRelationType relType, ArtifactId artB, ApplicabilityId applicId) {
+ txManager.setRelationApplicabilityId(txData, artA, relType, artB, applicId);
+ }
+
+ @Override
public void deleteArtifact(ArtifactId sourceArtifact) throws OseeCoreException {
txManager.deleteArtifact(txData, sourceArtifact);
}
@@ -343,6 +357,11 @@ public class TransactionBuilderImpl implements TransactionBuilder {
id.getGuid()).getResults().getOneOrNull();
}
+ @Override
+ public void setApplicability(ArtifactId artId, ApplicabilityId applicId) {
+ txManager.setApplicabilityId(txData, artId, applicId);
+ }
+
private Long insertValue(String value) {
return keyValueOps.putIfAbsent(value);
}
@@ -383,6 +402,8 @@ public class TransactionBuilderImpl implements TransactionBuilder {
} else {
if (element1 instanceof ArtifactId) {
e1 = ((ArtifactId) element1).getUuid();
+ } else if (element1 instanceof AttributeId) {
+ e1 = new Long(((AttributeId) element1).getLocalId());
} else {
e1 = (Long) element1;
}
@@ -390,8 +411,10 @@ public class TransactionBuilderImpl implements TransactionBuilder {
if (element2 instanceof String) {
e2 = insertValue((String) element2);
} else {
- if (element1 instanceof ArtifactId) {
+ if (element2 instanceof ArtifactId) {
e2 = ((ArtifactId) element2).getUuid();
+ } else if (element2 instanceof AttributeId) {
+ e2 = new Long(((AttributeId) element2).getLocalId());
} else {
e2 = (Long) element2;
}
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/transaction/TxDataManager.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/transaction/TxDataManager.java
index c097930de0f..1b417b75bd3 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/transaction/TxDataManager.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/transaction/TxDataManager.java
@@ -18,6 +18,7 @@ import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
+import org.eclipse.osee.framework.core.data.ApplicabilityId;
import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.IArtifactType;
@@ -182,7 +183,7 @@ public class TxDataManager {
private Artifact copyArtifactForWrite(TxData txData, Artifact source) throws OseeCoreException {
Artifact artifact = artifactFactory.clone(txData.getSession(), source);
- txData.getGraph().addNode(artifact, artifact.getOrcsData().isUseBackingData());
+ txData.getGraph().addNode(artifact, artifact.getOrcsData().isExistingVersionUsed());
relationManager.cloneRelations(txData.getSession(), source, artifact);
return artifact;
}
@@ -333,7 +334,7 @@ public class TxDataManager {
Conditions.checkExpressionFailOnTrue(isDifferent,
"Another instance of writeable detected - writeable tracking would be inconsistent");
- txData.getGraph().addNode(artifact, artifact.getOrcsData().isUseBackingData());
+ txData.getGraph().addNode(artifact, artifact.getOrcsData().isExistingVersionUsed());
}
public void deleteArtifact(TxData txData, ArtifactId sourceArtifact) throws OseeCoreException {
@@ -415,6 +416,12 @@ public class TxDataManager {
relationManager.unrelateFromAll(txData.getSession(), type, asArtifactA, side);
}
+ public void setRelationApplicabilityId(TxData txData, ArtifactId artA, IRelationType type, ArtifactId artB, ApplicabilityId applicId) {
+ Artifact asArtifactA = getForWrite(txData, artA);
+ Artifact asArtifactB = getForWrite(txData, artB);
+ relationManager.setApplicabilityId(txData.getSession(), asArtifactA, type, asArtifactB, applicId);
+ }
+
public TransactionData createChangeData(TxData txData) throws OseeCoreException {
OrcsSession session = txData.getSession();
GraphData graph = txData.getGraph();
@@ -432,6 +439,11 @@ public class TxDataManager {
return new TransactionDataImpl(txData.getBranchId(), txData.getAuthor(), txData.getComment(), changeSet);
}
+ public void setApplicabilityId(TxData txData, ArtifactId artId, ApplicabilityId applicId) {
+ Artifact asArtifactA = getForWrite(txData, artId);
+ asArtifactA.getOrcsData().setApplicabilityId(applicId);
+ }
+
private static final class TransactionDataImpl implements TransactionData {
private final Long branchId;
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/util/OrcsPredicates.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/util/OrcsPredicates.java
index 55429c11af7..226ea763127 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/util/OrcsPredicates.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/util/OrcsPredicates.java
@@ -15,8 +15,6 @@ import static com.google.common.base.Predicates.contains;
import static com.google.common.base.Predicates.containsPattern;
import static com.google.common.base.Predicates.equalTo;
import static com.google.common.base.Predicates.not;
-import com.google.common.base.Function;
-import com.google.common.base.Predicate;
import java.util.regex.Pattern;
import org.eclipse.osee.framework.core.data.HasLocalId;
import org.eclipse.osee.framework.core.enums.DeletionFlag;
@@ -26,6 +24,8 @@ import org.eclipse.osee.orcs.core.internal.attribute.Attribute;
import org.eclipse.osee.orcs.core.internal.relation.Relation;
import org.eclipse.osee.orcs.data.HasDeleteState;
import org.eclipse.osee.orcs.data.Modifiable;
+import com.google.common.base.Function;
+import com.google.common.base.Predicate;
/**
* @author Roberto E. Escobar
diff --git a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/loader/DataLoaderFactoryImplTest.java b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/loader/DataLoaderFactoryImplTest.java
index 71f4887c116..adacf50fb76 100644
--- a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/loader/DataLoaderFactoryImplTest.java
+++ b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/loader/DataLoaderFactoryImplTest.java
@@ -64,7 +64,7 @@ import org.mockito.stubbing.Answer;
/**
* Test Case for {@link DataLoaderFactoryImpl}
- *
+ *
* @author Roberto E. Escobar
*/
public class DataLoaderFactoryImplTest {
@@ -74,22 +74,22 @@ public class DataLoaderFactoryImplTest {
@Mock private JdbcClient jdbcClient;
@Mock private JdbcStatement chStmt;
-
+
@Mock private IdentityManager identityService;
@Mock private SqlProvider sqlProvider;
-
+
@Mock private LoadDataHandler builder;
-
+
@Mock private OrcsObjectFactory rowDataFactory;
@Mock private HasCancellation cancellation;
@Mock private SqlJoinFactory joinFactory;
@Mock private IJoinAccessor joinAccessor;
-
+
@Captor private ArgumentCaptor<LoadSqlContext> contextCaptor;
@Captor private ArgumentCaptor<ArtifactJoinQuery> joinCaptor;
@Captor private ArgumentCaptor<CriteriaOrcsLoad> criteriaCaptor;
@Captor private ArgumentCaptor<LoadDescription> descriptionCaptor;
-
+
@Mock private OrcsSession session;
//@formatter:on
@@ -160,14 +160,15 @@ public class DataLoaderFactoryImplTest {
@Test
public void testLoadArtifactIds() throws OseeCoreException {
LoadLevel expectedLoadLevel = LoadLevel.ARTIFACT_DATA;
- String expected = "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id,\n" + //
- " jart1.art_id, art1.art_type_id, art1.guid\n" + //
- " FROM \n" + //
- "osee_join_artifact jart1, osee_artifact art1, osee_txs txs1\n" + //
- " WHERE \n" + //
- "art1.art_id = jart1.art_id AND jart1.query_id = ? AND art1.gamma_id = txs1.gamma_id\n" + //
- " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
- " ORDER BY txs1.branch_id, jart1.art_id, txs1.transaction_id desc";
+ String expected =
+ "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id, txs1.app_id,\n" + //
+ " jart1.art_id, art1.art_type_id, art1.guid\n" + //
+ " FROM \n" + //
+ "osee_join_artifact jart1, osee_artifact art1, osee_txs txs1\n" + //
+ " WHERE \n" + //
+ "art1.art_id = jart1.art_id AND jart1.query_id = ? AND art1.gamma_id = txs1.gamma_id\n" + //
+ " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
+ " ORDER BY txs1.branch_id, jart1.art_id, txs1.transaction_id desc";
DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
@@ -182,14 +183,15 @@ public class DataLoaderFactoryImplTest {
@Test
public void testLoadArtifactIncludeDeleted() throws OseeCoreException {
LoadLevel expectedLoadLevel = LoadLevel.ARTIFACT_DATA;
- String expected = "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id,\n" + //
- " jart1.art_id, art1.art_type_id, art1.guid\n" + //
- " FROM \n" + //
- "osee_join_artifact jart1, osee_artifact art1, osee_txs txs1\n" + //
- " WHERE \n" + //
- "art1.art_id = jart1.art_id AND jart1.query_id = ? AND art1.gamma_id = txs1.gamma_id\n" + //
- " AND txs1.tx_current IN (1, 2, 3) AND txs1.branch_id = jart1.branch_id\n" + //
- " ORDER BY txs1.branch_id, jart1.art_id, txs1.transaction_id desc";
+ String expected =
+ "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id, txs1.app_id,\n" + //
+ " jart1.art_id, art1.art_type_id, art1.guid\n" + //
+ " FROM \n" + //
+ "osee_join_artifact jart1, osee_artifact art1, osee_txs txs1\n" + //
+ " WHERE \n" + //
+ "art1.art_id = jart1.art_id AND jart1.query_id = ? AND art1.gamma_id = txs1.gamma_id\n" + //
+ " AND txs1.tx_current IN (1, 2, 3) AND txs1.branch_id = jart1.branch_id\n" + //
+ " ORDER BY txs1.branch_id, jart1.art_id, txs1.transaction_id desc";
DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
@@ -206,7 +208,7 @@ public class DataLoaderFactoryImplTest {
public void testLoadArtifactHistorical() throws OseeCoreException {
LoadLevel expectedLoadLevel = LoadLevel.ARTIFACT_DATA;
String expected =
- "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id, txs1.transaction_id as stripe_transaction_id,\n" + //
+ "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id, txs1.app_id, txs1.transaction_id as stripe_transaction_id,\n" + //
" jart1.art_id, art1.art_type_id, art1.guid\n" + //
" FROM \n" + //
"osee_join_artifact jart1, osee_artifact art1, osee_txs txs1\n" + //
@@ -230,7 +232,7 @@ public class DataLoaderFactoryImplTest {
public void testLoadArtifactHistoricalIncludeDeleted() throws OseeCoreException {
LoadLevel expectedLoadLevel = LoadLevel.ARTIFACT_DATA;
String expected =
- "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id, txs1.transaction_id as stripe_transaction_id,\n" + //
+ "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id, txs1.app_id, txs1.transaction_id as stripe_transaction_id,\n" + //
" jart1.art_id, art1.art_type_id, art1.guid\n" + //
" FROM \n" + //
"osee_join_artifact jart1, osee_artifact art1, osee_txs txs1\n" + //
@@ -256,14 +258,15 @@ public class DataLoaderFactoryImplTest {
public void testLoadAttributes() throws OseeCoreException {
LoadLevel expectedLoadLevel = LoadLevel.ARTIFACT_AND_ATTRIBUTE_DATA;
- String expected = "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id,\n" + //
- " jart1.art_id, att1.attr_id, att1.attr_type_id, att1.value, att1.uri\n" + //
- " FROM \n" + //
- "osee_join_artifact jart1, osee_attribute att1, osee_txs txs1\n" + //
- " WHERE \n" + //
- "att1.art_id = jart1.art_id AND jart1.query_id = ? AND att1.gamma_id = txs1.gamma_id\n" + //
- " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
- " ORDER BY txs1.branch_id, jart1.art_id, att1.attr_id, txs1.transaction_id desc";
+ String expected =
+ "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id, txs1.app_id,\n" + //
+ " jart1.art_id, att1.attr_id, att1.attr_type_id, att1.value, att1.uri\n" + //
+ " FROM \n" + //
+ "osee_join_artifact jart1, osee_attribute att1, osee_txs txs1\n" + //
+ " WHERE \n" + //
+ "att1.art_id = jart1.art_id AND jart1.query_id = ? AND att1.gamma_id = txs1.gamma_id\n" + //
+ " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
+ " ORDER BY txs1.branch_id, jart1.art_id, att1.attr_id, txs1.transaction_id desc";
DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
@@ -279,14 +282,15 @@ public class DataLoaderFactoryImplTest {
public void testLoadAttributesWithType() throws OseeCoreException {
LoadLevel expectedLoadLevel = LoadLevel.ARTIFACT_AND_ATTRIBUTE_DATA;
- String expected = "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id,\n" + //
- " jart1.art_id, att1.attr_id, att1.attr_type_id, att1.value, att1.uri\n" + //
- " FROM \n" + //
- "osee_join_artifact jart1, osee_attribute att1, osee_txs txs1\n" + //
- " WHERE \n" + //
- "att1.art_id = jart1.art_id AND jart1.query_id = ? AND att1.attr_type_id = ? AND att1.gamma_id = txs1.gamma_id\n" + //
- " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
- " ORDER BY txs1.branch_id, jart1.art_id, att1.attr_id, txs1.transaction_id desc";
+ String expected =
+ "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id, txs1.app_id,\n" + //
+ " jart1.art_id, att1.attr_id, att1.attr_type_id, att1.value, att1.uri\n" + //
+ " FROM \n" + //
+ "osee_join_artifact jart1, osee_attribute att1, osee_txs txs1\n" + //
+ " WHERE \n" + //
+ "att1.art_id = jart1.art_id AND jart1.query_id = ? AND att1.attr_type_id = ? AND att1.gamma_id = txs1.gamma_id\n" + //
+ " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
+ " ORDER BY txs1.branch_id, jart1.art_id, att1.attr_id, txs1.transaction_id desc";
DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
@@ -304,14 +308,15 @@ public class DataLoaderFactoryImplTest {
public void testLoadAttributesWithTypes() throws OseeCoreException {
LoadLevel expectedLoadLevel = LoadLevel.ARTIFACT_AND_ATTRIBUTE_DATA;
- String expected = "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id,\n" + //
- " jart1.art_id, att1.attr_id, att1.attr_type_id, att1.value, att1.uri\n" + //
- " FROM \n" + //
- "osee_join_artifact jart1, osee_join_id jid1, osee_attribute att1, osee_txs txs1\n" + //
- " WHERE \n" + //
- "att1.art_id = jart1.art_id AND jart1.query_id = ? AND att1.attr_type_id = jid1.id AND jid1.query_id = ? AND att1.gamma_id = txs1.gamma_id\n" + //
- " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
- " ORDER BY txs1.branch_id, jart1.art_id, att1.attr_id, txs1.transaction_id desc";
+ String expected =
+ "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id, txs1.app_id,\n" + //
+ " jart1.art_id, att1.attr_id, att1.attr_type_id, att1.value, att1.uri\n" + //
+ " FROM \n" + //
+ "osee_join_artifact jart1, osee_join_id jid1, osee_attribute att1, osee_txs txs1\n" + //
+ " WHERE \n" + //
+ "att1.art_id = jart1.art_id AND jart1.query_id = ? AND att1.attr_type_id = jid1.id AND jid1.query_id = ? AND att1.gamma_id = txs1.gamma_id\n" + //
+ " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
+ " ORDER BY txs1.branch_id, jart1.art_id, att1.attr_id, txs1.transaction_id desc";
DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
@@ -329,14 +334,15 @@ public class DataLoaderFactoryImplTest {
public void testLoadAttributesWithId() throws OseeCoreException {
LoadLevel expectedLoadLevel = LoadLevel.ARTIFACT_AND_ATTRIBUTE_DATA;
- String expected = "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id,\n" + //
- " jart1.art_id, att1.attr_id, att1.attr_type_id, att1.value, att1.uri\n" + //
- " FROM \n" + //
- "osee_join_artifact jart1, osee_attribute att1, osee_txs txs1\n" + //
- " WHERE \n" + //
- "att1.art_id = jart1.art_id AND jart1.query_id = ? AND att1.attr_id = ? AND att1.gamma_id = txs1.gamma_id\n" + //
- " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
- " ORDER BY txs1.branch_id, jart1.art_id, att1.attr_id, txs1.transaction_id desc";
+ String expected =
+ "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id, txs1.app_id,\n" + //
+ " jart1.art_id, att1.attr_id, att1.attr_type_id, att1.value, att1.uri\n" + //
+ " FROM \n" + //
+ "osee_join_artifact jart1, osee_attribute att1, osee_txs txs1\n" + //
+ " WHERE \n" + //
+ "att1.art_id = jart1.art_id AND jart1.query_id = ? AND att1.attr_id = ? AND att1.gamma_id = txs1.gamma_id\n" + //
+ " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
+ " ORDER BY txs1.branch_id, jart1.art_id, att1.attr_id, txs1.transaction_id desc";
DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
@@ -353,14 +359,15 @@ public class DataLoaderFactoryImplTest {
public void testLoadAttributesWithIds() throws OseeCoreException {
LoadLevel expectedLoadLevel = LoadLevel.ARTIFACT_AND_ATTRIBUTE_DATA;
- String expected = "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id,\n" + //
- " jart1.art_id, att1.attr_id, att1.attr_type_id, att1.value, att1.uri\n" + //
- " FROM \n" + //
- "osee_join_artifact jart1, osee_join_id jid1, osee_attribute att1, osee_txs txs1\n" + //
- " WHERE \n" + //
- "att1.art_id = jart1.art_id AND jart1.query_id = ? AND att1.attr_id = jid1.id AND jid1.query_id = ? AND att1.gamma_id = txs1.gamma_id\n" + //
- " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
- " ORDER BY txs1.branch_id, jart1.art_id, att1.attr_id, txs1.transaction_id desc";
+ String expected =
+ "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id, txs1.app_id,\n" + //
+ " jart1.art_id, att1.attr_id, att1.attr_type_id, att1.value, att1.uri\n" + //
+ " FROM \n" + //
+ "osee_join_artifact jart1, osee_join_id jid1, osee_attribute att1, osee_txs txs1\n" + //
+ " WHERE \n" + //
+ "att1.art_id = jart1.art_id AND jart1.query_id = ? AND att1.attr_id = jid1.id AND jid1.query_id = ? AND att1.gamma_id = txs1.gamma_id\n" + //
+ " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
+ " ORDER BY txs1.branch_id, jart1.art_id, att1.attr_id, txs1.transaction_id desc";
DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
@@ -377,14 +384,15 @@ public class DataLoaderFactoryImplTest {
public void testLoadAttributesWithIdsAndTypes() throws OseeCoreException {
LoadLevel expectedLoadLevel = LoadLevel.ARTIFACT_AND_ATTRIBUTE_DATA;
- String expected = "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id,\n" + //
- " jart1.art_id, att1.attr_id, att1.attr_type_id, att1.value, att1.uri\n" + //
- " FROM \n" + //
- "osee_join_artifact jart1, osee_join_id jid1, osee_join_id jid2, osee_attribute att1, osee_txs txs1\n" + //
- " WHERE \n" + //
- "att1.art_id = jart1.art_id AND jart1.query_id = ? AND att1.attr_id = jid1.id AND jid1.query_id = ? AND att1.attr_type_id = jid2.id AND jid2.query_id = ? AND att1.gamma_id = txs1.gamma_id\n" + //
- " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
- " ORDER BY txs1.branch_id, jart1.art_id, att1.attr_id, txs1.transaction_id desc";
+ String expected =
+ "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id, txs1.app_id,\n" + //
+ " jart1.art_id, att1.attr_id, att1.attr_type_id, att1.value, att1.uri\n" + //
+ " FROM \n" + //
+ "osee_join_artifact jart1, osee_join_id jid1, osee_join_id jid2, osee_attribute att1, osee_txs txs1\n" + //
+ " WHERE \n" + //
+ "att1.art_id = jart1.art_id AND jart1.query_id = ? AND att1.attr_id = jid1.id AND jid1.query_id = ? AND att1.attr_type_id = jid2.id AND jid2.query_id = ? AND att1.gamma_id = txs1.gamma_id\n" + //
+ " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
+ " ORDER BY txs1.branch_id, jart1.art_id, att1.attr_id, txs1.transaction_id desc";
DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
@@ -403,14 +411,15 @@ public class DataLoaderFactoryImplTest {
public void testLoadAttributesWithIdAndType() throws OseeCoreException {
LoadLevel expectedLoadLevel = LoadLevel.ARTIFACT_AND_ATTRIBUTE_DATA;
- String expected = "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id,\n" + //
- " jart1.art_id, att1.attr_id, att1.attr_type_id, att1.value, att1.uri\n" + //
- " FROM \n" + //
- "osee_join_artifact jart1, osee_attribute att1, osee_txs txs1\n" + //
- " WHERE \n" + //
- "att1.art_id = jart1.art_id AND jart1.query_id = ? AND att1.attr_id = ? AND att1.attr_type_id = ? AND att1.gamma_id = txs1.gamma_id\n" + //
- " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
- " ORDER BY txs1.branch_id, jart1.art_id, att1.attr_id, txs1.transaction_id desc";
+ String expected =
+ "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id, txs1.app_id,\n" + //
+ " jart1.art_id, att1.attr_id, att1.attr_type_id, att1.value, att1.uri\n" + //
+ " FROM \n" + //
+ "osee_join_artifact jart1, osee_attribute att1, osee_txs txs1\n" + //
+ " WHERE \n" + //
+ "att1.art_id = jart1.art_id AND jart1.query_id = ? AND att1.attr_id = ? AND att1.attr_type_id = ? AND att1.gamma_id = txs1.gamma_id\n" + //
+ " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
+ " ORDER BY txs1.branch_id, jart1.art_id, att1.attr_id, txs1.transaction_id desc";
DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
@@ -429,14 +438,15 @@ public class DataLoaderFactoryImplTest {
public void testLoadAttributesIncludeDeleted() throws OseeCoreException {
LoadLevel expectedLoadLevel = LoadLevel.ARTIFACT_AND_ATTRIBUTE_DATA;
- String expected = "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id,\n" + //
- " jart1.art_id, att1.attr_id, att1.attr_type_id, att1.value, att1.uri\n" + //
- " FROM \n" + //
- "osee_join_artifact jart1, osee_attribute att1, osee_txs txs1\n" + //
- " WHERE \n" + //
- "att1.art_id = jart1.art_id AND jart1.query_id = ? AND att1.gamma_id = txs1.gamma_id\n" + //
- " AND txs1.tx_current IN (1, 2, 3) AND txs1.branch_id = jart1.branch_id\n" + //
- " ORDER BY txs1.branch_id, jart1.art_id, att1.attr_id, txs1.transaction_id desc";
+ String expected =
+ "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id, txs1.app_id,\n" + //
+ " jart1.art_id, att1.attr_id, att1.attr_type_id, att1.value, att1.uri\n" + //
+ " FROM \n" + //
+ "osee_join_artifact jart1, osee_attribute att1, osee_txs txs1\n" + //
+ " WHERE \n" + //
+ "att1.art_id = jart1.art_id AND jart1.query_id = ? AND att1.gamma_id = txs1.gamma_id\n" + //
+ " AND txs1.tx_current IN (1, 2, 3) AND txs1.branch_id = jart1.branch_id\n" + //
+ " ORDER BY txs1.branch_id, jart1.art_id, att1.attr_id, txs1.transaction_id desc";
DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
@@ -454,7 +464,7 @@ public class DataLoaderFactoryImplTest {
LoadLevel expectedLoadLevel = LoadLevel.ARTIFACT_AND_ATTRIBUTE_DATA;
String expected =
- "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id, txs1.transaction_id as stripe_transaction_id,\n" + //
+ "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id, txs1.app_id, txs1.transaction_id as stripe_transaction_id,\n" + //
" jart1.art_id, att1.attr_id, att1.attr_type_id, att1.value, att1.uri\n" + //
" FROM \n" + //
"osee_join_artifact jart1, osee_attribute att1, osee_txs txs1\n" + //
@@ -479,7 +489,7 @@ public class DataLoaderFactoryImplTest {
LoadLevel expectedLoadLevel = LoadLevel.ARTIFACT_AND_ATTRIBUTE_DATA;
String expected =
- "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id, txs1.transaction_id as stripe_transaction_id,\n" + //
+ "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id, txs1.app_id, txs1.transaction_id as stripe_transaction_id,\n" + //
" jart1.art_id, att1.attr_id, att1.attr_type_id, att1.value, att1.uri\n" + //
" FROM \n" + //
"osee_join_artifact jart1, osee_attribute att1, osee_txs txs1\n" + //
@@ -506,14 +516,15 @@ public class DataLoaderFactoryImplTest {
public void testLoadRelations() throws OseeCoreException {
LoadLevel expectedLoadLevel = LoadLevel.RELATION_DATA;
- String expected = "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id,\n" + //
- " jart1.art_id, rel1.rel_link_id, rel1.rel_link_type_id, rel1.a_art_id, rel1.b_art_id, rel1.rationale\n" + //
- " FROM \n" + //
- "osee_join_artifact jart1, osee_relation_link rel1, osee_txs txs1\n" + //
- " WHERE \n" + //
- "(rel1.a_art_id = jart1.art_id OR rel1.b_art_id = jart1.art_id) AND jart1.query_id = ? AND rel1.gamma_id = txs1.gamma_id\n" + //
- " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
- " ORDER BY txs1.branch_id, jart1.art_id, rel1.rel_link_id, txs1.transaction_id desc";
+ String expected =
+ "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id, txs1.app_id,\n" + //
+ " jart1.art_id, rel1.rel_link_id, rel1.rel_link_type_id, rel1.a_art_id, rel1.b_art_id, rel1.rationale\n" + //
+ " FROM \n" + //
+ "osee_join_artifact jart1, osee_relation_link rel1, osee_txs txs1\n" + //
+ " WHERE \n" + //
+ "(rel1.a_art_id = jart1.art_id OR rel1.b_art_id = jart1.art_id) AND jart1.query_id = ? AND rel1.gamma_id = txs1.gamma_id\n" + //
+ " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
+ " ORDER BY txs1.branch_id, jart1.art_id, rel1.rel_link_id, txs1.transaction_id desc";
DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
@@ -529,14 +540,15 @@ public class DataLoaderFactoryImplTest {
public void testLoadRelationsIncludeDeleted() throws OseeCoreException {
LoadLevel expectedLoadLevel = LoadLevel.RELATION_DATA;
- String expected = "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id,\n" + //
- " jart1.art_id, rel1.rel_link_id, rel1.rel_link_type_id, rel1.a_art_id, rel1.b_art_id, rel1.rationale\n" + //
- " FROM \n" + //
- "osee_join_artifact jart1, osee_relation_link rel1, osee_txs txs1\n" + //
- " WHERE \n" + //
- "(rel1.a_art_id = jart1.art_id OR rel1.b_art_id = jart1.art_id) AND jart1.query_id = ? AND rel1.gamma_id = txs1.gamma_id\n" + //
- " AND txs1.tx_current IN (1, 2, 3) AND txs1.branch_id = jart1.branch_id\n" + //
- " ORDER BY txs1.branch_id, jart1.art_id, rel1.rel_link_id, txs1.transaction_id desc";
+ String expected =
+ "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id, txs1.app_id,\n" + //
+ " jart1.art_id, rel1.rel_link_id, rel1.rel_link_type_id, rel1.a_art_id, rel1.b_art_id, rel1.rationale\n" + //
+ " FROM \n" + //
+ "osee_join_artifact jart1, osee_relation_link rel1, osee_txs txs1\n" + //
+ " WHERE \n" + //
+ "(rel1.a_art_id = jart1.art_id OR rel1.b_art_id = jart1.art_id) AND jart1.query_id = ? AND rel1.gamma_id = txs1.gamma_id\n" + //
+ " AND txs1.tx_current IN (1, 2, 3) AND txs1.branch_id = jart1.branch_id\n" + //
+ " ORDER BY txs1.branch_id, jart1.art_id, rel1.rel_link_id, txs1.transaction_id desc";
DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
@@ -553,14 +565,15 @@ public class DataLoaderFactoryImplTest {
public void testLoadRelationsWithType() throws OseeCoreException {
LoadLevel expectedLoadLevel = LoadLevel.RELATION_DATA;
- String expected = "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id,\n" + //
- " jart1.art_id, rel1.rel_link_id, rel1.rel_link_type_id, rel1.a_art_id, rel1.b_art_id, rel1.rationale\n" + //
- " FROM \n" + //
- "osee_join_artifact jart1, osee_relation_link rel1, osee_txs txs1\n" + //
- " WHERE \n" + //
- "(rel1.a_art_id = jart1.art_id OR rel1.b_art_id = jart1.art_id) AND jart1.query_id = ? AND rel1.rel_link_type_id = ? AND rel1.gamma_id = txs1.gamma_id\n" + //
- " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
- " ORDER BY txs1.branch_id, jart1.art_id, rel1.rel_link_id, txs1.transaction_id desc";
+ String expected =
+ "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id, txs1.app_id,\n" + //
+ " jart1.art_id, rel1.rel_link_id, rel1.rel_link_type_id, rel1.a_art_id, rel1.b_art_id, rel1.rationale\n" + //
+ " FROM \n" + //
+ "osee_join_artifact jart1, osee_relation_link rel1, osee_txs txs1\n" + //
+ " WHERE \n" + //
+ "(rel1.a_art_id = jart1.art_id OR rel1.b_art_id = jart1.art_id) AND jart1.query_id = ? AND rel1.rel_link_type_id = ? AND rel1.gamma_id = txs1.gamma_id\n" + //
+ " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
+ " ORDER BY txs1.branch_id, jart1.art_id, rel1.rel_link_id, txs1.transaction_id desc";
DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
@@ -578,14 +591,15 @@ public class DataLoaderFactoryImplTest {
public void testLoadRelationsWithTypes() throws OseeCoreException {
LoadLevel expectedLoadLevel = LoadLevel.RELATION_DATA;
- String expected = "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id,\n" + //
- " jart1.art_id, rel1.rel_link_id, rel1.rel_link_type_id, rel1.a_art_id, rel1.b_art_id, rel1.rationale\n" + //
- " FROM \n" + //
- "osee_join_artifact jart1, osee_join_id jid1, osee_relation_link rel1, osee_txs txs1\n" + //
- " WHERE \n" + //
- "(rel1.a_art_id = jart1.art_id OR rel1.b_art_id = jart1.art_id) AND jart1.query_id = ? AND rel1.rel_link_type_id = jid1.id AND jid1.query_id = ? AND rel1.gamma_id = txs1.gamma_id\n" + //
- " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
- " ORDER BY txs1.branch_id, jart1.art_id, rel1.rel_link_id, txs1.transaction_id desc";
+ String expected =
+ "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id, txs1.app_id,\n" + //
+ " jart1.art_id, rel1.rel_link_id, rel1.rel_link_type_id, rel1.a_art_id, rel1.b_art_id, rel1.rationale\n" + //
+ " FROM \n" + //
+ "osee_join_artifact jart1, osee_join_id jid1, osee_relation_link rel1, osee_txs txs1\n" + //
+ " WHERE \n" + //
+ "(rel1.a_art_id = jart1.art_id OR rel1.b_art_id = jart1.art_id) AND jart1.query_id = ? AND rel1.rel_link_type_id = jid1.id AND jid1.query_id = ? AND rel1.gamma_id = txs1.gamma_id\n" + //
+ " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
+ " ORDER BY txs1.branch_id, jart1.art_id, rel1.rel_link_id, txs1.transaction_id desc";
DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
@@ -605,14 +619,15 @@ public class DataLoaderFactoryImplTest {
public void testLoadRelationsWithId() throws OseeCoreException {
LoadLevel expectedLoadLevel = LoadLevel.RELATION_DATA;
- String expected = "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id,\n" + //
- " jart1.art_id, rel1.rel_link_id, rel1.rel_link_type_id, rel1.a_art_id, rel1.b_art_id, rel1.rationale\n" + //
- " FROM \n" + //
- "osee_join_artifact jart1, osee_relation_link rel1, osee_txs txs1\n" + //
- " WHERE \n" + //
- "(rel1.a_art_id = jart1.art_id OR rel1.b_art_id = jart1.art_id) AND jart1.query_id = ? AND rel1.rel_link_id = ? AND rel1.gamma_id = txs1.gamma_id\n" + //
- " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
- " ORDER BY txs1.branch_id, jart1.art_id, rel1.rel_link_id, txs1.transaction_id desc";
+ String expected =
+ "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id, txs1.app_id,\n" + //
+ " jart1.art_id, rel1.rel_link_id, rel1.rel_link_type_id, rel1.a_art_id, rel1.b_art_id, rel1.rationale\n" + //
+ " FROM \n" + //
+ "osee_join_artifact jart1, osee_relation_link rel1, osee_txs txs1\n" + //
+ " WHERE \n" + //
+ "(rel1.a_art_id = jart1.art_id OR rel1.b_art_id = jart1.art_id) AND jart1.query_id = ? AND rel1.rel_link_id = ? AND rel1.gamma_id = txs1.gamma_id\n" + //
+ " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
+ " ORDER BY txs1.branch_id, jart1.art_id, rel1.rel_link_id, txs1.transaction_id desc";
DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
@@ -629,14 +644,15 @@ public class DataLoaderFactoryImplTest {
public void testLoadRelationsWithIds() throws OseeCoreException {
LoadLevel expectedLoadLevel = LoadLevel.RELATION_DATA;
- String expected = "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id,\n" + //
- " jart1.art_id, rel1.rel_link_id, rel1.rel_link_type_id, rel1.a_art_id, rel1.b_art_id, rel1.rationale\n" + //
- " FROM \n" + //
- "osee_join_artifact jart1, osee_join_id jid1, osee_relation_link rel1, osee_txs txs1\n" + //
- " WHERE \n" + //
- "(rel1.a_art_id = jart1.art_id OR rel1.b_art_id = jart1.art_id) AND jart1.query_id = ? AND rel1.rel_link_id = jid1.id AND jid1.query_id = ? AND rel1.gamma_id = txs1.gamma_id\n" + //
- " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
- " ORDER BY txs1.branch_id, jart1.art_id, rel1.rel_link_id, txs1.transaction_id desc";
+ String expected =
+ "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id, txs1.app_id,\n" + //
+ " jart1.art_id, rel1.rel_link_id, rel1.rel_link_type_id, rel1.a_art_id, rel1.b_art_id, rel1.rationale\n" + //
+ " FROM \n" + //
+ "osee_join_artifact jart1, osee_join_id jid1, osee_relation_link rel1, osee_txs txs1\n" + //
+ " WHERE \n" + //
+ "(rel1.a_art_id = jart1.art_id OR rel1.b_art_id = jart1.art_id) AND jart1.query_id = ? AND rel1.rel_link_id = jid1.id AND jid1.query_id = ? AND rel1.gamma_id = txs1.gamma_id\n" + //
+ " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
+ " ORDER BY txs1.branch_id, jart1.art_id, rel1.rel_link_id, txs1.transaction_id desc";
DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
@@ -653,14 +669,15 @@ public class DataLoaderFactoryImplTest {
public void testLoadRelationsWithIdsAndTypes() throws OseeCoreException {
LoadLevel expectedLoadLevel = LoadLevel.RELATION_DATA;
- String expected = "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id,\n" + //
- " jart1.art_id, rel1.rel_link_id, rel1.rel_link_type_id, rel1.a_art_id, rel1.b_art_id, rel1.rationale\n" + //
- " FROM \n" + //
- "osee_join_artifact jart1, osee_join_id jid1, osee_join_id jid2, osee_relation_link rel1, osee_txs txs1\n" + //
- " WHERE \n" + //
- "(rel1.a_art_id = jart1.art_id OR rel1.b_art_id = jart1.art_id) AND jart1.query_id = ? AND rel1.rel_link_id = jid1.id AND jid1.query_id = ? AND rel1.rel_link_type_id = jid2.id AND jid2.query_id = ? AND rel1.gamma_id = txs1.gamma_id\n" + //
- " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
- " ORDER BY txs1.branch_id, jart1.art_id, rel1.rel_link_id, txs1.transaction_id desc";
+ String expected =
+ "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id, txs1.app_id,\n" + //
+ " jart1.art_id, rel1.rel_link_id, rel1.rel_link_type_id, rel1.a_art_id, rel1.b_art_id, rel1.rationale\n" + //
+ " FROM \n" + //
+ "osee_join_artifact jart1, osee_join_id jid1, osee_join_id jid2, osee_relation_link rel1, osee_txs txs1\n" + //
+ " WHERE \n" + //
+ "(rel1.a_art_id = jart1.art_id OR rel1.b_art_id = jart1.art_id) AND jart1.query_id = ? AND rel1.rel_link_id = jid1.id AND jid1.query_id = ? AND rel1.rel_link_type_id = jid2.id AND jid2.query_id = ? AND rel1.gamma_id = txs1.gamma_id\n" + //
+ " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
+ " ORDER BY txs1.branch_id, jart1.art_id, rel1.rel_link_id, txs1.transaction_id desc";
DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
@@ -681,14 +698,15 @@ public class DataLoaderFactoryImplTest {
public void testLoadRelationsWithIdAndType() throws OseeCoreException {
LoadLevel expectedLoadLevel = LoadLevel.RELATION_DATA;
- String expected = "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id,\n" + //
- " jart1.art_id, rel1.rel_link_id, rel1.rel_link_type_id, rel1.a_art_id, rel1.b_art_id, rel1.rationale\n" + //
- " FROM \n" + //
- "osee_join_artifact jart1, osee_relation_link rel1, osee_txs txs1\n" + //
- " WHERE \n" + //
- "(rel1.a_art_id = jart1.art_id OR rel1.b_art_id = jart1.art_id) AND jart1.query_id = ? AND rel1.rel_link_id = ? AND rel1.rel_link_type_id = ? AND rel1.gamma_id = txs1.gamma_id\n" + //
- " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
- " ORDER BY txs1.branch_id, jart1.art_id, rel1.rel_link_id, txs1.transaction_id desc";
+ String expected =
+ "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id, txs1.app_id,\n" + //
+ " jart1.art_id, rel1.rel_link_id, rel1.rel_link_type_id, rel1.a_art_id, rel1.b_art_id, rel1.rationale\n" + //
+ " FROM \n" + //
+ "osee_join_artifact jart1, osee_relation_link rel1, osee_txs txs1\n" + //
+ " WHERE \n" + //
+ "(rel1.a_art_id = jart1.art_id OR rel1.b_art_id = jart1.art_id) AND jart1.query_id = ? AND rel1.rel_link_id = ? AND rel1.rel_link_type_id = ? AND rel1.gamma_id = txs1.gamma_id\n" + //
+ " AND txs1.tx_current = 1 AND txs1.branch_id = jart1.branch_id\n" + //
+ " ORDER BY txs1.branch_id, jart1.art_id, rel1.rel_link_id, txs1.transaction_id desc";
DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
@@ -708,7 +726,7 @@ public class DataLoaderFactoryImplTest {
LoadLevel expectedLoadLevel = LoadLevel.RELATION_DATA;
String expected =
- "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id, txs1.transaction_id as stripe_transaction_id,\n" + //
+ "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id, txs1.app_id, txs1.transaction_id as stripe_transaction_id,\n" + //
" jart1.art_id, rel1.rel_link_id, rel1.rel_link_type_id, rel1.a_art_id, rel1.b_art_id, rel1.rationale\n" + //
" FROM \n" + //
"osee_join_artifact jart1, osee_relation_link rel1, osee_txs txs1\n" + //
@@ -731,14 +749,15 @@ public class DataLoaderFactoryImplTest {
@Test
public void testLoadArtifactIncludeDeletedAttributes() throws OseeCoreException {
LoadLevel expectedLoadLevel = LoadLevel.ALL;
- String expected = "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id,\n" + //
- " jart1.art_id, rel1.rel_link_id, rel1.rel_link_type_id, rel1.a_art_id, rel1.b_art_id, rel1.rationale\n" + //
- " FROM \n" + //
- "osee_join_artifact jart1, osee_relation_link rel1, osee_txs txs1\n" + //
- " WHERE \n" + //
- "(rel1.a_art_id = jart1.art_id OR rel1.b_art_id = jart1.art_id) AND jart1.query_id = ? AND rel1.gamma_id = txs1.gamma_id\n" + //
- " AND txs1.tx_current IN (1, 2, 3) AND txs1.branch_id = jart1.branch_id\n" + //
- " ORDER BY txs1.branch_id, jart1.art_id, rel1.rel_link_id, txs1.transaction_id desc";
+ String expected =
+ "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id, txs1.app_id,\n" + //
+ " jart1.art_id, rel1.rel_link_id, rel1.rel_link_type_id, rel1.a_art_id, rel1.b_art_id, rel1.rationale\n" + //
+ " FROM \n" + //
+ "osee_join_artifact jart1, osee_relation_link rel1, osee_txs txs1\n" + //
+ " WHERE \n" + //
+ "(rel1.a_art_id = jart1.art_id OR rel1.b_art_id = jart1.art_id) AND jart1.query_id = ? AND rel1.gamma_id = txs1.gamma_id\n" + //
+ " AND txs1.tx_current IN (1, 2, 3) AND txs1.branch_id = jart1.branch_id\n" + //
+ " ORDER BY txs1.branch_id, jart1.art_id, rel1.rel_link_id, txs1.transaction_id desc";
DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
@@ -756,14 +775,15 @@ public class DataLoaderFactoryImplTest {
@Test
public void testLoadArtifactIncludeDeletedRelations() throws OseeCoreException {
LoadLevel expectedLoadLevel = LoadLevel.ALL;
- String expected = "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id,\n" + //
- " jart1.art_id, rel1.rel_link_id, rel1.rel_link_type_id, rel1.a_art_id, rel1.b_art_id, rel1.rationale\n" + //
- " FROM \n" + //
- "osee_join_artifact jart1, osee_relation_link rel1, osee_txs txs1\n" + //
- " WHERE \n" + //
- "(rel1.a_art_id = jart1.art_id OR rel1.b_art_id = jart1.art_id) AND jart1.query_id = ? AND rel1.rel_link_type_id = ? AND rel1.gamma_id = txs1.gamma_id\n" + //
- " AND txs1.tx_current IN (1, 2, 3) AND txs1.branch_id = jart1.branch_id\n" + //
- " ORDER BY txs1.branch_id, jart1.art_id, rel1.rel_link_id, txs1.transaction_id desc";
+ String expected =
+ "SELECT/*+ ordered */ txs1.gamma_id, txs1.mod_type, txs1.branch_id, txs1.transaction_id, txs1.app_id,\n" + //
+ " jart1.art_id, rel1.rel_link_id, rel1.rel_link_type_id, rel1.a_art_id, rel1.b_art_id, rel1.rationale\n" + //
+ " FROM \n" + //
+ "osee_join_artifact jart1, osee_relation_link rel1, osee_txs txs1\n" + //
+ " WHERE \n" + //
+ "(rel1.a_art_id = jart1.art_id OR rel1.b_art_id = jart1.art_id) AND jart1.query_id = ? AND rel1.rel_link_type_id = ? AND rel1.gamma_id = txs1.gamma_id\n" + //
+ " AND txs1.tx_current IN (1, 2, 3) AND txs1.branch_id = jart1.branch_id\n" + //
+ " ORDER BY txs1.branch_id, jart1.art_id, rel1.rel_link_id, txs1.transaction_id desc";
DataLoader dataLoader = factory.newDataLoaderFromIds(session, COMMON_ID, Arrays.asList(1, 2, 3));
dataLoader.withLoadLevel(expectedLoadLevel);
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/DataFactoryImpl.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/DataFactoryImpl.java
index 082507ce1ea..b3886135cfb 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/DataFactoryImpl.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/DataFactoryImpl.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.orcs.db.internal.loader;
+import org.eclipse.osee.framework.core.data.ApplicabilityId;
import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.HasLocalId;
import org.eclipse.osee.framework.core.data.IArtifactType;
@@ -69,7 +70,7 @@ public class DataFactoryImpl implements DataFactory {
ModificationType modType = RelationalConstants.DEFAULT_MODIFICATION_TYPE;
ArtifactData artifactData =
- objectFactory.createArtifactData(version, (int) artifactId, token, modType, guidToSet);
+ objectFactory.createArtifactData(version, (int) artifactId, token, modType, guidToSet, ApplicabilityId.BASE);
return artifactData;
}
@@ -96,7 +97,8 @@ public class DataFactoryImpl implements DataFactory {
version.setBranchId(parent.getVersion().getBranchId());
ModificationType modType = RelationalConstants.DEFAULT_MODIFICATION_TYPE;
Integer attributeid = RelationalConstants.DEFAULT_ITEM_ID;
- return objectFactory.createAttributeData(version, attributeid, attributeType, modType, parent.getLocalId());
+ return objectFactory.createAttributeData(version, attributeid, attributeType, modType, parent.getLocalId(),
+ ApplicabilityId.BASE);
}
@Override
@@ -122,7 +124,7 @@ public class DataFactoryImpl implements DataFactory {
ModificationType modType = RelationalConstants.DEFAULT_MODIFICATION_TYPE;
Integer relationId = RelationalConstants.DEFAULT_ITEM_ID;
return objectFactory.createRelationData(version, relationId, relationType, modType, aArt.getLocalId(),
- bArt.getLocalId(), rationale);
+ bArt.getLocalId(), rationale, ApplicabilityId.BASE);
}
@Override
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/LoadSqlWriter.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/LoadSqlWriter.java
index dee5b1906fb..a90ab257914 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/LoadSqlWriter.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/LoadSqlWriter.java
@@ -42,7 +42,8 @@ public class LoadSqlWriter extends AbstractSqlWriter {
String artJoinAlias = getLastAlias(TableEnum.ARTIFACT_JOIN_TABLE);
write("SELECT%s ", getSqlHint());
- write("%s.gamma_id, %s.mod_type, %s.branch_id, %s.transaction_id", txAlias, txAlias, txAlias, txAlias);
+ write("%s.gamma_id, %s.mod_type, %s.branch_id, %s.transaction_id, %s.app_id", txAlias, txAlias, txAlias, txAlias,
+ txAlias);
if (OptionsUtil.isHistorical(getOptions())) {
write(", %s.transaction_id as stripe_transaction_id", txAlias);
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/ArtifactDataImpl.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/ArtifactDataImpl.java
index 2c56b2e52ce..29f70aa4f64 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/ArtifactDataImpl.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/ArtifactDataImpl.java
@@ -72,7 +72,7 @@ public class ArtifactDataImpl extends OrcsVersionedObjectImpl implements Artifac
}
@Override
- public boolean isUseBackingData() {
+ public boolean isExistingVersionUsed() {
return useBackingData;
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/ArtifactObjectFactory.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/ArtifactObjectFactory.java
index 6a6f3fc190d..99a8101acf8 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/ArtifactObjectFactory.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/ArtifactObjectFactory.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.orcs.db.internal.loader.data;
+import org.eclipse.osee.framework.core.data.ApplicabilityId;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
@@ -21,9 +22,9 @@ import org.eclipse.osee.orcs.core.ds.VersionData;
*/
public interface ArtifactObjectFactory extends VersionObjectFactory {
- ArtifactData createArtifactData(VersionData version, Integer localId, long typeID, ModificationType modType, String guid) throws OseeCoreException;
+ ArtifactData createArtifactData(VersionData version, Integer localId, long typeID, ModificationType modType, String guid, ApplicabilityId applicId) throws OseeCoreException;
- ArtifactData createArtifactData(VersionData version, int generateArtId, IArtifactType type, ModificationType modType, String guidToSet);
+ ArtifactData createArtifactData(VersionData version, int generateArtId, IArtifactType type, ModificationType modType, String guidToSet, ApplicabilityId applicId);
ArtifactData createCopy(ArtifactData source);
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/AttributeDataImpl.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/AttributeDataImpl.java
index 6f481ea14c3..5e7ee50629e 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/AttributeDataImpl.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/AttributeDataImpl.java
@@ -89,7 +89,7 @@ public class AttributeDataImpl extends OrcsVersionedObjectImpl implements Attrib
}
@Override
- public boolean isUseBackingData() {
+ public boolean isExistingVersionUsed() {
return useBackingData;
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/AttributeObjectFactory.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/AttributeObjectFactory.java
index 5414efb5fd9..86716cff01b 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/AttributeObjectFactory.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/AttributeObjectFactory.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.orcs.db.internal.loader.data;
+import org.eclipse.osee.framework.core.data.ApplicabilityId;
import org.eclipse.osee.framework.core.data.IAttributeType;
import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
@@ -21,9 +22,9 @@ import org.eclipse.osee.orcs.core.ds.VersionData;
*/
public interface AttributeObjectFactory extends VersionObjectFactory {
- AttributeData createAttributeData(VersionData version, Integer localId, long typeID, ModificationType modType, int artId, String value, String uri) throws OseeCoreException;
+ AttributeData createAttributeData(VersionData version, Integer localId, long typeID, ModificationType modType, int artId, String value, String uri, ApplicabilityId applicId) throws OseeCoreException;
- AttributeData createAttributeData(VersionData version, Integer localId, IAttributeType type, ModificationType modType, int artId) throws OseeCoreException;
+ AttributeData createAttributeData(VersionData version, Integer localId, IAttributeType type, ModificationType modType, int artId, ApplicabilityId applicId) throws OseeCoreException;
AttributeData createCopy(AttributeData source) throws OseeCoreException;
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/OrcsObjectFactoryImpl.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/OrcsObjectFactoryImpl.java
index e2d39653aef..c009945374f 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/OrcsObjectFactoryImpl.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/OrcsObjectFactoryImpl.java
@@ -11,6 +11,7 @@
package org.eclipse.osee.orcs.db.internal.loader.data;
import java.util.Date;
+import org.eclipse.osee.framework.core.data.ApplicabilityId;
import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.data.IAttributeType;
@@ -86,27 +87,27 @@ public class OrcsObjectFactoryImpl implements OrcsObjectFactory {
}
@Override
- public ArtifactData createArtifactData(VersionData version, Integer localId, long typeUuid, ModificationType modType, String guid) throws OseeCoreException {
- return createArtifactFromRow(version, localId, typeUuid, modType, typeUuid, modType, guid);
+ public ArtifactData createArtifactData(VersionData version, Integer localId, long typeUuid, ModificationType modType, String guid, ApplicabilityId applicId) throws OseeCoreException {
+ return createArtifactFromRow(version, localId, typeUuid, modType, typeUuid, modType, guid, applicId);
}
@Override
- public ArtifactData createArtifactData(VersionData version, int localId, IArtifactType type, ModificationType modType, String guid) {
+ public ArtifactData createArtifactData(VersionData version, int localId, IArtifactType type, ModificationType modType, String guid, ApplicabilityId applicId) {
long typeUuid = type.getGuid();
- return createArtifactFromRow(version, localId, typeUuid, modType, typeUuid, modType, guid);
+ return createArtifactFromRow(version, localId, typeUuid, modType, typeUuid, modType, guid, applicId);
}
@Override
public ArtifactData createCopy(ArtifactData source) {
VersionData newVersion = createCopy(source.getVersion());
return createArtifactFromRow(newVersion, source.getLocalId(), source.getTypeUuid(), source.getModType(),
- source.getBaseTypeUuid(), source.getBaseModType(), source.getGuid());
+ source.getBaseTypeUuid(), source.getBaseModType(), source.getGuid(), source.getApplicabilityId());
}
@Override
- public AttributeData createAttributeData(VersionData version, Integer localId, long typeId, ModificationType modType, int artifactId, String value, String uri) throws OseeCoreException {
+ public AttributeData createAttributeData(VersionData version, Integer localId, long typeId, ModificationType modType, int artifactId, String value, String uri, ApplicabilityId applicId) throws OseeCoreException {
DataProxy proxy = proxyFactory.createProxy(typeId, value, uri);
- return createAttributeFromRow(version, localId, typeId, modType, typeId, modType, artifactId, proxy);
+ return createAttributeFromRow(version, localId, typeId, modType, typeId, modType, artifactId, proxy, applicId);
}
@Override
@@ -116,28 +117,31 @@ public class OrcsObjectFactoryImpl implements OrcsObjectFactory {
DataProxy sourceProxy = source.getDataProxy();
DataProxy newProxy = proxyFactory.createProxy(typeId, sourceProxy.getData());
return createAttributeFromRow(newVersion, source.getLocalId(), typeId, source.getModType(),
- source.getBaseTypeUuid(), source.getBaseModType(), source.getArtifactId(), newProxy);
+ source.getBaseTypeUuid(), source.getBaseModType(), source.getArtifactId(), newProxy,
+ source.getApplicabilityId());
}
@Override
- public AttributeData createAttributeData(VersionData version, Integer localId, IAttributeType type, ModificationType modType, int artId) throws OseeCoreException {
+ public AttributeData createAttributeData(VersionData version, Integer localId, IAttributeType type, ModificationType modType, int artId, ApplicabilityId applicId) throws OseeCoreException {
long typeId = type.getGuid();
DataProxy proxy = proxyFactory.createProxy(typeId, "", "");
- return createAttributeFromRow(version, localId, typeId, modType, typeId, modType, artId, proxy);
+ return createAttributeFromRow(version, localId, typeId, modType, typeId, modType, artId, proxy, applicId);
}
@Override
- public RelationData createRelationData(VersionData version, Integer localId, long typeId, ModificationType modType, int aArtId, int bArtId, String rationale) throws OseeCoreException {
- return createRelationData(version, localId, typeId, modType, typeId, modType, aArtId, bArtId, rationale);
+ public RelationData createRelationData(VersionData version, Integer localId, long typeId, ModificationType modType, int aArtId, int bArtId, String rationale, ApplicabilityId applicId) throws OseeCoreException {
+ return createRelationData(version, localId, typeId, modType, typeId, modType, aArtId, bArtId, rationale,
+ applicId);
}
@Override
- public RelationData createRelationData(VersionData version, Integer localId, IRelationType type, ModificationType modType, int aArtId, int bArtId, String rationale) {
+ public RelationData createRelationData(VersionData version, Integer localId, IRelationType type, ModificationType modType, int aArtId, int bArtId, String rationale, ApplicabilityId applicId) {
long typeId = type.getGuid();
- return createRelationData(version, localId, typeId, modType, typeId, modType, aArtId, bArtId, rationale);
+ return createRelationData(version, localId, typeId, modType, typeId, modType, aArtId, bArtId, rationale,
+ applicId);
}
- private ArtifactData createArtifactFromRow(VersionData version, int localId, long localTypeID, ModificationType modType, long baseLocalTypeID, ModificationType baseModType, String guid) {
+ private ArtifactData createArtifactFromRow(VersionData version, int localId, long localTypeID, ModificationType modType, long baseLocalTypeID, ModificationType baseModType, String guid, ApplicabilityId applicId) {
ArtifactData data = new ArtifactDataImpl(version);
data.setLocalId(localId);
data.setTypeUuid(localTypeID);
@@ -145,10 +149,11 @@ public class OrcsObjectFactoryImpl implements OrcsObjectFactory {
data.setModType(modType);
data.setBaseModType(baseModType);
data.setGuid(guid);
+ data.setApplicabilityId(applicId);
return data;
}
- private AttributeData createAttributeFromRow(VersionData version, int localId, long localTypeID, ModificationType modType, long baseLocalTypeID, ModificationType baseModType, int artifactId, DataProxy proxy) {
+ private AttributeData createAttributeFromRow(VersionData version, int localId, long localTypeID, ModificationType modType, long baseLocalTypeID, ModificationType baseModType, int artifactId, DataProxy proxy, ApplicabilityId applicId) {
AttributeData data = new AttributeDataImpl(version);
data.setLocalId(localId);
data.setTypeUuid(localTypeID);
@@ -157,10 +162,11 @@ public class OrcsObjectFactoryImpl implements OrcsObjectFactory {
data.setBaseModType(baseModType);
data.setArtifactId(artifactId);
data.setDataProxy(proxy);
+ data.setApplicabilityId(applicId);
return data;
}
- private RelationData createRelationData(VersionData version, int localId, long localTypeID, ModificationType modType, long baseLocalTypeID, ModificationType baseModType, int aArtId, int bArtId, String rationale) {
+ private RelationData createRelationData(VersionData version, int localId, long localTypeID, ModificationType modType, long baseLocalTypeID, ModificationType baseModType, int aArtId, int bArtId, String rationale, ApplicabilityId applicId) {
RelationData data = new RelationDataImpl(version);
data.setLocalId(localId);
data.setTypeUuid(localTypeID);
@@ -170,6 +176,7 @@ public class OrcsObjectFactoryImpl implements OrcsObjectFactory {
data.setArtIdA(aArtId);
data.setArtIdB(bArtId);
data.setRationale(rationale);
+ data.setApplicabilityId(applicId);
return data;
}
@@ -178,7 +185,7 @@ public class OrcsObjectFactoryImpl implements OrcsObjectFactory {
VersionData newVersion = createCopy(source.getVersion());
return createRelationData(newVersion, source.getLocalId(), source.getTypeUuid(), source.getModType(),
source.getBaseTypeUuid(), source.getBaseModType(), source.getArtIdA(), source.getArtIdB(),
- source.getRationale());
+ source.getRationale(), source.getApplicabilityId());
}
@Override
@@ -226,6 +233,7 @@ public class OrcsObjectFactoryImpl implements OrcsObjectFactory {
TupleData data = new TupleDataImpl(version);
data.setBaseModType(ModificationType.NEW);
data.setModType(ModificationType.NEW);
+ data.setApplicabilityId(ApplicabilityId.BASE);
data.setTupleType(tupleType);
data.setElement1(element1);
data.setElement2(element2);
@@ -239,6 +247,7 @@ public class OrcsObjectFactoryImpl implements OrcsObjectFactory {
TupleData data = new TupleDataImpl(version);
data.setBaseModType(ModificationType.NEW);
data.setModType(ModificationType.NEW);
+ data.setApplicabilityId(ApplicabilityId.BASE);
data.setTupleType(tupleType);
data.setElement1(e1);
data.setElement2(e2);
@@ -253,6 +262,7 @@ public class OrcsObjectFactoryImpl implements OrcsObjectFactory {
TupleData data = new TupleDataImpl(version);
data.setBaseModType(ModificationType.NEW);
data.setModType(ModificationType.NEW);
+ data.setApplicabilityId(ApplicabilityId.BASE);
data.setTupleType(tupleType);
data.setElement1(e1);
data.setElement2(e2);
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/OrcsVersionedObjectImpl.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/OrcsVersionedObjectImpl.java
index 3b16384b8f6..54cdae76e59 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/OrcsVersionedObjectImpl.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/OrcsVersionedObjectImpl.java
@@ -10,6 +10,8 @@
*******************************************************************************/
package org.eclipse.osee.orcs.db.internal.loader.data;
+import org.eclipse.osee.framework.core.data.ApplicabilityId;
+import org.eclipse.osee.framework.core.enums.DirtyState;
import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.orcs.core.ds.OrcsData;
import org.eclipse.osee.orcs.core.ds.VersionData;
@@ -18,7 +20,7 @@ import org.eclipse.osee.orcs.db.internal.sql.RelationalConstants;
/**
* @author Roberto E. Escobar
*/
-public abstract class OrcsVersionedObjectImpl extends OrcsObjectImpl<Integer>implements OrcsData {
+public abstract class OrcsVersionedObjectImpl extends OrcsObjectImpl<Integer> implements OrcsData {
private long typeUuid = RelationalConstants.DEFAULT_TYPE_UUID;
private long baseTypeUuid = RelationalConstants.DEFAULT_TYPE_UUID;
@@ -29,6 +31,10 @@ public abstract class OrcsVersionedObjectImpl extends OrcsObjectImpl<Integer>imp
private final VersionData version;
+ private ApplicabilityId applicId;
+ private boolean applicDirty;
+ private DirtyState dirtyState = DirtyState.CLEAN;
+
protected OrcsVersionedObjectImpl(VersionData version) {
super();
this.version = version;
@@ -96,6 +102,47 @@ public abstract class OrcsVersionedObjectImpl extends OrcsObjectImpl<Integer>imp
}
@Override
+ public void setApplicabilityId(ApplicabilityId applicId) {
+ if (this.applicId != null && !this.applicId.equals(applicId)) {
+ if (!dirtyState.isDirty()) {
+ applicDirty = true;
+ dirtyState = DirtyState.APPLICABILITY_ONLY;
+ }
+ }
+ this.applicId = applicId;
+ }
+
+ @Override
+ public ApplicabilityId getApplicabilityId() {
+ return applicId;
+ }
+
+ @Override
+ public DirtyState getDirtyState() {
+ return dirtyState;
+ }
+
+ @Override
+ public boolean isDirty() {
+ return dirtyState.isDirty();
+ }
+
+ @Override
+ public DirtyState calculateDirtyState(boolean dirty) {
+ if (!dirty) {
+ if (applicDirty) {
+ dirtyState = DirtyState.APPLICABILITY_ONLY;
+ } else {
+ dirtyState = DirtyState.CLEAN;
+ }
+ } else if (dirty) {
+ return dirtyState = DirtyState.OTHER_CHANGES;
+ }
+
+ return dirtyState;
+ }
+
+ @Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/RelationDataImpl.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/RelationDataImpl.java
index b4fdba6b68f..b7b504682fd 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/RelationDataImpl.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/RelationDataImpl.java
@@ -116,7 +116,7 @@ public class RelationDataImpl extends OrcsVersionedObjectImpl implements Relatio
}
@Override
- public boolean isUseBackingData() {
+ public boolean isExistingVersionUsed() {
return useBackingData;
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/RelationObjectFactory.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/RelationObjectFactory.java
index 587b1faea07..ecb276f01b7 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/RelationObjectFactory.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/RelationObjectFactory.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.orcs.db.internal.loader.data;
+import org.eclipse.osee.framework.core.data.ApplicabilityId;
import org.eclipse.osee.framework.core.data.IRelationType;
import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
@@ -21,9 +22,9 @@ import org.eclipse.osee.orcs.core.ds.VersionData;
*/
public interface RelationObjectFactory extends VersionObjectFactory {
- RelationData createRelationData(VersionData version, Integer localId, long typeID, ModificationType modType, int aArtId, int bArtId, String rationale) throws OseeCoreException;
+ RelationData createRelationData(VersionData version, Integer localId, long typeID, ModificationType modType, int aArtId, int bArtId, String rationale, ApplicabilityId applicId) throws OseeCoreException;
- RelationData createRelationData(VersionData version, Integer localId, IRelationType type, ModificationType modType, int aArtId, int bArtId, String rationale) throws OseeCoreException;
+ RelationData createRelationData(VersionData version, Integer localId, IRelationType type, ModificationType modType, int aArtId, int bArtId, String rationale, ApplicabilityId applicId) throws OseeCoreException;
RelationData createCopy(RelationData source) throws OseeCoreException;
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/TupleDataImpl.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/TupleDataImpl.java
index f2e8c4c1a37..d91cbe9dff9 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/TupleDataImpl.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/TupleDataImpl.java
@@ -86,7 +86,7 @@ public class TupleDataImpl extends OrcsVersionedObjectImpl implements TupleData
}
@Override
- public boolean isUseBackingData() {
+ public boolean isExistingVersionUsed() {
return false;
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/processor/ArtifactLoadProcessor.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/processor/ArtifactLoadProcessor.java
index ae6cb8ffe88..22a24d318b8 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/processor/ArtifactLoadProcessor.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/processor/ArtifactLoadProcessor.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.orcs.db.internal.loader.processor;
+import org.eclipse.osee.framework.core.data.ApplicabilityId;
import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.jdbc.JdbcStatement;
@@ -39,6 +40,7 @@ public class ArtifactLoadProcessor extends LoadProcessor<ArtifactData, ArtifactO
if (!onCreate.isSame(branchUuid, artifactId)) {
ModificationType modType = ModificationType.getMod(chStmt.getInt("mod_type"));
+ ApplicabilityId applicId = ApplicabilityId.valueOf(chStmt.getLong("app_id"));
// assumption: SQL is returning unwanted deleted artifacts only in the historical case
boolean historical = OptionsUtil.isHistorical(options);
if (!historical || OptionsUtil.areDeletedArtifactsIncluded(options) || modType != ModificationType.DELETED) {
@@ -53,7 +55,7 @@ public class ArtifactLoadProcessor extends LoadProcessor<ArtifactData, ArtifactO
long typeId = chStmt.getLong("art_type_id");
String guid = chStmt.getString("guid");
- toReturn = factory.createArtifactData(version, artifactId, typeId, modType, guid);
+ toReturn = factory.createArtifactData(version, artifactId, typeId, modType, guid, applicId);
}
onCreate.saveConditions(branchUuid, artifactId);
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/processor/AttributeLoadProcessor.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/processor/AttributeLoadProcessor.java
index 5e682e01477..f153739d6e9 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/processor/AttributeLoadProcessor.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/processor/AttributeLoadProcessor.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.orcs.db.internal.loader.processor;
+import org.eclipse.osee.framework.core.data.ApplicabilityId;
import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.jdbc.JdbcStatement;
@@ -41,6 +42,7 @@ public class AttributeLoadProcessor extends LoadProcessor<AttributeData, Attribu
int attrId = chStmt.getInt("attr_id");
long gammaId = chStmt.getInt("gamma_id");
ModificationType modType = ModificationType.getMod(chStmt.getInt("mod_type"));
+ ApplicabilityId applicId = ApplicabilityId.valueOf(chStmt.getLong("app_id"));
boolean historical = OptionsUtil.isHistorical(options);
@@ -60,7 +62,7 @@ public class AttributeLoadProcessor extends LoadProcessor<AttributeData, Attribu
String value = chStmt.getString("value");
String uri = chStmt.getString("uri");
- toReturn = factory.createAttributeData(version, attrId, typeId, modType, artId, value, uri);
+ toReturn = factory.createAttributeData(version, attrId, typeId, modType, artId, value, uri, applicId);
} else {
if (!historical) {
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/processor/RelationLoadProcessor.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/processor/RelationLoadProcessor.java
index ef2c3bbbaac..e2000c6628e 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/processor/RelationLoadProcessor.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/processor/RelationLoadProcessor.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.orcs.db.internal.loader.processor;
+import org.eclipse.osee.framework.core.data.ApplicabilityId;
import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.jdbc.JdbcStatement;
@@ -41,6 +42,7 @@ public class RelationLoadProcessor extends LoadProcessor<RelationData, RelationO
int bArtId = chStmt.getInt("b_art_id");
long typeId = chStmt.getLong("rel_link_type_id");
long gammaId = chStmt.getInt("gamma_id");
+ ApplicabilityId applicId = ApplicabilityId.valueOf(chStmt.getLong("app_id"));
boolean historical = OptionsUtil.isHistorical(options);
@@ -60,7 +62,7 @@ public class RelationLoadProcessor extends LoadProcessor<RelationData, RelationO
String rationale = chStmt.getString("rationale");
- toReturn = factory.createRelationData(version, localId, typeId, modType, aArtId, bArtId, rationale);
+ toReturn = factory.createRelationData(version, localId, typeId, modType, aArtId, bArtId, rationale, applicId);
} else {
if (!historical) {
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/transaction/TxSqlBuilderImpl.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/transaction/TxSqlBuilderImpl.java
index c4b0e09fd38..75895db2cdd 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/transaction/TxSqlBuilderImpl.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/transaction/TxSqlBuilderImpl.java
@@ -98,11 +98,15 @@ public class TxSqlBuilderImpl implements OrcsVisitor, TxSqlBuilder {
@Override
public void visit(ArtifactData data) throws OseeCoreException {
+ boolean isOtherChange =
+ !data.getVersion().isInStorage() || data.hasTypeUuidChange() || data.hasModTypeChange() || data.isExistingVersionUsed();
+ boolean isApplicOnly = data.getDirtyState().isApplicOnly();
+
if (!isNewAndDeleted(data)) {
- if (!data.getVersion().isInStorage() || data.hasTypeUuidChange() || data.hasModTypeChange() || data.isUseBackingData()) {
- boolean isRowAllowed = isGammaCreationAllowed(data);
+ if (isOtherChange || isApplicOnly) {
+ boolean reuseGamma = reuseGamma(data);
updateTxValues(data);
- if (isRowAllowed) {
+ if (!isApplicOnly && !reuseGamma) {
updateGamma(data);
addRow(SqlOrderEnum.ARTIFACTS, data.getLocalId(), data.getTypeUuid(), data.getVersion().getGammaId(),
data.getGuid());
@@ -115,13 +119,13 @@ public class TxSqlBuilderImpl implements OrcsVisitor, TxSqlBuilder {
@Override
public void visit(AttributeData data) throws OseeCoreException {
if (!isNewAndDeleted(data)) {
- boolean isRowAllowed = isGammaCreationAllowed(data);
+ boolean createNewGamma = !reuseGamma(data);
updateTxValues(data);
- if (isRowAllowed) {
+ if (createNewGamma && !data.getDirtyState().isApplicOnly()) {
updateGamma(data);
DataProxy dataProxy = data.getDataProxy();
- DaoToSql daoToSql = new DaoToSql(data.getVersion().getGammaId(), dataProxy, isGammaCreationAllowed(data));
+ DaoToSql daoToSql = new DaoToSql(data.getVersion().getGammaId(), dataProxy, createNewGamma);
addBinaryStore(daoToSql);
if (RelationalConstants.DEFAULT_ITEM_ID == data.getLocalId()) {
@@ -170,9 +174,9 @@ public class TxSqlBuilderImpl implements OrcsVisitor, TxSqlBuilder {
@Override
public void visit(RelationData data) throws OseeCoreException {
if (!isNewAndDeleted(data)) {
- boolean isRowAllowed = isGammaCreationAllowed(data);
+ boolean reuseGamma = reuseGamma(data);
updateTxValues(data);
- if (isRowAllowed) {
+ if (!reuseGamma && !data.getDirtyState().isApplicOnly()) {
updateGamma(data);
if (RelationalConstants.DEFAULT_ITEM_ID == data.getLocalId()) {
int localId = idManager.getNextRelationId();
@@ -188,10 +192,9 @@ public class TxSqlBuilderImpl implements OrcsVisitor, TxSqlBuilder {
private void addTxs(SqlOrderEnum key, OrcsData orcsData) {
VersionData data = orcsData.getVersion();
ModificationType modType = orcsData.getModType();
- //TODO Fix hack: need to modify orcsData, but setting to default 1 instead
addRow(SqlOrderEnum.TXS, data.getTransactionId(), data.getGammaId(), modType.getValue(),
- TxChange.getCurrent(modType).getValue(), data.getBranchId(), 1L);
+ TxChange.getCurrent(modType).getValue(), data.getBranchId(), orcsData.getApplicabilityId());
if (key.hasTxNotCurrentQuery()) {
IdJoinQuery join = txNotCurrentsJoin.get(key);
@@ -214,11 +217,8 @@ public class TxSqlBuilderImpl implements OrcsVisitor, TxSqlBuilder {
private void updateGamma(OrcsData data) throws OseeCoreException {
VersionData version = data.getVersion();
- long gammaId = version.getGammaId();
- if (RelationalConstants.GAMMA_SENTINEL == gammaId || isGammaCreationAllowed(data)) {
- long newGamma = idManager.getNextGammaId();
- version.setGammaId(newGamma);
- }
+ long newGamma = idManager.getNextGammaId();
+ version.setGammaId(newGamma);
}
private ModificationType computeModType(ModificationType original) {
@@ -233,8 +233,8 @@ public class TxSqlBuilderImpl implements OrcsVisitor, TxSqlBuilder {
return sqlJoinFactory.createIdJoinQuery();
}
- protected boolean isGammaCreationAllowed(OrcsData data) {
- return !data.getModType().isExistingVersionUsed() && !data.isUseBackingData();
+ protected boolean reuseGamma(OrcsData data) {
+ return data.getModType().isExistingVersionUsed() || data.isExistingVersionUsed();
}
private void addRow(SqlOrderEnum sqlKey, Object... data) {
diff --git a/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/transaction/TransactionBuilder.java b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/transaction/TransactionBuilder.java
index 7d4a29c867f..f8fd9a89ce3 100644
--- a/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/transaction/TransactionBuilder.java
+++ b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/transaction/TransactionBuilder.java
@@ -12,6 +12,7 @@ package org.eclipse.osee.orcs.transaction;
import java.io.InputStream;
import java.util.Collection;
+import org.eclipse.osee.framework.core.data.ApplicabilityId;
import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.AttributeId;
import org.eclipse.osee.framework.core.data.BranchId;
@@ -101,6 +102,8 @@ public interface TransactionBuilder {
void setAttributeById(ArtifactId art, AttributeId attrId, InputStream stream) throws OseeCoreException;
+ void setAttributeApplicability(ArtifactId art, AttributeId attrId, ApplicabilityId applicId);
+
void deleteByAttributeId(ArtifactId art, AttributeId attrId) throws OseeCoreException;
void deleteSoleAttribute(ArtifactId art, IAttributeType attributeType) throws OseeCoreException;
@@ -133,6 +136,11 @@ public interface TransactionBuilder {
void unrelateFromAll(IRelationTypeSide typeSide, ArtifactId art) throws OseeCoreException;
+ void setRelationApplicability(ArtifactId artA, IRelationType relType, ArtifactId artB, ApplicabilityId applicId);
+
+ // Applic
+ void setApplicability(ArtifactId art, ApplicabilityId applicId);
+
// Tuples
<E1, E2> Long addTuple2(Tuple2Type<E1, E2> tupleType, E1 e1, E2 e2);

Back to the top