diff options
author | donald.g.dunne | 2014-03-05 22:57:46 +0000 |
---|---|---|
committer | Ryan D. Brooks | 2014-03-05 22:57:46 +0000 |
commit | e4971322c655d0104031c84d3374c68ab8ade65f (patch) | |
tree | d8a1eabb3d102b893351fd61ab244f495fd0c73f /plugins/org.eclipse.osee.orcs.db | |
parent | b0bec74eeab68382a089bb715ff09a863c077305 (diff) | |
download | org.eclipse.osee-e4971322c655d0104031c84d3374c68ab8ade65f.tar.gz org.eclipse.osee-e4971322c655d0104031c84d3374c68ab8ade65f.tar.xz org.eclipse.osee-e4971322c655d0104031c84d3374c68ab8ade65f.zip |
feature[ats_ATS19845]: Update branch creation to set uuid
Change-Id: Ide32e8201321eb079893677d02e17381536bf95f
Diffstat (limited to 'plugins/org.eclipse.osee.orcs.db')
6 files changed, 22 insertions, 21 deletions
diff --git a/plugins/org.eclipse.osee.orcs.db/schema/SKYNET.VERSIONING.SCHEMA.xml b/plugins/org.eclipse.osee.orcs.db/schema/SKYNET.VERSIONING.SCHEMA.xml index 77bf3330b0c..89a7b605585 100644 --- a/plugins/org.eclipse.osee.orcs.db/schema/SKYNET.VERSIONING.SCHEMA.xml +++ b/plugins/org.eclipse.osee.orcs.db/schema/SKYNET.VERSIONING.SCHEMA.xml @@ -114,9 +114,9 @@ <Table name="OSEE_BRANCH" schema="OSEE" tablespace="osee_data"> <Column id="BRANCH_GUID" defaultValue="not null" limits="28" type="VARCHAR" /> - <Column id="BRANCH_ID" defaultValue="not null" type="INTEGER" /> + <Column id="BRANCH_ID" defaultValue="not null" type="BIGINT" /> <Column id="BRANCH_NAME" defaultValue="not null" limits="200" type="VARCHAR" /> - <Column id="PARENT_BRANCH_ID" defaultValue="not null" type="INTEGER" /> + <Column id="PARENT_BRANCH_ID" defaultValue="not null" type="BIGINT" /> <Column id="PARENT_TRANSACTION_ID" defaultValue="not null" type="INTEGER" /> <Column id="ARCHIVED" defaultValue="not null" type="smallint" /> <Column id="BRANCH_STATE" defaultValue="not null" type="smallint" /> @@ -146,7 +146,7 @@ </TableDescription> <Table name="OSEE_TXS" schema="OSEE" tablespace="osee_data"> - <Column id="BRANCH_ID" type="INTEGER" defaultValue="not null" /> + <Column id="BRANCH_ID" type="BIGINT" defaultValue="not null" /> <Column id="GAMMA_ID" defaultValue="not null" type="BIGINT" /> <Column id="TRANSACTION_ID" defaultValue="not null" type="INTEGER" /> <Column id="TX_CURRENT" defaultValue="not null" type="smallint" /> @@ -164,7 +164,7 @@ </TableDescription> <Table name="OSEE_TXS_ARCHIVED" schema="OSEE" tablespace="osee_archive_data"> - <Column id="BRANCH_ID" defaultValue="not null" type="INTEGER" /> + <Column id="BRANCH_ID" defaultValue="not null" type="BIGINT" /> <Column id="GAMMA_ID" defaultValue="not null" type="BIGINT" /> <Column id="TRANSACTION_ID" defaultValue="not null" type="INTEGER" /> <Column id="TX_CURRENT" defaultValue="not null" type="smallint" /> @@ -188,7 +188,7 @@ <Table name="OSEE_TX_DETAILS" schema="OSEE" tablespace="osee_data"> <Column id="TRANSACTION_ID" defaultValue="not null" type="INTEGER" /> <Column id="TX_TYPE" defaultValue="not null" type="smallint" /> - <Column id="BRANCH_ID" defaultValue="not null" type="INTEGER" /> + <Column id="BRANCH_ID" defaultValue="not null" type="BIGINT" /> <Column id="OSEE_COMMENT" limits="1000" type="VARCHAR" /> <Column id="TIME" defaultValue="not null" type="TIMESTAMP"/> <Column id="AUTHOR" defaultValue="not null" type="INTEGER"/> @@ -225,7 +225,7 @@ <Column id="ART_ID" defaultValue="not null" type="INTEGER" /> <Column id="PERMISSION_ID" defaultValue="not null" type="INTEGER" /> <Column id="PRIVILEGE_ENTITY_ID" defaultValue="not null" type="INTEGER" /> - <Column id="BRANCH_ID" defaultValue="not null" type="INTEGER" /> + <Column id="BRANCH_ID" defaultValue="not null" type="BIGINT" /> <Constraint schema="OSEE" id="OSEE_ARTIFACT_ACL_A_P_B_PK" type="PRIMARY KEY" appliesTo="ART_ID, PRIVILEGE_ENTITY_ID, BRANCH_ID" /> <Constraint schema="OSEE" id="ARTIFACT_ACL_PERM_FK" type="FOREIGN KEY" appliesTo="PERMISSION_ID" deferrable="true"> <References schema="OSEE" table="OSEE_PERMISSION" column="PERMISSION_ID" /> @@ -233,7 +233,7 @@ </Table> <Table name="OSEE_BRANCH_ACL" schema="OSEE" tablespace="osee_data"> - <Column id="BRANCH_ID" defaultValue="not null" type="INTEGER" /> + <Column id="BRANCH_ID" defaultValue="not null" type="BIGINT" /> <Column id="PERMISSION_ID" defaultValue="not null" type="INTEGER" /> <Column id="PRIVILEGE_ENTITY_ID" defaultValue="not null" type="INTEGER" /> <Constraint schema="OSEE" id="OSEE_BRANCH_ACL_B_P_PK" type="PRIMARY KEY" appliesTo="BRANCH_ID, PRIVILEGE_ENTITY_ID" /> @@ -348,9 +348,9 @@ <!-- __________________________________________________________ --> <Table name="OSEE_MERGE" schema="OSEE" tablespace="osee_data"> - <Column id="SOURCE_BRANCH_ID" defaultValue="not null" type="INTEGER" /> - <Column id="DEST_BRANCH_ID" defaultValue="not null" type="INTEGER" /> - <Column id="MERGE_BRANCH_ID" defaultValue="not null" type="INTEGER" /> + <Column id="SOURCE_BRANCH_ID" defaultValue="not null" type="BIGINT" /> + <Column id="DEST_BRANCH_ID" defaultValue="not null" type="BIGINT" /> + <Column id="MERGE_BRANCH_ID" defaultValue="not null" type="BIGINT" /> <Column id="COMMIT_TRANSACTION_ID" defaultValue="not null" type="INTEGER" /> <Constraint schema="OSEE" id="OSEE_MERGE__PK" type="PRIMARY KEY" appliesTo="MERGE_BRANCH_ID" /> <Constraint schema="OSEE" id="OSEE_MERGE__MBI_FK" type="FOREIGN KEY" appliesTo="MERGE_BRANCH_ID"> @@ -372,7 +372,7 @@ <Table name="OSEE_CONFLICT" schema="OSEE" tablespace="osee_data"> <Column id="CONFLICT_ID" defaultValue="not null" type="INTEGER" /> - <Column id="MERGE_BRANCH_ID" defaultValue="not null" type="INTEGER" /> + <Column id="MERGE_BRANCH_ID" defaultValue="not null" type="BIGINT" /> <Column id="CONFLICT_TYPE" defaultValue="not null" type="smallint" /> <Column id="SOURCE_GAMMA_ID" defaultValue="not null" type="BIGINT" /> <Column id="DEST_GAMMA_ID" defaultValue="not null" type="BIGINT" /> @@ -517,7 +517,7 @@ <Table name="OSEE_JOIN_ARTIFACT" schema="OSEE" tablespace="osee_data"> <Column id="QUERY_ID" defaultValue="not null" type="INTEGER" /> <Column id="ART_ID" defaultValue="not null" type="INTEGER" /> - <Column id="BRANCH_ID" defaultValue="not null" type="INTEGER" /> + <Column id="BRANCH_ID" defaultValue="not null" type="BIGINT" /> <Column id="TRANSACTION_ID" type="INTEGER" /> <Column id="INSERT_TIME" defaultValue="not null" type="TIMESTAMP" /> <Index id="OSEE_JOIN_ART__Q_A_IDX" tablespace="osee_index"> @@ -590,7 +590,7 @@ <Column id="TRANSACTION_ID" defaultValue="not null" type="INTEGER" /> <Column id="GAMMA_ID" defaultValue="not null" type="BIGINT" /> <Column id="INSERT_TIME" defaultValue="not null" type="TIMESTAMP" /> - <Column id="BRANCH_ID" type="INTEGER" /> + <Column id="BRANCH_ID" type="BIGINT" /> <Index id="OSEE_JOIN_TRANSACTION_Q_IDX" tablespace="osee_index"> <AppliesTo id="QUERY_ID"/> </Index> diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/OrcsDataStoreImpl.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/OrcsDataStoreImpl.java index 5963b4fc0ab..f2aeec8ee88 100644 --- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/OrcsDataStoreImpl.java +++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/OrcsDataStoreImpl.java @@ -179,8 +179,8 @@ public class OrcsDataStoreImpl implements OrcsDataStore, TempCachingService { boolean isArchived = BranchArchivedState.valueOf(chStmt.getInt("archived")).isArchived(); String branchGuid = chStmt.getString("branch_guid"); Branch created = - modelFactory.getBranchFactory().createOrUpdate(branchCache, localId, StorageState.LOADED, - branchGuid, branchName, branchType, branchState, isArchived); + modelFactory.getBranchFactory().createOrUpdate(branchCache, branchGuid, localId, + branchName, branchType, branchState, isArchived, StorageState.LOADED); Integer parentBranchId = chStmt.getInt("parent_branch_id"); if (parentBranchId != -1) { diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/accessor/DatabaseBranchAccessor.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/accessor/DatabaseBranchAccessor.java index e108b4b8d7d..16a68815e87 100644 --- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/accessor/DatabaseBranchAccessor.java +++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/accessor/DatabaseBranchAccessor.java @@ -123,8 +123,8 @@ public class DatabaseBranchAccessor implements IOseeDataAccessor<String, Branch> boolean isArchived = BranchArchivedState.valueOf(chStmt.getInt("archived")).isArchived(); String branchGuid = chStmt.getString("branch_guid"); Branch branch = - branchFactory.createOrUpdate(cache, branchId, StorageState.LOADED, branchGuid, branchName, - branchType, branchState, isArchived); + branchFactory.createOrUpdate(cache, branchGuid, branchId, branchName, branchType, + branchState, isArchived, StorageState.LOADED); Integer parentBranchId = chStmt.getInt("parent_branch_id"); if (parentBranchId != NULL_PARENT_BRANCH_ID) { diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/CreateBranchDatabaseTxCallable.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/CreateBranchDatabaseTxCallable.java index 9bf90f39804..f2abf7ef46a 100644 --- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/CreateBranchDatabaseTxCallable.java +++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/CreateBranchDatabaseTxCallable.java @@ -172,11 +172,12 @@ public class CreateBranchDatabaseTxCallable extends AbstractDatastoreTxCallable< if (!GUID.isValid(guid)) { guid = GUID.create(); } + long uuid = newBranchData.getUuid(); final String truncatedName = Strings.truncate(newBranchData.getName(), 195, true); branch = - branchFactory.create(guid, truncatedName, newBranchData.getBranchType(), BranchState.CREATION_IN_PROGRESS, - false); + branchFactory.create(guid, uuid, truncatedName, newBranchData.getBranchType(), + BranchState.CREATION_IN_PROGRESS, false); branch.setParentBranch(parentBranch); branch.setAssociatedArtifactId(newBranchData.getAssociatedArtifactId()); @@ -186,7 +187,7 @@ public class CreateBranchDatabaseTxCallable extends AbstractDatastoreTxCallable< if (branch.getBranchType().isSystemRootBranch()) { TransactionRecord systemTx = - txFactory.create(nextTransactionId, branch.getId(), newBranchData.getCreationComment(), timestamp, + txFactory.create(nextTransactionId, uuid, newBranchData.getCreationComment(), timestamp, newBranchData.getUserArtifactId(), -1, TransactionDetailsType.Baselined, branchCache); branch.setSourceTransaction(systemTx); } else { diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/InitializeDatastoreCallable.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/InitializeDatastoreCallable.java index 79d9ac3f5d3..763676dcea9 100644 --- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/InitializeDatastoreCallable.java +++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/InitializeDatastoreCallable.java @@ -103,6 +103,7 @@ public class InitializeDatastoreCallable extends AbstractDatastoreCallable<DataS data.setGuid(CoreBranches.SYSTEM_ROOT.getGuid()); data.setName(CoreBranches.SYSTEM_ROOT.getName()); + data.setUuid(CoreBranches.SYSTEM_ROOT.getUuid()); data.setBranchType(BranchType.SYSTEM_ROOT); String creationComment = String.format("%s Creation", CoreBranches.SYSTEM_ROOT.getName()); diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/StoreBranchDatabaseCallable.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/StoreBranchDatabaseCallable.java index 3f7166f966a..142d45c2ff3 100644 --- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/StoreBranchDatabaseCallable.java +++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/StoreBranchDatabaseCallable.java @@ -76,7 +76,6 @@ public class StoreBranchDatabaseCallable extends AbstractDatastoreTxCallable<ISt if (isDataDirty(branch)) { switch (branch.getStorageState()) { case CREATED: - branch.setId(getDatabaseService().getSequence().getNextBranchId()); insertData.add(toInsertValues(branch)); break; case MODIFIED: |