Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoberto E. Escobar2014-11-26 23:43:10 +0000
committerAngel Avila2014-11-26 23:43:10 +0000
commit58aee3b10ceeadbe21c1ba539d0b7e5bbbde776a (patch)
treef5e139923f1a21bfea4994553374d823512fb3f4
parent6407bc44a88f6b410f560916358bdf2a90606b8b (diff)
downloadorg.eclipse.osee-58aee3b10ceeadbe21c1ba539d0b7e5bbbde776a.tar.gz
org.eclipse.osee-58aee3b10ceeadbe21c1ba539d0b7e5bbbde776a.tar.xz
org.eclipse.osee-58aee3b10ceeadbe21c1ba539d0b7e5bbbde776a.zip
feature[ats_ATS139503]: Use JdbcService in ORCS
-rw-r--r--plugins/org.eclipse.osee.activity.server/META-INF/MANIFEST.MF2
-rw-r--r--plugins/org.eclipse.osee.activity.server/OSGI-INF/activity.schema.resource.xml6
-rw-r--r--plugins/org.eclipse.osee.activity.server/src/org/eclipse/osee/activity/server/internal/ActivitySchemaResource.java7
-rw-r--r--plugins/org.eclipse.osee.disposition.rest.test/src/org/eclipse/osee/disposition/rest/importer/DispoItemDataCopierTest.java2
-rw-r--r--plugins/org.eclipse.osee.disposition.rest.test/src/org/eclipse/osee/disposition/rest/integration/DispositionIntegrationTest.java2
-rw-r--r--plugins/org.eclipse.osee.disposition.rest.test/src/org/eclipse/osee/disposition/rest/integration/util/DispositionIntegrationRule.java5
-rw-r--r--plugins/org.eclipse.osee.orcs.account.admin.test/META-INF/MANIFEST.MF1
-rw-r--r--plugins/org.eclipse.osee.orcs.account.admin.test/src/org/eclipse/osee/orcs/account/admin/integration/JdbcJaxRsOAuthStorageTest.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.account.admin.test/src/org/eclipse/osee/orcs/account/admin/integration/OrcsAccountStorageTest.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.account.admin.test/src/org/eclipse/osee/orcs/account/admin/integration/OrcsIntegrationRule.java9
-rw-r--r--plugins/org.eclipse.osee.orcs.account.admin.test/src/org/eclipse/osee/orcs/account/admin/integration/OrcsSubscriptionStorageTest.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.account.admin/META-INF/MANIFEST.MF4
-rw-r--r--plugins/org.eclipse.osee.orcs.account.admin/OSGI-INF/jaxrs.jdbc.oauth.schema.resource.xml2
-rw-r--r--plugins/org.eclipse.osee.orcs.account.admin/OSGI-INF/jaxrs.jdbc.oauth.storage.xml4
-rw-r--r--plugins/org.eclipse.osee.orcs.account.admin/OSGI-INF/orcs.account.access.schema.resource.xml2
-rw-r--r--plugins/org.eclipse.osee.orcs.account.admin/OSGI-INF/orcs.account.ds.xml2
-rw-r--r--plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/AccountSessionDatabaseStore.java18
-rw-r--r--plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/AccountSessionSchemaResource.java8
-rw-r--r--plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/OrcsAccountStorage.java12
-rw-r--r--plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/oauth/AbstractDatabaseStorage.java28
-rw-r--r--plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/oauth/AuthCodeGrantStorage.java10
-rw-r--r--plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/oauth/ClientCredentialStorage.java10
-rw-r--r--plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/oauth/JdbcJaxRsOAuthStorage.java16
-rw-r--r--plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/oauth/OAuthSchemaResource.java15
-rw-r--r--plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/oauth/TokenStorage.java14
-rw-r--r--plugins/org.eclipse.osee.orcs.db.mock/META-INF/MANIFEST.MF8
-rw-r--r--plugins/org.eclipse.osee.orcs.db.mock/src/org/eclipse/osee/orcs/db/mock/OseeDatabase.java11
-rw-r--r--plugins/org.eclipse.osee.orcs.db.mock/src/org/eclipse/osee/orcs/db/mock/internal/OsgiUtil.java85
-rw-r--r--plugins/org.eclipse.osee.orcs.db.mock/src/org/eclipse/osee/orcs/db/mock/internal/TestDatabase.java98
-rw-r--r--plugins/org.eclipse.osee.orcs.db.mock/src/org/eclipse/osee/orcs/db/mock/internal/TestDbProvider.java42
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/META-INF/MANIFEST.MF2
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/OrcsDbTestSuite.launch7
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/pom.xml5
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/intergration/IntegrationUtil.java4
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/intergration/LoaderTest.java5
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/intergration/OseeInfoDataAccessorTest.java52
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/loader/DataFactoryImplTest.java1
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/loader/DataLoaderFactoryImplTest.java14
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/proxy/VarCharDataProxyTest.java16
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/QueryTestSuite.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/indexer/callable/consumer/IndexingTaskDatabaseTxCallableTest.java (renamed from plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/indexer/IndexingTaskDatabaseTxCallableTest.java)77
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/sql/join/MockJoinAccessor.java12
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/sql/join/TransactionJoinQueryTest.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/transaction/TransactionWriterTest.java20
-rw-r--r--plugins/org.eclipse.osee.orcs.db/META-INF/MANIFEST.MF5
-rw-r--r--plugins/org.eclipse.osee.orcs.db/OSGI-INF/attribute.provider.xml2
-rw-r--r--plugins/org.eclipse.osee.orcs.db/OSGI-INF/consolidate.artifacts.console.command.xml2
-rw-r--r--plugins/org.eclipse.osee.orcs.db/OSGI-INF/consolidate.relations.console.command.xml2
-rw-r--r--plugins/org.eclipse.osee.orcs.db/OSGI-INF/convert.type.ids.xml4
-rw-r--r--plugins/org.eclipse.osee.orcs.db/OSGI-INF/data.proxy.factory.provider.xml2
-rw-r--r--plugins/org.eclipse.osee.orcs.db/OSGI-INF/exchange.provider.xml2
-rw-r--r--plugins/org.eclipse.osee.orcs.db/OSGI-INF/fix.duplicate.attributes.console.command.xml2
-rw-r--r--plugins/org.eclipse.osee.orcs.db/OSGI-INF/locator.provider.attribute.xml3
-rw-r--r--plugins/org.eclipse.osee.orcs.db/OSGI-INF/locator.provider.exchange.xml3
-rw-r--r--plugins/org.eclipse.osee.orcs.db/OSGI-INF/orcs.data.store.impl.xml4
-rw-r--r--plugins/org.eclipse.osee.orcs.db/OSGI-INF/orcs.sql.join.factory.xml2
-rw-r--r--plugins/org.eclipse.osee.orcs.db/OSGI-INF/osee.datastore.schema.resource.xml4
-rw-r--r--plugins/org.eclipse.osee.orcs.db/OSGI-INF/resource.data.proxy.factory.xml6
-rw-r--r--plugins/org.eclipse.osee.orcs.db/OSGI-INF/system.preferences.data.accessor.xml4
-rw-r--r--plugins/org.eclipse.osee.orcs.db/OSGI-INF/tx.currents.console.command.xml5
-rw-r--r--plugins/org.eclipse.osee.orcs.db/OSGI-INF/tx.prune.console.command.xml5
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/AdminModule.java24
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/IdentityManager.java23
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/OrcsDataStoreImpl.java25
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/accessor/DatabaseConflictAccessor.java22
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/accessor/OseeInfoDataAccessor.java39
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/accessor/UpdatePreviousTxCurrent.java31
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/branch/BranchModule.java43
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/AbstractDatastoreCallable.java12
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/AbstractDatastoreTxCallable.java36
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/ArchiveUnarchiveBranchCallable.java18
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/BranchCopyTxCallable.java37
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/ChangeBranchStateCallable.java12
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/ChangeBranchTypeCallable.java12
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/CheckBranchExchangeIntegrityCallable.java6
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/CommitBranchDatabaseCallable.java15
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/CommitBranchDatabaseTxCallable.java36
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/CompareDatabaseCallable.java17
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/CompositeDatastoreTxCallable.java10
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/ConsolidateArtifactVersionDatabaseTxCallable.java48
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/ConsolidateRelationsDatabaseTxCallable.java34
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/CreateBranchDatabaseTxCallable.java61
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/DeleteRelationDatabaseCallable.java28
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/FetchDatastoreInfoCallable.java24
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/ImportBranchDatabaseCallable.java66
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/InitializeDatastoreCallable.java26
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/InvalidTxCurrentsAndModTypesCallable.java205
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/OrcsTypeLoaderCallable.java12
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/PurgeArtifactTypeDatabaseTxCallable.java10
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/PurgeAttributeTypeDatabaseTxCallable.java40
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/PurgeBranchDatabaseCallable.java23
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/PurgeRelationTypeDatabaseTxCallable.java32
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/PurgeTransactionTxCallable.java40
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/PurgeUnusedBackingDataAndTransactions.java118
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/change/ArtifactChangeItemFactory.java4
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/change/AttributeChangeItemFactory.java4
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/change/ChangeItemLoader.java18
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/change/LoadDeltasBetweenBranches.java29
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/change/LoadDeltasBetweenTxsOnTheSameBranch.java23
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/change/RelationChangeItemFactory.java4
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/conflict/ConflictUtil.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/console/AbstractDatastoreConsoleCommand.java13
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/console/ConsolidateArtifactVersionsCommand.java4
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/console/ConsolidateRelationsCommand.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/console/ConvertLocalTypeIdCommand.java30
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/console/FixDuplicateAttributesCommand.java26
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/console/TxCurrentsCommand.java24
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/console/TxPruneCommand.java24
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/ExchangeDb.java18
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/ExportItemFactory.java26
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/ForeignKeyReader.java6
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/IdTranslator.java24
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/PrimaryKeyCollector.java4
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/ReferentialIntegrityConstraint.java8
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/SavePointManager.java28
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/TranslationManager.java24
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/TxCurrentsOpFactory.java35
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/export/DbTableExportItem.java22
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/export/MetadataExportItem.java6
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/handler/BaseDbSaxHandler.java14
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/handler/BranchDataSaxHandler.java24
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/handler/DbTableSaxHandler.java10
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/handler/MetaData.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/handler/MetaDataSaxHandler.java16
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/transform/ExchangeTransformer.java21
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/transform/IOseeExchangeVersionTransformer.java9
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/transform/V0_9_2Transformer.java20
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/transform/V0_9_2TxsConsolidateParser.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/transform/V0_9_4Transformer.java9
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/DataLoaderFactoryImpl.java14
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/LoadUtil.java6
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/LoaderModule.java12
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/SqlObjectLoader.java16
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/OrcsObjectImpl.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/executors/AbstractLoadExecutor.java12
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/executors/ArtifactQueryContextLoadExecutor.java16
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/executors/LoadExecutor.java6
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/executors/QueryContextLoadExecutor.java6
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/executors/UuidsLoadExecutor.java16
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/processor/AbstractLoadProcessor.java6
-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/BranchLoadProcessor.java4
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/processor/DynamicLoadProcessor.java12
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/processor/LoadProcessor.java6
-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/loader/processor/TransactionLoadProcessor.java4
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/proxy/VarCharDataProxy.java4
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/resource/OseeDatastoreSchemaResource.java7
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/Engines.java10
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/QueryModule.java10
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/indexer/IndexerCallableFactoryImpl.java10
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/indexer/QueryEngineIndexerImpl.java22
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/indexer/callable/DeleteTagSetDatabaseTxCallable.java16
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/indexer/callable/IndexerDatabaseStatisticsCallable.java11
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/indexer/callable/PurgeAllTagsDatabaseCallable.java12
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/indexer/callable/consumer/IndexingTaskDatabaseTxCallable.java24
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/indexer/callable/producer/AbstractIndexerTxDatabaseCallable.java16
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/indexer/callable/producer/IndexAllInQueueCallable.java4
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/indexer/callable/producer/IndexBranchesDatabaseCallable.java10
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/indexer/callable/producer/IndexerDatabaseCallable.java10
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/indexer/callable/producer/XmlStreamIndexerDatabaseCallable.java10
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/indexer/data/GammaQueueIndexerDataSourceLoader.java12
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/util/SecondPassScanner.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/sql/RelationalConstants.java1
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/sql/join/AbstractJoinQuery.java8
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/sql/join/ArtifactJoinQuery.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/sql/join/DatabaseJoinAccessor.java29
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/sql/join/IJoinAccessor.java8
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/sql/join/JoinCleanerCallable.java60
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/sql/join/SqlJoinFactory.java32
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/sql/join/TransactionJoinQuery.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/transaction/CommitTransactionDatabaseTxCallable.java23
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/transaction/TransactionWriter.java22
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/transaction/TxModule.java15
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/types/TypesModule.java16
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/util/Address.java139
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/util/DynamicSchemaResourceProvider.java19
-rw-r--r--plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/util/IdentityManagerImpl.java32
-rw-r--r--plugins/org.eclipse.osee.orcs.test/META-INF/MANIFEST.MF2
-rw-r--r--plugins/org.eclipse.osee.orcs.test/pom.xml42
-rw-r--r--plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/OrcsIntegrationRule.java7
-rw-r--r--plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsAttributeLoadingTest.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsAttributeSearchTest.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsBranchQueryTest.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsBranchTest.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsPortingTest.java6
-rw-r--r--plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsQueryTest.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsRelationLoadingTest.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsScriptTest.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsTransactionTest.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsTxQueryTest.java2
-rw-r--r--plugins/org.eclipse.osee.x.server.p2/demo/hsql.zipbin119154 -> 118599 bytes
193 files changed, 1807 insertions, 1441 deletions
diff --git a/plugins/org.eclipse.osee.activity.server/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.activity.server/META-INF/MANIFEST.MF
index fd5e1fd970..179c53ea31 100644
--- a/plugins/org.eclipse.osee.activity.server/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.activity.server/META-INF/MANIFEST.MF
@@ -11,9 +11,9 @@ Import-Package: javax.annotation;version="1.2.0",
javax.ws.rs.core;version="2.0.0",
javax.ws.rs.ext;version="2.0.0",
org.eclipse.osee.activity.api,
- org.eclipse.osee.database.schema,
org.eclipse.osee.framework.core.exception,
org.eclipse.osee.framework.jdk.core.type,
org.eclipse.osee.framework.jdk.core.util,
+ org.eclipse.osee.jdbc,
org.eclipse.osee.logger
Bundle-Vendor: Eclipse Open System Engineering Environment
diff --git a/plugins/org.eclipse.osee.activity.server/OSGI-INF/activity.schema.resource.xml b/plugins/org.eclipse.osee.activity.server/OSGI-INF/activity.schema.resource.xml
index ad1a83eb8a..942be09a9a 100644
--- a/plugins/org.eclipse.osee.activity.server/OSGI-INF/activity.schema.resource.xml
+++ b/plugins/org.eclipse.osee.activity.server/OSGI-INF/activity.schema.resource.xml
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" >
<implementation class="org.eclipse.osee.activity.server.internal.ActivitySchemaResource" />
- <service>
- <provide interface="org.eclipse.osee.database.schema.SchemaResource"/>
- </service>
+ <service>
+ <provide interface="org.eclipse.osee.jdbc.JdbcSchemaResource"/>
+ </service>
</scr:component>
diff --git a/plugins/org.eclipse.osee.activity.server/src/org/eclipse/osee/activity/server/internal/ActivitySchemaResource.java b/plugins/org.eclipse.osee.activity.server/src/org/eclipse/osee/activity/server/internal/ActivitySchemaResource.java
index 3f5b476c7c..d4d76a4a19 100644
--- a/plugins/org.eclipse.osee.activity.server/src/org/eclipse/osee/activity/server/internal/ActivitySchemaResource.java
+++ b/plugins/org.eclipse.osee.activity.server/src/org/eclipse/osee/activity/server/internal/ActivitySchemaResource.java
@@ -15,14 +15,15 @@ import java.io.InputStream;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
-import org.eclipse.osee.database.schema.SchemaResource;
import org.eclipse.osee.framework.core.exception.OseeExceptions;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.jdbc.JdbcClientConfig;
+import org.eclipse.osee.jdbc.JdbcSchemaResource;
/**
* @author Ryan D. Brooks
*/
-public class ActivitySchemaResource implements SchemaResource {
+public class ActivitySchemaResource implements JdbcSchemaResource {
private static final String SCHEMA_PATH = "schema/ACTIVITY.DS.SCHEMA.xml";
@@ -39,7 +40,7 @@ public class ActivitySchemaResource implements SchemaResource {
}
@Override
- public boolean isApplicable() {
+ public boolean isApplicable(JdbcClientConfig config) {
return true;
}
diff --git a/plugins/org.eclipse.osee.disposition.rest.test/src/org/eclipse/osee/disposition/rest/importer/DispoItemDataCopierTest.java b/plugins/org.eclipse.osee.disposition.rest.test/src/org/eclipse/osee/disposition/rest/importer/DispoItemDataCopierTest.java
index 08c17558f7..b66d166e9b 100644
--- a/plugins/org.eclipse.osee.disposition.rest.test/src/org/eclipse/osee/disposition/rest/importer/DispoItemDataCopierTest.java
+++ b/plugins/org.eclipse.osee.disposition.rest.test/src/org/eclipse/osee/disposition/rest/importer/DispoItemDataCopierTest.java
@@ -50,7 +50,7 @@ public class DispoItemDataCopierTest {
public DispoConnector dispoConnector;
@Rule
- public TestRule rule = DispositionIntegrationRule.integrationRule(this, "osee.demo.hsql");
+ public TestRule rule = DispositionIntegrationRule.integrationRule(this);
@Test
public void testCopyItemData() throws Exception {
diff --git a/plugins/org.eclipse.osee.disposition.rest.test/src/org/eclipse/osee/disposition/rest/integration/DispositionIntegrationTest.java b/plugins/org.eclipse.osee.disposition.rest.test/src/org/eclipse/osee/disposition/rest/integration/DispositionIntegrationTest.java
index 130456e04b..594dc81519 100644
--- a/plugins/org.eclipse.osee.disposition.rest.test/src/org/eclipse/osee/disposition/rest/integration/DispositionIntegrationTest.java
+++ b/plugins/org.eclipse.osee.disposition.rest.test/src/org/eclipse/osee/disposition/rest/integration/DispositionIntegrationTest.java
@@ -44,7 +44,7 @@ public class DispositionIntegrationTest {
public TemporaryFolder folder = new TemporaryFolder();
@Rule
- public TestRule rule = DispositionIntegrationRule.integrationRule(this, "osee.demo.hsql");
+ public TestRule rule = DispositionIntegrationRule.integrationRule(this);
@OsgiService
public OrcsApi orcsApi;
diff --git a/plugins/org.eclipse.osee.disposition.rest.test/src/org/eclipse/osee/disposition/rest/integration/util/DispositionIntegrationRule.java b/plugins/org.eclipse.osee.disposition.rest.test/src/org/eclipse/osee/disposition/rest/integration/util/DispositionIntegrationRule.java
index 66bb998426..a82f8fb041 100644
--- a/plugins/org.eclipse.osee.disposition.rest.test/src/org/eclipse/osee/disposition/rest/integration/util/DispositionIntegrationRule.java
+++ b/plugins/org.eclipse.osee.disposition.rest.test/src/org/eclipse/osee/disposition/rest/integration/util/DispositionIntegrationRule.java
@@ -30,8 +30,9 @@ public final class DispositionIntegrationRule extends OsgiRule {
// Utility
}
- public static TestRule integrationRule(Object testObject, String dbId) {
- return RuleChain.outerRule(new OseeDatabase(dbId)).around(new OsgiRule(new CheckServices(), testObject));
+ public static TestRule integrationRule(Object testObject) {
+ return RuleChain.outerRule(new OseeDatabase("orcs.jdbc.service")).around(
+ new OsgiRule(new CheckServices(), testObject));
}
public static class CheckServices {
diff --git a/plugins/org.eclipse.osee.orcs.account.admin.test/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.orcs.account.admin.test/META-INF/MANIFEST.MF
index 3599b21ecd..685bc22edf 100644
--- a/plugins/org.eclipse.osee.orcs.account.admin.test/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.orcs.account.admin.test/META-INF/MANIFEST.MF
@@ -15,7 +15,6 @@ Require-Bundle: org.junit,
org.eclipse.osee.event.osgi,
org.eclipse.osee.logger,
org.eclipse.osee.framework.core,
- org.eclipse.osee.framework.database,
org.eclipse.osee.framework.core.model,
org.eclipse.osee.framework.resource.management
Import-Package: org.eclipse.osee.orcs.db.mock,
diff --git a/plugins/org.eclipse.osee.orcs.account.admin.test/src/org/eclipse/osee/orcs/account/admin/integration/JdbcJaxRsOAuthStorageTest.java b/plugins/org.eclipse.osee.orcs.account.admin.test/src/org/eclipse/osee/orcs/account/admin/integration/JdbcJaxRsOAuthStorageTest.java
index db6e802f99..0bcf294078 100644
--- a/plugins/org.eclipse.osee.orcs.account.admin.test/src/org/eclipse/osee/orcs/account/admin/integration/JdbcJaxRsOAuthStorageTest.java
+++ b/plugins/org.eclipse.osee.orcs.account.admin.test/src/org/eclipse/osee/orcs/account/admin/integration/JdbcJaxRsOAuthStorageTest.java
@@ -84,7 +84,7 @@ public class JdbcJaxRsOAuthStorageTest {
public static final List<String> REGISTERED_SCOPES = Arrays.asList("scope-1", "scope-2", "scope-3");
@Rule
- public TestRule osgi = OrcsIntegrationRule.integrationRule(this, "osee.demo.hsql");
+ public TestRule osgi = OrcsIntegrationRule.integrationRule(this);
@Rule
public ExpectedException thrown = ExpectedException.none();
diff --git a/plugins/org.eclipse.osee.orcs.account.admin.test/src/org/eclipse/osee/orcs/account/admin/integration/OrcsAccountStorageTest.java b/plugins/org.eclipse.osee.orcs.account.admin.test/src/org/eclipse/osee/orcs/account/admin/integration/OrcsAccountStorageTest.java
index 3fe2164277..e1f3f1aa3d 100644
--- a/plugins/org.eclipse.osee.orcs.account.admin.test/src/org/eclipse/osee/orcs/account/admin/integration/OrcsAccountStorageTest.java
+++ b/plugins/org.eclipse.osee.orcs.account.admin.test/src/org/eclipse/osee/orcs/account/admin/integration/OrcsAccountStorageTest.java
@@ -45,7 +45,7 @@ import org.mockito.Mock;
public class OrcsAccountStorageTest {
@Rule
- public TestRule osgi = OrcsIntegrationRule.integrationRule(this, "osee.demo.hsql");
+ public TestRule osgi = OrcsIntegrationRule.integrationRule(this);
@Rule
public ExpectedException thrown = ExpectedException.none();
diff --git a/plugins/org.eclipse.osee.orcs.account.admin.test/src/org/eclipse/osee/orcs/account/admin/integration/OrcsIntegrationRule.java b/plugins/org.eclipse.osee.orcs.account.admin.test/src/org/eclipse/osee/orcs/account/admin/integration/OrcsIntegrationRule.java
index 707c2ad00e..2a1bc5658f 100644
--- a/plugins/org.eclipse.osee.orcs.account.admin.test/src/org/eclipse/osee/orcs/account/admin/integration/OrcsIntegrationRule.java
+++ b/plugins/org.eclipse.osee.orcs.account.admin.test/src/org/eclipse/osee/orcs/account/admin/integration/OrcsIntegrationRule.java
@@ -13,7 +13,7 @@ package org.eclipse.osee.orcs.account.admin.integration;
import org.eclipse.osee.account.admin.AccountAdmin;
import org.eclipse.osee.event.EventService;
import org.eclipse.osee.executor.admin.ExecutorAdmin;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
+import org.eclipse.osee.jdbc.JdbcService;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.OrcsApi;
import org.eclipse.osee.orcs.db.mock.OseeDatabase;
@@ -32,8 +32,9 @@ public final class OrcsIntegrationRule extends OsgiRule {
// Utility
}
- public static TestRule integrationRule(Object testObject, String dbId) {
- return RuleChain.outerRule(new OseeDatabase(dbId)).around(new OsgiRule(new CheckServices(), testObject));
+ public static TestRule integrationRule(Object testObject) {
+ return RuleChain.outerRule(new OseeDatabase("orcs.jdbc.service", "account.jdbc.service", "oauth.jdbc.service")).around(
+ new OsgiRule(new CheckServices(), testObject));
}
public static class CheckServices {
@@ -42,7 +43,7 @@ public final class OrcsIntegrationRule extends OsgiRule {
@OsgiService public EventAdmin eventAdmin;
@OsgiService public EventService eventService;
@OsgiService public ExecutorAdmin executorAdmin;
- @OsgiService public IOseeDatabaseService dbService;
+ @OsgiService public JdbcService dbService;
@OsgiService public OrcsApi orcsApi;
@OsgiService public AccountAdmin accountAdmin;
// @formatter:on
diff --git a/plugins/org.eclipse.osee.orcs.account.admin.test/src/org/eclipse/osee/orcs/account/admin/integration/OrcsSubscriptionStorageTest.java b/plugins/org.eclipse.osee.orcs.account.admin.test/src/org/eclipse/osee/orcs/account/admin/integration/OrcsSubscriptionStorageTest.java
index 3b3306aff0..7a22fd8571 100644
--- a/plugins/org.eclipse.osee.orcs.account.admin.test/src/org/eclipse/osee/orcs/account/admin/integration/OrcsSubscriptionStorageTest.java
+++ b/plugins/org.eclipse.osee.orcs.account.admin.test/src/org/eclipse/osee/orcs/account/admin/integration/OrcsSubscriptionStorageTest.java
@@ -45,7 +45,7 @@ public class OrcsSubscriptionStorageTest {
private static final String SUBSCRIPTION_GROUP = "Subscription-Group1";
@Rule
- public TestRule osgi = OrcsIntegrationRule.integrationRule(this, "osee.demo.hsql");
+ public TestRule osgi = OrcsIntegrationRule.integrationRule(this);
@Rule
public ExpectedException thrown = ExpectedException.none();
diff --git a/plugins/org.eclipse.osee.orcs.account.admin/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.orcs.account.admin/META-INF/MANIFEST.MF
index 1b77f232b4..e6b7865198 100644
--- a/plugins/org.eclipse.osee.orcs.account.admin/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.orcs.account.admin/META-INF/MANIFEST.MF
@@ -11,17 +11,15 @@ Import-Package: com.google.common.io;version="[11.0.0,15.0.0)",
com.google.gson.reflect,
org.eclipse.osee.account.admin,
org.eclipse.osee.account.admin.ds,
- org.eclipse.osee.database.schema,
org.eclipse.osee.executor.admin,
org.eclipse.osee.framework.core.data,
org.eclipse.osee.framework.core.enums,
org.eclipse.osee.framework.core.exception,
org.eclipse.osee.framework.core.model,
- org.eclipse.osee.framework.database,
- org.eclipse.osee.framework.database.core,
org.eclipse.osee.framework.jdk.core.type,
org.eclipse.osee.framework.jdk.core.util,
org.eclipse.osee.jaxrs.server.security,
+ org.eclipse.osee.jdbc,
org.eclipse.osee.logger,
org.eclipse.osee.orcs,
org.eclipse.osee.orcs.data,
diff --git a/plugins/org.eclipse.osee.orcs.account.admin/OSGI-INF/jaxrs.jdbc.oauth.schema.resource.xml b/plugins/org.eclipse.osee.orcs.account.admin/OSGI-INF/jaxrs.jdbc.oauth.schema.resource.xml
index 61aa8b703a..a37e963465 100644
--- a/plugins/org.eclipse.osee.orcs.account.admin/OSGI-INF/jaxrs.jdbc.oauth.schema.resource.xml
+++ b/plugins/org.eclipse.osee.orcs.account.admin/OSGI-INF/jaxrs.jdbc.oauth.schema.resource.xml
@@ -3,6 +3,6 @@
<implementation
class="org.eclipse.osee.orcs.account.admin.internal.oauth.OAuthSchemaResource" />
<service>
- <provide interface="org.eclipse.osee.database.schema.SchemaResource"/>
+ <provide interface="org.eclipse.osee.jdbc.JdbcSchemaResource"/>
</service>
</scr:component>
diff --git a/plugins/org.eclipse.osee.orcs.account.admin/OSGI-INF/jaxrs.jdbc.oauth.storage.xml b/plugins/org.eclipse.osee.orcs.account.admin/OSGI-INF/jaxrs.jdbc.oauth.storage.xml
index ac5dc9ed2a..f896bba2ae 100644
--- a/plugins/org.eclipse.osee.orcs.account.admin/OSGI-INF/jaxrs.jdbc.oauth.storage.xml
+++ b/plugins/org.eclipse.osee.orcs.account.admin/OSGI-INF/jaxrs.jdbc.oauth.storage.xml
@@ -5,6 +5,6 @@
<provide interface="org.eclipse.osee.jaxrs.server.security.JaxRsOAuthStorage"/>
</service>
<reference bind="setLogger" cardinality="1..1" interface="org.eclipse.osee.logger.Log" name="Log" policy="static"/>
- <reference bind="setDatabaseService" cardinality="1..1" interface="org.eclipse.osee.framework.database.IOseeDatabaseService" name="IOseeDatabaseService" policy="static"/>
- <reference bind="setClientStorageProvider" cardinality="1..1" interface="org.eclipse.osee.orcs.account.admin.internal.oauth.ClientStorageProvider" name="ClientStorageProvider" policy="static"/>
+ <reference bind="setClientStorageProvider" cardinality="1..1" interface="org.eclipse.osee.orcs.account.admin.internal.oauth.ClientStorageProvider" name="ClientStorageProvider" policy="static"/>
+ <reference bind="setJdbcService" cardinality="1..1" interface="org.eclipse.osee.jdbc.JdbcService" name="JdbcService" policy="static" target="(osgi.binding=oauth.jdbc.service)"/>
</scr:component>
diff --git a/plugins/org.eclipse.osee.orcs.account.admin/OSGI-INF/orcs.account.access.schema.resource.xml b/plugins/org.eclipse.osee.orcs.account.admin/OSGI-INF/orcs.account.access.schema.resource.xml
index 23dfadb766..e3854ca6db 100644
--- a/plugins/org.eclipse.osee.orcs.account.admin/OSGI-INF/orcs.account.access.schema.resource.xml
+++ b/plugins/org.eclipse.osee.orcs.account.admin/OSGI-INF/orcs.account.access.schema.resource.xml
@@ -3,6 +3,6 @@
<implementation
class="org.eclipse.osee.orcs.account.admin.internal.AccountSessionSchemaResource" />
<service>
- <provide interface="org.eclipse.osee.database.schema.SchemaResource"/>
+ <provide interface="org.eclipse.osee.jdbc.JdbcSchemaResource"/>
</service>
</scr:component>
diff --git a/plugins/org.eclipse.osee.orcs.account.admin/OSGI-INF/orcs.account.ds.xml b/plugins/org.eclipse.osee.orcs.account.admin/OSGI-INF/orcs.account.ds.xml
index d4eee76aee..67900bf7d2 100644
--- a/plugins/org.eclipse.osee.orcs.account.admin/OSGI-INF/orcs.account.ds.xml
+++ b/plugins/org.eclipse.osee.orcs.account.admin/OSGI-INF/orcs.account.ds.xml
@@ -6,6 +6,6 @@
</service>
<reference bind="setLogger" cardinality="1..1" interface="org.eclipse.osee.logger.Log" name="Log" policy="static"/>
<reference bind="setOrcsApi" cardinality="1..1" interface="org.eclipse.osee.orcs.OrcsApi" name="OrcsApi" policy="static"/>
- <reference bind="setDatabaseService" cardinality="1..1" interface="org.eclipse.osee.framework.database.IOseeDatabaseService" name="IOseeDatabaseService" policy="static"/>
<reference bind="setAccountFactory" cardinality="1..1" interface="org.eclipse.osee.orcs.account.admin.internal.AccountFactory" name="AccountFactory" policy="static"/>
+ <reference bind="setJdbcService" cardinality="1..1" interface="org.eclipse.osee.jdbc.JdbcService" name="JdbcService" policy="static" target="(osgi.binding=account.jdbc.service)"/>
</scr:component>
diff --git a/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/AccountSessionDatabaseStore.java b/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/AccountSessionDatabaseStore.java
index 479c8ab9f4..d9161bb042 100644
--- a/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/AccountSessionDatabaseStore.java
+++ b/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/AccountSessionDatabaseStore.java
@@ -17,11 +17,11 @@ import java.util.List;
import java.util.concurrent.Callable;
import org.eclipse.osee.account.admin.AccountSession;
import org.eclipse.osee.executor.admin.CancellableCallable;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
-import org.eclipse.osee.framework.database.core.IOseeStatement;
import org.eclipse.osee.framework.jdk.core.type.ResultSet;
import org.eclipse.osee.framework.jdk.core.type.ResultSets;
import org.eclipse.osee.framework.jdk.core.util.Lib;
+import org.eclipse.osee.jdbc.JdbcClient;
+import org.eclipse.osee.jdbc.JdbcStatement;
import org.eclipse.osee.logger.Log;
/**
@@ -42,12 +42,12 @@ public class AccountSessionDatabaseStore implements AccountSessionStorage {
private static final String DELETE_BY_SESSION_TOKEN = "DELETE FROM osee_account_session WHERE session_token = ?";
private final Log logger;
- private final IOseeDatabaseService dbService;
+ private final JdbcClient jdbcClient;
private final AccountFactory factory;
- public AccountSessionDatabaseStore(Log logger, IOseeDatabaseService dbService, AccountFactory factory) {
+ public AccountSessionDatabaseStore(Log logger, JdbcClient jdbcClient, AccountFactory factory) {
this.logger = logger;
- this.dbService = dbService;
+ this.jdbcClient = jdbcClient;
this.factory = factory;
}
@@ -86,7 +86,7 @@ public class AccountSessionDatabaseStore implements AccountSessionStorage {
@Override
protected ResultSet<AccountSession> innerCall() throws Exception {
List<AccountSession> list = new LinkedList<AccountSession>();
- IOseeStatement chStmt = dbService.getStatement();
+ JdbcStatement chStmt = jdbcClient.getStatement();
try {
chStmt.runPreparedQuery(query, data);
while (chStmt.next()) {
@@ -119,7 +119,7 @@ public class AccountSessionDatabaseStore implements AccountSessionStorage {
for (AccountSession session : datas) {
data.add(asInsert(session));
}
- int result = dbService.runBatchUpdate(INSERT_ACCOUNT_SESSION, data);
+ int result = jdbcClient.runBatchUpdate(INSERT_ACCOUNT_SESSION, data);
return result;
}
};
@@ -135,7 +135,7 @@ public class AccountSessionDatabaseStore implements AccountSessionStorage {
for (AccountSession session : datas) {
data.add(asUpdate(session));
}
- int result = dbService.runBatchUpdate(UPDATE_BY_ACCOUNT_ID_AND_SESSION_TOKEN, data);
+ int result = jdbcClient.runBatchUpdate(UPDATE_BY_ACCOUNT_ID_AND_SESSION_TOKEN, data);
return result;
}
};
@@ -147,7 +147,7 @@ public class AccountSessionDatabaseStore implements AccountSessionStorage {
@Override
protected Integer innerCall() throws Exception {
- return dbService.runPreparedUpdate(DELETE_BY_SESSION_TOKEN, token);
+ return jdbcClient.runPreparedUpdate(DELETE_BY_SESSION_TOKEN, token);
}
};
}
diff --git a/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/AccountSessionSchemaResource.java b/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/AccountSessionSchemaResource.java
index bb9015c5c2..4de4964ae8 100644
--- a/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/AccountSessionSchemaResource.java
+++ b/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/AccountSessionSchemaResource.java
@@ -15,14 +15,15 @@ import java.io.InputStream;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
-import org.eclipse.osee.database.schema.SchemaResource;
import org.eclipse.osee.framework.core.exception.OseeExceptions;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.jdbc.JdbcClientConfig;
+import org.eclipse.osee.jdbc.JdbcSchemaResource;
/**
* @author Roberto E. Escobar
*/
-public class AccountSessionSchemaResource implements SchemaResource {
+public class AccountSessionSchemaResource implements JdbcSchemaResource {
private static final String SCHEMA_PATH = "schema/ACCOUNT.DS.SCHEMA.xml";
@@ -39,7 +40,7 @@ public class AccountSessionSchemaResource implements SchemaResource {
}
@Override
- public boolean isApplicable() {
+ public boolean isApplicable(JdbcClientConfig config) {
return true;
}
@@ -55,4 +56,5 @@ public class AccountSessionSchemaResource implements SchemaResource {
private URL getResourceURL() {
return getClass().getResource(SCHEMA_PATH);
}
+
}
diff --git a/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/OrcsAccountStorage.java b/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/OrcsAccountStorage.java
index 5b2887a8b7..c3f47d62cd 100644
--- a/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/OrcsAccountStorage.java
+++ b/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/OrcsAccountStorage.java
@@ -21,12 +21,13 @@ import org.eclipse.osee.account.admin.CreateAccountRequest;
import org.eclipse.osee.account.admin.ds.AccountStorage;
import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
import org.eclipse.osee.framework.jdk.core.type.Identifiable;
import org.eclipse.osee.framework.jdk.core.type.Identity;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.type.PropertyStore;
import org.eclipse.osee.framework.jdk.core.type.ResultSet;
+import org.eclipse.osee.jdbc.JdbcClient;
+import org.eclipse.osee.jdbc.JdbcService;
import org.eclipse.osee.orcs.data.ArtifactId;
import org.eclipse.osee.orcs.data.ArtifactReadable;
import org.eclipse.osee.orcs.transaction.TransactionBuilder;
@@ -37,17 +38,18 @@ import org.eclipse.osee.orcs.utility.OrcsUtil;
*/
public class OrcsAccountStorage extends AbstractOrcsStorage implements AccountStorage {
- private IOseeDatabaseService dbService;
+ private JdbcService jdbcService;
private AccountSessionStorage sessionStore;
- public void setDatabaseService(IOseeDatabaseService dbService) {
- this.dbService = dbService;
+ public void setJdbcService(JdbcService jdbcService) {
+ this.jdbcService = jdbcService;
}
@Override
public void start() {
super.start();
- sessionStore = new AccountSessionDatabaseStore(getLogger(), dbService, getFactory());
+ JdbcClient jdbcClient = jdbcService.getClient();
+ sessionStore = new AccountSessionDatabaseStore(getLogger(), jdbcClient, getFactory());
}
@Override
diff --git a/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/oauth/AbstractDatabaseStorage.java b/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/oauth/AbstractDatabaseStorage.java
index 4dc762aaff..9068c641fe 100644
--- a/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/oauth/AbstractDatabaseStorage.java
+++ b/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/oauth/AbstractDatabaseStorage.java
@@ -15,13 +15,13 @@ import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
import java.util.concurrent.Callable;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
-import org.eclipse.osee.framework.database.core.IOseeStatement;
-import org.eclipse.osee.framework.database.core.SQL3DataType;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.type.ResultSet;
import org.eclipse.osee.framework.jdk.core.type.ResultSets;
import org.eclipse.osee.framework.jdk.core.util.Lib;
+import org.eclipse.osee.jdbc.JdbcClient;
+import org.eclipse.osee.jdbc.JdbcStatement;
+import org.eclipse.osee.jdbc.SQL3DataType;
import org.eclipse.osee.logger.Log;
/**
@@ -30,12 +30,12 @@ import org.eclipse.osee.logger.Log;
public abstract class AbstractDatabaseStorage<T> {
private final Log logger;
- private final IOseeDatabaseService dbService;
+ private final JdbcClient jdbcClient;
- public AbstractDatabaseStorage(Log logger, IOseeDatabaseService dbService) {
+ public AbstractDatabaseStorage(Log logger, JdbcClient jdbcClient) {
super();
this.logger = logger;
- this.dbService = dbService;
+ this.jdbcClient = jdbcClient;
}
protected Object asVarcharOrNull(String value) {
@@ -48,7 +48,7 @@ public abstract class AbstractDatabaseStorage<T> {
protected abstract Object[] asDelete(T item);
- protected abstract T readData(IOseeStatement chStmt);
+ protected abstract T readData(JdbcStatement chStmt);
protected <R> R execute(Callable<R> callable) {
try {
@@ -100,7 +100,7 @@ public abstract class AbstractDatabaseStorage<T> {
@Override
protected ResultSet<T> innerCall() throws Exception {
List<T> list = new LinkedList<T>();
- IOseeStatement chStmt = dbService.getStatement();
+ JdbcStatement chStmt = jdbcClient.getStatement();
try {
chStmt.runPreparedQuery(query, data);
while (chStmt.next()) {
@@ -120,7 +120,7 @@ public abstract class AbstractDatabaseStorage<T> {
@Override
protected Long innerCall() throws Exception {
- return dbService.runPreparedQueryFetchObject(-1L, query, data);
+ return jdbcClient.runPreparedQueryFetchObject(-1L, query, data);
}
};
}
@@ -134,7 +134,7 @@ public abstract class AbstractDatabaseStorage<T> {
for (T item : items) {
data.add(asInsert(item));
}
- return dbService.runBatchUpdate(insertSql, data);
+ return jdbcClient.runBatchUpdate(insertSql, data);
}
};
}
@@ -148,7 +148,7 @@ public abstract class AbstractDatabaseStorage<T> {
for (T item : items) {
data.add(asDelete(item));
}
- return dbService.runBatchUpdate(deleteSql, data);
+ return jdbcClient.runBatchUpdate(deleteSql, data);
}
};
}
@@ -162,7 +162,7 @@ public abstract class AbstractDatabaseStorage<T> {
for (T item : items) {
data.add(asUpdate(item));
}
- return dbService.runBatchUpdate(updateSql, data);
+ return jdbcClient.runBatchUpdate(updateSql, data);
}
};
}
@@ -178,8 +178,8 @@ public abstract class AbstractDatabaseStorage<T> {
this.data = data;
}
- protected IOseeDatabaseService getDbService() {
- return dbService;
+ protected JdbcClient getJdbcClient() {
+ return jdbcClient;
}
@Override
diff --git a/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/oauth/AuthCodeGrantStorage.java b/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/oauth/AuthCodeGrantStorage.java
index 33ae320862..a8b414cb75 100644
--- a/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/oauth/AuthCodeGrantStorage.java
+++ b/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/oauth/AuthCodeGrantStorage.java
@@ -13,10 +13,10 @@ package org.eclipse.osee.orcs.account.admin.internal.oauth;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
-import org.eclipse.osee.framework.database.core.IOseeStatement;
import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.jaxrs.server.security.OAuthCodeGrant;
+import org.eclipse.osee.jdbc.JdbcClient;
+import org.eclipse.osee.jdbc.JdbcStatement;
import org.eclipse.osee.logger.Log;
/**
@@ -33,8 +33,8 @@ public class AuthCodeGrantStorage extends AbstractDatabaseStorage<OAuthCodeGrant
private static final String DELETE_AUTH_CODE_BY_ID = "DELETE FROM osee_oauth_authorization WHERE id = ?";
- public AuthCodeGrantStorage(Log logger, IOseeDatabaseService dbService) {
- super(logger, dbService);
+ public AuthCodeGrantStorage(Log logger, JdbcClient jdbcClient) {
+ super(logger, jdbcClient);
}
@Override
@@ -101,7 +101,7 @@ public class AuthCodeGrantStorage extends AbstractDatabaseStorage<OAuthCodeGrant
}
@Override
- protected OAuthCodeGrant readData(IOseeStatement chStmt) {
+ protected OAuthCodeGrant readData(JdbcStatement chStmt) {
final long uuid = chStmt.getLong("id");
final long clientId = chStmt.getLong("client_id");
final long subjectId = chStmt.getLong("subject_id");
diff --git a/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/oauth/ClientCredentialStorage.java b/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/oauth/ClientCredentialStorage.java
index a3cbc51cdb..f14ad9c72e 100644
--- a/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/oauth/ClientCredentialStorage.java
+++ b/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/oauth/ClientCredentialStorage.java
@@ -13,9 +13,9 @@ package org.eclipse.osee.orcs.account.admin.internal.oauth;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
-import org.eclipse.osee.framework.database.core.IOseeStatement;
import org.eclipse.osee.framework.jdk.core.util.Strings;
+import org.eclipse.osee.jdbc.JdbcClient;
+import org.eclipse.osee.jdbc.JdbcStatement;
import org.eclipse.osee.logger.Log;
/**
@@ -41,8 +41,8 @@ public class ClientCredentialStorage extends AbstractDatabaseStorage<OAuthClient
private static final String UPDATE_BY_CLIENT_CREDENTIAL =
"UPDATE osee_oauth_client_credential SET subject_id = ?, client_key = ?, client_key = ?, client_secret = ?, client_cert = ? WHERE client_id = ? AND application_id = ?";
- public ClientCredentialStorage(Log logger, IOseeDatabaseService dbService) {
- super(logger, dbService);
+ public ClientCredentialStorage(Log logger, JdbcClient jdbcClient) {
+ super(logger, jdbcClient);
}
@Override
@@ -101,7 +101,7 @@ public class ClientCredentialStorage extends AbstractDatabaseStorage<OAuthClient
}
@Override
- protected OAuthClientCredential readData(IOseeStatement chStmt) {
+ protected OAuthClientCredential readData(JdbcStatement chStmt) {
final long clientId = chStmt.getLong("client_id");
final long applicationId = chStmt.getLong("application_id");
final long subjectId = chStmt.getLong("subject_id");
diff --git a/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/oauth/JdbcJaxRsOAuthStorage.java b/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/oauth/JdbcJaxRsOAuthStorage.java
index 2079606793..92330e5c58 100644
--- a/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/oauth/JdbcJaxRsOAuthStorage.java
+++ b/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/oauth/JdbcJaxRsOAuthStorage.java
@@ -11,12 +11,13 @@
package org.eclipse.osee.orcs.account.admin.internal.oauth;
import java.util.List;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
import org.eclipse.osee.framework.jdk.core.type.OseePrincipal;
import org.eclipse.osee.jaxrs.server.security.JaxRsOAuthStorage;
import org.eclipse.osee.jaxrs.server.security.OAuthClient;
import org.eclipse.osee.jaxrs.server.security.OAuthCodeGrant;
import org.eclipse.osee.jaxrs.server.security.OAuthToken;
+import org.eclipse.osee.jdbc.JdbcClient;
+import org.eclipse.osee.jdbc.JdbcService;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.data.ArtifactReadable;
@@ -26,7 +27,7 @@ import org.eclipse.osee.orcs.data.ArtifactReadable;
public class JdbcJaxRsOAuthStorage implements JaxRsOAuthStorage {
private Log logger;
- private IOseeDatabaseService dbService;
+ private JdbcService jdbcService;
private AuthCodeGrantStorage authCodeGrantStorage;
private TokenStorage tokenStorage;
@@ -37,8 +38,8 @@ public class JdbcJaxRsOAuthStorage implements JaxRsOAuthStorage {
this.logger = logger;
}
- public void setDatabaseService(IOseeDatabaseService dbService) {
- this.dbService = dbService;
+ public void setJdbcService(JdbcService jdbcService) {
+ this.jdbcService = jdbcService;
}
public void setClientStorageProvider(ClientStorageProvider clientStorageProvider) {
@@ -46,9 +47,10 @@ public class JdbcJaxRsOAuthStorage implements JaxRsOAuthStorage {
}
public void start() {
- authCodeGrantStorage = new AuthCodeGrantStorage(logger, dbService);
- tokenStorage = new TokenStorage(logger, dbService);
- credentialStorage = new ClientCredentialStorage(logger, dbService);
+ JdbcClient jdbcClient = jdbcService.getClient();
+ authCodeGrantStorage = new AuthCodeGrantStorage(logger, jdbcClient);
+ tokenStorage = new TokenStorage(logger, jdbcClient);
+ credentialStorage = new ClientCredentialStorage(logger, jdbcClient);
}
public void stop() {
diff --git a/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/oauth/OAuthSchemaResource.java b/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/oauth/OAuthSchemaResource.java
index d78ec5d7da..c79febf9aa 100644
--- a/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/oauth/OAuthSchemaResource.java
+++ b/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/oauth/OAuthSchemaResource.java
@@ -15,13 +15,14 @@ import java.io.InputStream;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
-import org.eclipse.osee.database.schema.SchemaResource;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.jdbc.JdbcClientConfig;
+import org.eclipse.osee.jdbc.JdbcSchemaResource;
/**
* @author Roberto E. Escobar
*/
-public class OAuthSchemaResource implements SchemaResource {
+public class OAuthSchemaResource implements JdbcSchemaResource {
private static final String SCHEMA_PATH = "schema/OAUTH.DS.SCHEMA.xml";
@@ -38,10 +39,14 @@ public class OAuthSchemaResource implements SchemaResource {
}
@Override
- public boolean isApplicable() {
+ public boolean isApplicable(JdbcClientConfig config) {
return true;
}
+ private URL getResourceURL() {
+ return getClass().getResource(SCHEMA_PATH);
+ }
+
@Override
public URI getLocation() throws OseeCoreException {
try {
@@ -50,8 +55,4 @@ public class OAuthSchemaResource implements SchemaResource {
throw new OseeCoreException(ex, "Error finding [%s] schema resource", SCHEMA_PATH);
}
}
-
- private URL getResourceURL() {
- return getClass().getResource(SCHEMA_PATH);
- }
}
diff --git a/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/oauth/TokenStorage.java b/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/oauth/TokenStorage.java
index 475db60754..68d537b810 100644
--- a/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/oauth/TokenStorage.java
+++ b/plugins/org.eclipse.osee.orcs.account.admin/src/org/eclipse/osee/orcs/account/admin/internal/oauth/TokenStorage.java
@@ -10,11 +10,11 @@
*******************************************************************************/
package org.eclipse.osee.orcs.account.admin.internal.oauth;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
-import org.eclipse.osee.framework.database.core.IOseeStatement;
import org.eclipse.osee.framework.jdk.core.type.ResultSet;
import org.eclipse.osee.jaxrs.server.security.OAuthToken;
import org.eclipse.osee.jaxrs.server.security.OAuthTokenType;
+import org.eclipse.osee.jdbc.JdbcClient;
+import org.eclipse.osee.jdbc.JdbcStatement;
import org.eclipse.osee.logger.Log;
/**
@@ -42,8 +42,8 @@ public class TokenStorage extends AbstractDatabaseStorage<OAuthToken> {
private static final String UPDATE_TOKEN_PARENT_BY_ID =
"UPDATE osee_oauth_token SET parent_token_id = ? WHERE id = ?";
- public TokenStorage(Log logger, IOseeDatabaseService dbService) {
- super(logger, dbService);
+ public TokenStorage(Log logger, JdbcClient jdbcClient) {
+ super(logger, jdbcClient);
}
@Override
@@ -92,7 +92,7 @@ public class TokenStorage extends AbstractDatabaseStorage<OAuthToken> {
@Override
protected Void innerCall() throws Exception {
- getDbService().runPreparedUpdate(query, data);
+ getJdbcClient().runPreparedUpdate(query, data);
return null;
}
@@ -108,7 +108,7 @@ public class TokenStorage extends AbstractDatabaseStorage<OAuthToken> {
@Override
protected Void innerCall() throws Exception {
- getDbService().runPreparedUpdate(DELETE_TOKEN_BY_TOKEN_KEY, tokenKey);
+ getJdbcClient().runPreparedUpdate(DELETE_TOKEN_BY_TOKEN_KEY, tokenKey);
return null;
}
@@ -116,7 +116,7 @@ public class TokenStorage extends AbstractDatabaseStorage<OAuthToken> {
}
@Override
- protected OAuthToken readData(IOseeStatement chStmt) {
+ protected OAuthToken readData(JdbcStatement chStmt) {
final long uuid = chStmt.getLong("id");
final long clientId = chStmt.getLong("client_id");
final long subjectId = chStmt.getLong("subject_id");
diff --git a/plugins/org.eclipse.osee.orcs.db.mock/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.orcs.db.mock/META-INF/MANIFEST.MF
index ad890b65e6..ae174019e7 100644
--- a/plugins/org.eclipse.osee.orcs.db.mock/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.orcs.db.mock/META-INF/MANIFEST.MF
@@ -7,18 +7,20 @@ Bundle-Vendor: Eclipse Open System Engineering Environment
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Import-Package: org.eclipse.osee.framework.core.data,
org.eclipse.osee.framework.core.exception,
- org.eclipse.osee.framework.database,
- org.eclipse.osee.framework.database.core,
org.eclipse.osee.framework.jdk.core.type,
org.eclipse.osee.framework.jdk.core.util,
org.eclipse.osee.framework.jdk.core.util.annotation,
org.eclipse.osee.framework.jdk.core.util.network,
- org.eclipse.osee.hsqldb,
+ org.eclipse.osee.jdbc,
+ org.json,
org.junit,
org.junit.rules,
org.junit.runner,
org.junit.runners.model,
org.osgi.framework,
+ org.osgi.service.cm,
org.osgi.util.tracker
Export-Package: org.eclipse.osee.orcs.db.mock
Bundle-ActivationPolicy: lazy
+Require-Bundle: org.eclipse.equinox.ds,
+ org.eclipse.equinox.cm
diff --git a/plugins/org.eclipse.osee.orcs.db.mock/src/org/eclipse/osee/orcs/db/mock/OseeDatabase.java b/plugins/org.eclipse.osee.orcs.db.mock/src/org/eclipse/osee/orcs/db/mock/OseeDatabase.java
index bd869b6173..475ec3bf90 100644
--- a/plugins/org.eclipse.osee.orcs.db.mock/src/org/eclipse/osee/orcs/db/mock/OseeDatabase.java
+++ b/plugins/org.eclipse.osee.orcs.db.mock/src/org/eclipse/osee/orcs/db/mock/OseeDatabase.java
@@ -21,10 +21,10 @@ import org.junit.runners.model.Statement;
*/
public class OseeDatabase implements TestRule {
- private final String connectionId;
+ private final String[] osgiBindings;
- public OseeDatabase(String connectionId) {
- this.connectionId = connectionId;
+ public OseeDatabase(String... osgiBindings) {
+ this.osgiBindings = osgiBindings;
}
@Override
@@ -32,9 +32,10 @@ public class OseeDatabase implements TestRule {
return new Statement() {
@Override
public void evaluate() throws Throwable {
- Assert.assertNotNull("Connection Id cannot be null", connectionId);
+ Assert.assertNotNull("Osgi Binding cannot be null", osgiBindings);
+ Assert.assertTrue("Osgi Binding cannot be empty", osgiBindings.length > 0);
TestDatabase db =
- new TestDatabase(connectionId, description.getTestClass().getSimpleName(), description.getMethodName());
+ new TestDatabase(description.getTestClass().getSimpleName(), description.getMethodName(), osgiBindings);
try {
db.initialize();
base.evaluate();
diff --git a/plugins/org.eclipse.osee.orcs.db.mock/src/org/eclipse/osee/orcs/db/mock/internal/OsgiUtil.java b/plugins/org.eclipse.osee.orcs.db.mock/src/org/eclipse/osee/orcs/db/mock/internal/OsgiUtil.java
index 34b84e6450..9bad66dcd2 100644
--- a/plugins/org.eclipse.osee.orcs.db.mock/src/org/eclipse/osee/orcs/db/mock/internal/OsgiUtil.java
+++ b/plugins/org.eclipse.osee.orcs.db.mock/src/org/eclipse/osee/orcs/db/mock/internal/OsgiUtil.java
@@ -10,8 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.orcs.db.mock.internal;
-import java.util.Dictionary;
-import org.eclipse.osee.framework.core.exception.OseeExceptions;
+import java.util.Collection;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.junit.Assert;
import org.osgi.framework.Bundle;
@@ -19,7 +18,7 @@ import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
import org.osgi.framework.FrameworkUtil;
import org.osgi.framework.ServiceReference;
-import org.osgi.framework.ServiceRegistration;
+import org.osgi.service.cm.ConfigurationAdmin;
/**
* @author Roberto E. Escobar
@@ -32,16 +31,7 @@ public final class OsgiUtil {
public static <T> T getService(Class<T> clazz) throws OseeCoreException {
Bundle bundle = FrameworkUtil.getBundle(OsgiUtil.class);
- Assert.assertNotNull(bundle);
-
- int bundleState = bundle.getState();
- if (bundleState != Bundle.STARTING && bundleState != Bundle.ACTIVE) {
- try {
- bundle.start();
- } catch (BundleException ex) {
- OseeExceptions.wrapAndThrow(ex);
- }
- }
+ checkStarted(bundle);
BundleContext context = bundle.getBundleContext();
Assert.assertNotNull(context);
@@ -55,21 +45,76 @@ public final class OsgiUtil {
return service;
}
- public static <S> ServiceRegistration<S> registerService(Class<S> class1, S service, Dictionary<String, ?> properties) throws OseeCoreException {
+ public static <T> T getService(Class<T> clazz, String filter, long waitTimeMillis) throws OseeCoreException {
+ Bundle bundle = FrameworkUtil.getBundle(OsgiUtil.class);
+ checkStarted(bundle);
+
+ BundleContext context = bundle.getBundleContext();
+ Assert.assertNotNull(context);
+
+ ServiceReference<T> reference = null;
+ int totalWaitTime = 0;
+ do {
+ try {
+ Collection<ServiceReference<T>> references = context.getServiceReferences(clazz, filter);
+ if (references != null && !references.isEmpty()) {
+ reference = references.iterator().next();
+ }
+ } catch (Exception ex) {
+ // do nothing;
+ } finally {
+ try {
+ if (totalWaitTime < waitTimeMillis && reference == null) {
+ Thread.sleep(100);
+ totalWaitTime += 100;
+ }
+ } catch (InterruptedException ex1) {
+ // do nothing;
+ }
+ }
+ } while (totalWaitTime < waitTimeMillis && reference == null);
+ Assert.assertNotNull(String.format("Unable to find service [%s]", clazz), reference);
+
+ T service = context.getService(reference);
+ Assert.assertNotNull(String.format("Unable to find service instance for [%s]", clazz), service);
+ return service;
+ }
+
+ public static Bundle getBundleByName(String bundleName) {
Bundle bundle = FrameworkUtil.getBundle(OsgiUtil.class);
- Assert.assertNotNull(bundle);
+ checkStarted(bundle);
+ BundleContext context = bundle.getBundleContext();
+ Bundle toReturn = null;
+ for (Bundle item : context.getBundles()) {
+ if (bundleName.equals(item.getSymbolicName())) {
+ toReturn = item;
+ break;
+ }
+ }
+ return toReturn;
+ }
+
+ public static ConfigurationAdmin getConfigAdmin() {
+ Bundle cmBundle = getBundleByName("org.eclipse.equinox.cm");
+ checkStarted(cmBundle);
+ try {
+ return getService(ConfigurationAdmin.class);
+ } catch (Exception ex) {
+ throw new OseeCoreException(ex.getCause(), "Error acquiring configuration admin");
+ }
+ }
+
+ private static void checkStarted(Bundle bundle) {
+ Assert.assertNotNull("Bundle cannot be null", bundle);
int bundleState = bundle.getState();
if (bundleState != Bundle.STARTING && bundleState != Bundle.ACTIVE) {
try {
bundle.start();
} catch (BundleException ex) {
- OseeExceptions.wrapAndThrow(ex);
+ throw new OseeCoreException(ex.getCause(), "Error starting bundle [%s]", bundle.getSymbolicName());
}
}
- BundleContext context = bundle.getBundleContext();
- Assert.assertNotNull(context);
-
- return context.registerService(class1, service, properties);
}
+
}
diff --git a/plugins/org.eclipse.osee.orcs.db.mock/src/org/eclipse/osee/orcs/db/mock/internal/TestDatabase.java b/plugins/org.eclipse.osee.orcs.db.mock/src/org/eclipse/osee/orcs/db/mock/internal/TestDatabase.java
index e525f9b78f..ed260a82b5 100644
--- a/plugins/org.eclipse.osee.orcs.db.mock/src/org/eclipse/osee/orcs/db/mock/internal/TestDatabase.java
+++ b/plugins/org.eclipse.osee.orcs.db.mock/src/org/eclipse/osee/orcs/db/mock/internal/TestDatabase.java
@@ -15,19 +15,24 @@ import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
-import org.eclipse.osee.framework.core.data.IDatabaseInfo;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
-import org.eclipse.osee.framework.database.core.IDatabaseInfoProvider;
-import org.eclipse.osee.framework.database.core.OseeConnection;
+import java.util.Dictionary;
+import java.util.HashSet;
+import java.util.Hashtable;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Set;
+import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.Lib;
-import org.eclipse.osee.framework.jdk.core.util.network.PortUtil;
-import org.eclipse.osee.hsqldb.HsqlServerManager;
+import org.eclipse.osee.jdbc.JdbcConstants;
+import org.eclipse.osee.jdbc.JdbcService;
import org.eclipse.osee.orcs.db.mock.OseeDatabase;
+import org.json.JSONArray;
+import org.json.JSONException;
import org.junit.Assert;
import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
import org.osgi.framework.FrameworkUtil;
-import org.osgi.framework.ServiceRegistration;
+import org.osgi.service.cm.Configuration;
+import org.osgi.service.cm.ConfigurationAdmin;
/**
* @author Roberto E. Escobar
@@ -36,17 +41,17 @@ public class TestDatabase {
private final String className;
private final String methodName;
+ private final String[] osgiBindings;
- private ServiceRegistration<?> registration;
private File tempFolder;
- private final String connectionId;
- private String dbId = "";
- private HsqlServerManager hsqlServer;
- public TestDatabase(String connectionId, String className, String methodName) {
- this.connectionId = connectionId;
+ private Configuration configuration;
+ private JdbcService jdbcService;
+
+ public TestDatabase(String className, String methodName, String... osgiBindings) {
this.className = className;
this.methodName = methodName;
+ this.osgiBindings = osgiBindings;
}
private File createTempFolder() {
@@ -76,34 +81,44 @@ public class TestDatabase {
String dbPath = getDbHomePath(tempFolder, "hsql");
- int port = PortUtil.getInstance().getConsecutiveValidPorts(2);
-
- IDatabaseInfo databaseInfo = new DbInfo(connectionId, port, dbPath);
- TestDbProvider provider = new TestDbProvider(databaseInfo);
-
- System.setProperty("osee.db.embedded.server", "");
System.setProperty("osee.application.server.data", tempFolder.getAbsolutePath());
- registerProvider(provider);
- IOseeDatabaseService dbService = OsgiUtil.getService(IOseeDatabaseService.class);
- Assert.assertNotNull(dbService);
+ ConfigurationAdmin configAdmin = OsgiUtil.getConfigAdmin();
- hsqlServer = OsgiUtil.getService(HsqlServerManager.class);
- Assert.assertNotNull(hsqlServer);
+ configuration = configAdmin.getConfiguration("org.eclipse.osee.jdbc.internal.osgi.JdbcComponentFactory", null);
+ configuration.update(newConfig(dbPath));
- dbId = hsqlServer.startServer("0.0.0.0", port, port + 1, databaseInfo);
+ jdbcService = OsgiUtil.getService(JdbcService.class, "(osgi.binding=orcs.jdbc.service)", 5000L);
+ Assert.assertNotNull("Unable to get JdbcService", jdbcService);
+ boolean isAlive = jdbcService.isServerAlive(10000L);
+ Assert.assertEquals("database service is not alive", true, isAlive);
+ }
- OseeConnection connection = dbService.getConnection();
- try {
- Assert.assertNotNull(connection);
- } finally {
- connection.close();
+ private Dictionary<String, Object> newConfig(String dbPath) {
+ Map<String, Object> config = new LinkedHashMap<String, Object>();
+ config.put(JdbcConstants.JDBC_SERVICE__ID, Lib.generateUuid());
+ config.put(JdbcConstants.JDBC_SERVER__DB_DATA_PATH, dbPath);
+ config.put(JdbcConstants.JDBC_SERVER__USE_RANDOM_PORT, true);
+ config.put(JdbcConstants.JDBC_POOL__ENABLED, false);
+ config.put(JdbcConstants.JDBC_POOL__MAX_ACTIVE_CONNECTIONS, 100);
+ config.put(JdbcConstants.JDBC_POOL__MAX_IDLE_CONNECTIONS, 100);
+
+ Set<String> bindings = new HashSet<String>();
+ for (String binding : osgiBindings) {
+ bindings.add(binding);
}
- }
+ config.put(JdbcConstants.JDBC_SERVICE__OSGI_BINDING, bindings);
- private void registerProvider(IDatabaseInfoProvider service) {
- BundleContext context = FrameworkUtil.getBundle(this.getClass()).getBundleContext();
- registration = context.registerService(IDatabaseInfoProvider.class, service, null);
+ JSONArray jsonArray = new JSONArray();
+ try {
+ jsonArray.put(0, config);
+ } catch (JSONException ex) {
+ throw new OseeCoreException(ex);
+ }
+ Hashtable<String, Object> data = new Hashtable<String, Object>();
+ data.put("serviceId", "org.eclipse.osee.jdbc.internal.osgi.JdbcComponentFactory");
+ data.put(JdbcConstants.JDBC_SERVICE__CONFIGS, jsonArray.toString());
+ return data;
}
private String getDbHomePath(File tempFolder, String dbFolder) {
@@ -127,14 +142,15 @@ public class TestDatabase {
}
public void cleanup() {
- if (registration != null) {
- registration.unregister();
+ if (configuration != null) {
+ try {
+ configuration.delete();
+ } catch (IOException ex) {
+ throw new OseeCoreException(ex);
+ }
}
-
System.setProperty("osee.application.server.data", "");
- System.setProperty("osee.db.embedded.server", "");
- boolean isDead = hsqlServer.stopServerWithWait(dbId);
-
+ boolean isDead = jdbcService != null ? !jdbcService.isServerAlive(2000L) : true;
if (isDead) {
if (tempFolder != null) {
Lib.deleteDir(tempFolder);
diff --git a/plugins/org.eclipse.osee.orcs.db.mock/src/org/eclipse/osee/orcs/db/mock/internal/TestDbProvider.java b/plugins/org.eclipse.osee.orcs.db.mock/src/org/eclipse/osee/orcs/db/mock/internal/TestDbProvider.java
deleted file mode 100644
index 77febed40d..0000000000
--- a/plugins/org.eclipse.osee.orcs.db.mock/src/org/eclipse/osee/orcs/db/mock/internal/TestDbProvider.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.orcs.db.mock.internal;
-
-import org.eclipse.osee.framework.core.data.IDatabaseInfo;
-import org.eclipse.osee.framework.database.core.IDatabaseInfoProvider;
-
-/**
- * @author Roberto E. Escobar
- */
-public class TestDbProvider implements IDatabaseInfoProvider {
-
- private final IDatabaseInfo databaseInfo;
-
- public TestDbProvider(IDatabaseInfo databaseInfo) {
- super();
- this.databaseInfo = databaseInfo;
- }
-
- @Override
- public IDatabaseInfo getDatabaseInfo() {
- return databaseInfo;
- }
-
- @Override
- public int getPriority() {
- return Integer.MIN_VALUE;
- }
-
- @Override
- public String toString() {
- return "Test Db info";
- }
-}
diff --git a/plugins/org.eclipse.osee.orcs.db.test/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.orcs.db.test/META-INF/MANIFEST.MF
index 7e2d6e839e..8e967f5252 100644
--- a/plugins/org.eclipse.osee.orcs.db.test/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.orcs.db.test/META-INF/MANIFEST.MF
@@ -9,8 +9,6 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Import-Package: org.eclipse.osee.framework.core.data,
org.eclipse.osee.framework.core.enums,
org.eclipse.osee.framework.core.exception,
- org.eclipse.osee.framework.database,
- org.eclipse.osee.framework.database.core,
org.eclipse.osee.framework.resource.management,
org.eclipse.osee.framework.resource.management.exception,
org.eclipse.osee.framework.resource.management.util,
diff --git a/plugins/org.eclipse.osee.orcs.db.test/OrcsDbTestSuite.launch b/plugins/org.eclipse.osee.orcs.db.test/OrcsDbTestSuite.launch
index df480bb4b2..86cf1e7286 100644
--- a/plugins/org.eclipse.osee.orcs.db.test/OrcsDbTestSuite.launch
+++ b/plugins/org.eclipse.osee.orcs.db.test/OrcsDbTestSuite.launch
@@ -1,9 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.pde.ui.JunitLaunchConfig">
<setAttribute key="additional_plugins">
-<setEntry value="org.eclipse.equinox.ds:1.4.100.v20130515-2026:default:true"/>
-<setEntry value="org.eclipse.osee.hsqldb:0.11.1.qualifier:default:false"/>
-<setEntry value="org.eclipse.osee.orcs.db.mock:0.11.1.qualifier:default:true"/>
+<setEntry value="org.eclipse.equinox.cm:1.0.400.v20130327-1442:default:true"/>
+<setEntry value="org.eclipse.equinox.ds:1.4.101.v20130813-1853:default:true"/>
+<setEntry value="org.eclipse.osee.hsqldb:0.19.0.v201411122326-RC:default:false"/>
+<setEntry value="org.eclipse.osee.orcs.db.mock:0.20.0.qualifier:default:true"/>
<setEntry value="org.hsqldb:2.2.9.qualifier:default:false"/>
<setEntry value="org.mockito:1.9.0.qualifier:default:false"/>
</setAttribute>
diff --git a/plugins/org.eclipse.osee.orcs.db.test/pom.xml b/plugins/org.eclipse.osee.orcs.db.test/pom.xml
index 2683f614cd..ef7fa7f15a 100644
--- a/plugins/org.eclipse.osee.orcs.db.test/pom.xml
+++ b/plugins/org.eclipse.osee.orcs.db.test/pom.xml
@@ -51,11 +51,6 @@
</dependency>
<dependency>
<type>eclipse-plugin</type>
- <artifactId>org.eclipse.osee.hsqldb</artifactId>
- <version>0.0.0</version>
- </dependency>
- <dependency>
- <type>eclipse-plugin</type>
<artifactId>org.eclipse.osee.framework.logging</artifactId>
<version>0.0.0</version>
</dependency>
diff --git a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/intergration/IntegrationUtil.java b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/intergration/IntegrationUtil.java
index 9009006568..afd585aee4 100644
--- a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/intergration/IntegrationUtil.java
+++ b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/intergration/IntegrationUtil.java
@@ -32,8 +32,8 @@ public class IntegrationUtil {
private static final Comparator<OrcsData> SORT_BY_LOCAL_ID = new IdComparator();
- public static TestRule integrationRule(Object testObject, String dbId) {
- return RuleChain.outerRule(new OseeDatabase(dbId)).around(new OsgiRule(testObject));
+ public static TestRule integrationRule(Object testObject) {
+ return RuleChain.outerRule(new OseeDatabase("orcs.jdbc.service")).around(new OsgiRule(testObject));
}
public static void sort(List<? extends OrcsData> data) {
diff --git a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/intergration/LoaderTest.java b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/intergration/LoaderTest.java
index dc75d0eb9a..b0f9e1a71d 100644
--- a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/intergration/LoaderTest.java
+++ b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/intergration/LoaderTest.java
@@ -28,7 +28,6 @@ import java.util.Iterator;
import org.eclipse.osee.executor.admin.HasCancellation;
import org.eclipse.osee.framework.core.enums.CoreBranches;
import org.eclipse.osee.framework.core.enums.LoadLevel;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.GUID;
import org.eclipse.osee.orcs.OrcsSession;
@@ -58,10 +57,10 @@ import org.mockito.MockitoAnnotations;
public class LoaderTest {
@Rule
- public TestRule db = integrationRule(this, "osee.demo.hsql");
+ public TestRule db = integrationRule(this);
// @formatter:off
- @OsgiService private IOseeDatabaseService dbService;
+// @OsgiService private JdbcClient jdbcClient;
@OsgiService private OrcsDataStore dataStore;
@Mock private LoadDataHandler builder;
@Captor private ArgumentCaptor<LoadDescription> descriptorCaptor;
diff --git a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/intergration/OseeInfoDataAccessorTest.java b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/intergration/OseeInfoDataAccessorTest.java
index 632d2aba01..fe0760d8ce 100644
--- a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/intergration/OseeInfoDataAccessorTest.java
+++ b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/intergration/OseeInfoDataAccessorTest.java
@@ -12,11 +12,11 @@ package org.eclipse.osee.orcs.db.intergration;
import static org.eclipse.osee.orcs.db.intergration.IntegrationUtil.integrationRule;
import java.sql.DatabaseMetaData;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
-import org.eclipse.osee.framework.database.core.OseeConnection;
-import org.eclipse.osee.framework.database.core.SupportedDatabase;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.type.OseeStateException;
+import org.eclipse.osee.jdbc.JdbcConnection;
+import org.eclipse.osee.jdbc.JdbcDbType;
+import org.eclipse.osee.jdbc.JdbcService;
import org.eclipse.osee.orcs.core.ds.DataStoreConstants;
import org.eclipse.osee.orcs.db.internal.SqlProvider;
import org.eclipse.osee.orcs.db.internal.accessor.OseeInfoDataAccessor;
@@ -35,17 +35,17 @@ import org.junit.rules.TestRule;
public class OseeInfoDataAccessorTest {
@Rule
- public TestRule db = integrationRule(this, "osee.demo.hsql");
+ public TestRule db = integrationRule(this);
//@formatter:off
- @OsgiService private IOseeDatabaseService dbService;
+ @OsgiService private JdbcService jdbcService;
//@formatter:on
@org.junit.Test
public void testGetSetValue() throws OseeCoreException {
OseeInfoDataAccessor accessor = new OseeInfoDataAccessor();
accessor.setLogger(new MockLog());
- accessor.setDatabaseService(dbService);
+ accessor.setJdbcService(jdbcService);
String value = accessor.getValue("test.data");
Assert.assertEquals("", value);
@@ -61,7 +61,7 @@ public class OseeInfoDataAccessorTest {
public void testSetBinaryDataPath() throws OseeCoreException {
OseeInfoDataAccessor accessor = new OseeInfoDataAccessor();
accessor.setLogger(new MockLog());
- accessor.setDatabaseService(dbService);
+ accessor.setJdbcService(jdbcService);
accessor.putValue(ResourceConstants.BINARY_DATA_PATH, "dummy");
}
@@ -70,7 +70,7 @@ public class OseeInfoDataAccessorTest {
public void testGetBinaryDataPath() throws OseeCoreException {
OseeInfoDataAccessor accessor = new OseeInfoDataAccessor();
accessor.setLogger(new MockLog());
- accessor.setDatabaseService(dbService);
+ accessor.setJdbcService(jdbcService);
String original = accessor.getValue(ResourceConstants.BINARY_DATA_PATH);
Assert.assertEquals(System.getProperty(ResourceConstants.BINARY_DATA_PATH), original);
@@ -88,7 +88,7 @@ public class OseeInfoDataAccessorTest {
public void testSetDatabaseHintsSupported() throws OseeCoreException {
OseeInfoDataAccessor accessor = new OseeInfoDataAccessor();
accessor.setLogger(new MockLog());
- accessor.setDatabaseService(dbService);
+ accessor.setJdbcService(jdbcService);
accessor.putValue(SqlProvider.SQL_DATABASE_HINTS_SUPPORTED_KEY, "dummy");
}
@@ -97,15 +97,15 @@ public class OseeInfoDataAccessorTest {
public void testGetDatabaseHintsSupported() throws OseeCoreException {
OseeInfoDataAccessor accessor = new OseeInfoDataAccessor();
accessor.setLogger(new MockLog());
- accessor.setDatabaseService(dbService);
+ accessor.setJdbcService(jdbcService);
String original = accessor.getValue(SqlProvider.SQL_DATABASE_HINTS_SUPPORTED_KEY);
boolean expected = false;
- OseeConnection connection = dbService.getConnection();
+ JdbcConnection connection = jdbcService.getClient().getConnection();
try {
DatabaseMetaData metaData = connection.getMetaData();
- expected = SupportedDatabase.isDatabaseType(metaData, SupportedDatabase.oracle);
+ expected = JdbcDbType.isDatabaseType(metaData, JdbcDbType.oracle);
} finally {
connection.close();
}
@@ -116,7 +116,7 @@ public class OseeInfoDataAccessorTest {
public void testSetSQLRecursiveKeyword() throws OseeCoreException {
OseeInfoDataAccessor accessor = new OseeInfoDataAccessor();
accessor.setLogger(new MockLog());
- accessor.setDatabaseService(dbService);
+ accessor.setJdbcService(jdbcService);
accessor.putValue(SqlProvider.SQL_RECURSIVE_WITH_KEY, "dummy");
}
@@ -125,15 +125,15 @@ public class OseeInfoDataAccessorTest {
public void testGetSQLRecursiveKeyword() throws OseeCoreException {
OseeInfoDataAccessor accessor = new OseeInfoDataAccessor();
accessor.setLogger(new MockLog());
- accessor.setDatabaseService(dbService);
+ accessor.setJdbcService(jdbcService);
String original = accessor.getValue(SqlProvider.SQL_RECURSIVE_WITH_KEY);
String expected = "";
- OseeConnection connection = dbService.getConnection();
+ JdbcConnection connection = jdbcService.getClient().getConnection();
try {
DatabaseMetaData metaData = connection.getMetaData();
- if (!SupportedDatabase.isDatabaseType(metaData, SupportedDatabase.oracle)) {
+ if (!JdbcDbType.isDatabaseType(metaData, JdbcDbType.oracle)) {
expected = "RECURSIVE";
}
} finally {
@@ -146,7 +146,7 @@ public class OseeInfoDataAccessorTest {
public void testSetSQLRegExpPattern() throws OseeCoreException {
OseeInfoDataAccessor accessor = new OseeInfoDataAccessor();
accessor.setLogger(new MockLog());
- accessor.setDatabaseService(dbService);
+ accessor.setJdbcService(jdbcService);
accessor.putValue(SqlProvider.SQL_REG_EXP_PATTERN_KEY, "dummy");
}
@@ -155,20 +155,20 @@ public class OseeInfoDataAccessorTest {
public void testGetSQLRegExpPattern() throws OseeCoreException {
OseeInfoDataAccessor accessor = new OseeInfoDataAccessor();
accessor.setLogger(new MockLog());
- accessor.setDatabaseService(dbService);
+ accessor.setJdbcService(jdbcService);
String original = accessor.getValue(SqlProvider.SQL_REG_EXP_PATTERN_KEY);
String expected = "";
- OseeConnection connection = dbService.getConnection();
+ JdbcConnection connection = jdbcService.getClient().getConnection();
try {
DatabaseMetaData metaData = connection.getMetaData();
- SupportedDatabase db = SupportedDatabase.getDatabaseType(metaData);
- if (SupportedDatabase.oracle == db) {
+ JdbcDbType db = JdbcDbType.getDatabaseType(metaData);
+ if (JdbcDbType.oracle == db) {
expected = "REGEXP_LIKE (%s, %s)";
- } else if (SupportedDatabase.hsql == db || SupportedDatabase.postgresql == db) {
+ } else if (JdbcDbType.hsql == db || JdbcDbType.postgresql == db) {
expected = "REGEXP_MATCHES (%s, %s)";
- } else if (SupportedDatabase.mysql == db) {
+ } else if (JdbcDbType.mysql == db) {
expected = "(%s REGEXP %s)";
}
} finally {
@@ -181,7 +181,7 @@ public class OseeInfoDataAccessorTest {
public void testSetCheckTagQueueOnStartupAllowed() throws OseeCoreException {
OseeInfoDataAccessor accessor = new OseeInfoDataAccessor();
accessor.setLogger(new MockLog());
- accessor.setDatabaseService(dbService);
+ accessor.setJdbcService(jdbcService);
accessor.putValue(DataStoreConstants.DATASTORE_INDEX_ON_START_UP, "dummy");
}
@@ -190,7 +190,7 @@ public class OseeInfoDataAccessorTest {
public void testGetCheckTagQueueOnStartupAllowed() throws OseeCoreException {
OseeInfoDataAccessor accessor = new OseeInfoDataAccessor();
accessor.setLogger(new MockLog());
- accessor.setDatabaseService(dbService);
+ accessor.setJdbcService(jdbcService);
String original = accessor.getValue(DataStoreConstants.DATASTORE_INDEX_ON_START_UP);
Assert.assertEquals(System.getProperty(DataStoreConstants.DATASTORE_INDEX_ON_START_UP, "false"), original);
@@ -208,7 +208,7 @@ public class OseeInfoDataAccessorTest {
public void testGetKeys() throws OseeCoreException {
OseeInfoDataAccessor accessor = new OseeInfoDataAccessor();
accessor.setLogger(new MockLog());
- accessor.setDatabaseService(dbService);
+ accessor.setJdbcService(jdbcService);
Assert.assertTrue(!accessor.getKeys().isEmpty());
}
diff --git a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/loader/DataFactoryImplTest.java b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/loader/DataFactoryImplTest.java
index 5db6473ea4..0e01df089f 100644
--- a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/loader/DataFactoryImplTest.java
+++ b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/loader/DataFactoryImplTest.java
@@ -239,6 +239,7 @@ public class DataFactoryImplTest {
assertEquals("", objData[2]);
}
+ @SuppressWarnings("unchecked")
@Test
public void testCreateRelationData() throws OseeCoreException {
IRelationType relationType = mock(IRelationType.class);
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 ea16098df7..24f9075b92 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
@@ -31,10 +31,10 @@ import org.eclipse.osee.framework.core.enums.CoreBranches;
import org.eclipse.osee.framework.core.enums.CoreRelationTypes;
import org.eclipse.osee.framework.core.enums.DeletionFlag;
import org.eclipse.osee.framework.core.enums.LoadLevel;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
-import org.eclipse.osee.framework.database.core.IOseeStatement;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.GUID;
+import org.eclipse.osee.jdbc.JdbcClient;
+import org.eclipse.osee.jdbc.JdbcStatement;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.OrcsSession;
import org.eclipse.osee.orcs.core.ds.DataLoader;
@@ -73,8 +73,8 @@ public class DataLoaderFactoryImplTest {
//@formatter:off
@Mock private Log logger;
- @Mock private IOseeDatabaseService dbService;
- @Mock private IOseeStatement chStmt;
+ @Mock private JdbcClient jdbcClient;
+ @Mock private JdbcStatement chStmt;
@Mock private IdentityManager identityService;
@Mock private SqlProvider sqlProvider;
@@ -108,7 +108,7 @@ public class DataLoaderFactoryImplTest {
String sessionId = GUID.create();
when(session.getGuid()).thenReturn(sessionId);
- LoaderModule module = new LoaderModule(logger, dbService, identityService, sqlProvider, null, joinFactory);
+ LoaderModule module = new LoaderModule(logger, jdbcClient, identityService, sqlProvider, null, joinFactory);
SqlObjectLoader loader = module.createSqlObjectLoader(rowDataFactory, null);
spyLoader = spy(loader);
@@ -116,8 +116,8 @@ public class DataLoaderFactoryImplTest {
when(sqlProvider.getSql(OseeSql.QUERY_BUILDER)).thenReturn("/*+ ordered */");
- when(dbService.getStatement()).thenReturn(chStmt);
- when(dbService.runPreparedQueryFetchObject(eq(-1), Matchers.anyString(), eq(BRANCH.getUuid()))).thenReturn(
+ when(jdbcClient.getStatement()).thenReturn(chStmt);
+ when(jdbcClient.runPreparedQueryFetchObject(eq(-1), Matchers.anyString(), eq(BRANCH.getUuid()))).thenReturn(
EXPECTED_HEAD_TX_ID);
when(joinFactory.createArtifactJoinQuery()).thenAnswer(new Answer<ArtifactJoinQuery>() {
diff --git a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/proxy/VarCharDataProxyTest.java b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/proxy/VarCharDataProxyTest.java
index 264e0458ed..af919cd8ee 100644
--- a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/proxy/VarCharDataProxyTest.java
+++ b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/proxy/VarCharDataProxyTest.java
@@ -10,11 +10,11 @@
*******************************************************************************/
package org.eclipse.osee.orcs.db.internal.proxy;
-import static org.eclipse.osee.framework.database.IOseeDatabaseService.MAX_VARCHAR_LENGTH;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.Lib;
+import org.eclipse.osee.jdbc.JdbcConstants;
import org.eclipse.osee.orcs.db.mocks.MockDataHandler;
import org.eclipse.osee.orcs.db.mocks.MockLog;
import org.eclipse.osee.orcs.db.mocks.MockResourceNameResolver;
@@ -59,10 +59,10 @@ public class VarCharDataProxyTest {
@Test
public void testSetGetData() throws Exception {
- String longData = Utility.generateData(MAX_VARCHAR_LENGTH + 1);
+ String longData = Utility.generateData(JdbcConstants.JDBC__MAX_VARCHAR_LENGTH + 1);
byte[] zippedData = Utility.asZipped(longData, "myTest.txt");
- String shortStringData = Utility.generateData(MAX_VARCHAR_LENGTH);
+ String shortStringData = Utility.generateData(JdbcConstants.JDBC__MAX_VARCHAR_LENGTH);
MockDataHandler handler = new MockDataHandler();
handler.setContent(zippedData);
@@ -98,7 +98,7 @@ public class VarCharDataProxyTest {
@Test
public void testSetValue() throws Exception {
- String longData = Utility.generateData(MAX_VARCHAR_LENGTH + 1);
+ String longData = Utility.generateData(JdbcConstants.JDBC__MAX_VARCHAR_LENGTH + 1);
byte[] zippedData = Utility.asZipped(longData, "myTest.txt");
MockDataHandler handler = new MockDataHandler();
@@ -127,10 +127,10 @@ public class VarCharDataProxyTest {
@Test
public void testPersist() throws Exception {
- String longData = Utility.generateData(MAX_VARCHAR_LENGTH + 1);
+ String longData = Utility.generateData(JdbcConstants.JDBC__MAX_VARCHAR_LENGTH + 1);
byte[] zippedData = Utility.asZipped(longData, "myTest.txt");
- String shortData = Utility.generateData(MAX_VARCHAR_LENGTH);
+ String shortData = Utility.generateData(JdbcConstants.JDBC__MAX_VARCHAR_LENGTH);
MockDataHandler handler = new MockDataHandler();
handler.setContent(zippedData);
@@ -180,7 +180,7 @@ public class VarCharDataProxyTest {
@Test(expected = OseeCoreException.class)
public void testPersistResolverException() throws Exception {
- String longData = Utility.generateData(MAX_VARCHAR_LENGTH + 1);
+ String longData = Utility.generateData(JdbcConstants.JDBC__MAX_VARCHAR_LENGTH + 1);
byte[] zippedData = Utility.asZipped(longData, "myTest.txt");
MockDataHandler handler = new MockDataHandler();
@@ -204,7 +204,7 @@ public class VarCharDataProxyTest {
@Test
public void testPurge() throws Exception {
- String longData = Utility.generateData(MAX_VARCHAR_LENGTH + 1);
+ String longData = Utility.generateData(JdbcConstants.JDBC__MAX_VARCHAR_LENGTH + 1);
byte[] zippedData = Utility.asZipped(longData, "myTest.txt");
MockDataHandler handler = new MockDataHandler();
diff --git a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/QueryTestSuite.java b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/QueryTestSuite.java
index bc1d00f534..e7ae8f2b38 100644
--- a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/QueryTestSuite.java
+++ b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/QueryTestSuite.java
@@ -12,7 +12,7 @@ package org.eclipse.osee.orcs.db.internal.search;
import org.eclipse.osee.orcs.db.internal.search.engines.EnginesTestSuite;
import org.eclipse.osee.orcs.db.internal.search.handlers.HandlersTestSuite;
-import org.eclipse.osee.orcs.db.internal.search.indexer.IndexingTaskDatabaseTxCallableTest;
+import org.eclipse.osee.orcs.db.internal.search.indexer.callable.consumer.IndexingTaskDatabaseTxCallableTest;
import org.eclipse.osee.orcs.db.internal.search.language.LanguageTestSuite;
import org.eclipse.osee.orcs.db.internal.search.tagger.TaggerTestSuite;
import org.eclipse.osee.orcs.db.internal.search.util.UtilityTestSuite;
diff --git a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/indexer/IndexingTaskDatabaseTxCallableTest.java b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/indexer/callable/consumer/IndexingTaskDatabaseTxCallableTest.java
index 856e5080bd..46114ff194 100644
--- a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/indexer/IndexingTaskDatabaseTxCallableTest.java
+++ b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/search/indexer/callable/consumer/IndexingTaskDatabaseTxCallableTest.java
@@ -8,7 +8,7 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.orcs.db.internal.search.indexer;
+package org.eclipse.osee.orcs.db.internal.search.indexer.callable.consumer;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
@@ -17,16 +17,15 @@ import static org.mockito.MockitoAnnotations.initMocks;
import java.sql.DatabaseMetaData;
import java.util.ArrayList;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
-import org.eclipse.osee.framework.database.core.OseeConnection;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.jdbc.JdbcClient;
+import org.eclipse.osee.jdbc.JdbcConnection;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.OrcsSession;
import org.eclipse.osee.orcs.core.ds.IndexedResource;
import org.eclipse.osee.orcs.core.ds.OrcsDataHandler;
import org.eclipse.osee.orcs.data.AttributeTypes;
-import org.eclipse.osee.orcs.db.internal.callable.AbstractDatastoreTxCallable;
-import org.eclipse.osee.orcs.db.internal.search.indexer.callable.consumer.IndexingTaskDatabaseTxCallable;
+import org.eclipse.osee.orcs.db.internal.search.indexer.IndexedResourceLoader;
import org.eclipse.osee.orcs.db.internal.search.tagger.TagCollector;
import org.eclipse.osee.orcs.db.internal.search.tagger.Tagger;
import org.eclipse.osee.orcs.db.internal.search.tagger.TaggingEngine;
@@ -45,7 +44,7 @@ public class IndexingTaskDatabaseTxCallableTest {
// @formatter:off
@Mock private Log logger;
@Mock private OrcsSession session;
- @Mock private IOseeDatabaseService dbService;
+ @Mock private JdbcClient jdbcClient;
@Mock private IndexerCollectorAdapter collector;
@Mock private AttributeTypes types;
@Mock private IndexedResource resource1;
@@ -53,62 +52,10 @@ public class IndexingTaskDatabaseTxCallableTest {
@Mock private TaggingEngine engine;
@Mock private DatabaseMetaData metaData;
@Mock private Tagger tagger;
+ @Mock private JdbcConnection connection;
// @formatter:on
- private class MockConnection extends OseeConnection {
-
- public MockConnection() {
- super();
- }
-
- @Override
- public void close() throws OseeCoreException {
- //
- };
-
- @Override
- public boolean isClosed() throws OseeCoreException {
- return true;
- }
-
- @Override
- public boolean isStale() {
- return false;
- };
-
- @Override
- public DatabaseMetaData getMetaData() throws OseeCoreException {
- return metaData;
- };
-
- @Override
- protected void setAutoCommit(boolean autoCommit) throws OseeCoreException {
- //
- };
-
- @Override
- protected boolean getAutoCommit() throws OseeCoreException {
- return true;
- };
-
- @Override
- protected void commit() throws OseeCoreException {
- //
- };
-
- @Override
- protected void rollback() throws OseeCoreException {
- //
- };
-
- @Override
- protected void destroy() throws OseeCoreException {
- //
- };
-
- }
- private MockConnection connection;
- private AbstractDatastoreTxCallable<Long> txCallable;
+ private IndexingTaskDatabaseTxCallable txCallable;
@Before
public void setUp() {
@@ -120,9 +67,8 @@ public class IndexingTaskDatabaseTxCallableTest {
handler.onData(resource2);
}
};
- connection = new MockConnection();
txCallable =
- new IndexingTaskDatabaseTxCallable(logger, session, dbService, loader, engine, collector, -1, false, 10000,
+ new IndexingTaskDatabaseTxCallable(logger, session, jdbcClient, loader, engine, collector, -1, false, 10000,
types);
}
@@ -138,16 +84,19 @@ public class IndexingTaskDatabaseTxCallableTest {
when(engine.hasTagger("")).thenReturn(false);
when(engine.hasTagger("Tag")).thenReturn(true);
when(engine.getTagger("Tag")).thenReturn(tagger);
- when(dbService.getConnection()).thenReturn(connection);
+
when(metaData.getDatabaseProductName()).thenReturn("h2");
when(types.getByUuid(CoreAttributeTypes.Name.getGuid())).thenReturn(CoreAttributeTypes.Name);
when(types.getByUuid(CoreAttributeTypes.QualificationMethod.getGuid())).thenReturn(
CoreAttributeTypes.QualificationMethod);
when(types.getTaggerId(CoreAttributeTypes.Name)).thenReturn("Tag");
when(types.getTaggerId(CoreAttributeTypes.QualificationMethod)).thenReturn(null);
- txCallable.call();
+
+ txCallable.handleTxWork(connection);
+
verify(logger, times(1)).error("Field has invalid tagger[%s] provider and cannot be tagged - [Gamma: %s]", null,
2L);
verify(tagger, times(1)).tagIt(Matchers.eq(resource1), Matchers.any(TagCollector.class));
}
+
}
diff --git a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/sql/join/MockJoinAccessor.java b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/sql/join/MockJoinAccessor.java
index 597748a98c..c375ae7c34 100644
--- a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/sql/join/MockJoinAccessor.java
+++ b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/sql/join/MockJoinAccessor.java
@@ -12,8 +12,8 @@ package org.eclipse.osee.orcs.db.internal.sql.join;
import java.util.Collection;
import java.util.List;
-import org.eclipse.osee.framework.database.core.OseeConnection;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.jdbc.JdbcConnection;
import org.eclipse.osee.orcs.db.internal.sql.join.DatabaseJoinAccessor.JoinItem;
/**
@@ -21,13 +21,13 @@ import org.eclipse.osee.orcs.db.internal.sql.join.DatabaseJoinAccessor.JoinItem;
*/
public class MockJoinAccessor implements IJoinAccessor {
- private OseeConnection connection;
+ private JdbcConnection connection;
private JoinItem joinItem;
private int queryId;
private List<Object[]> dataList;
@Override
- public void store(OseeConnection connection, JoinItem joinItem, int queryId, List<Object[]> dataList, Long issuedAt, Long expiresIn) throws OseeCoreException {
+ public void store(JdbcConnection connection, JoinItem joinItem, int queryId, List<Object[]> dataList, Long issuedAt, Long expiresIn) throws OseeCoreException {
this.connection = connection;
this.joinItem = joinItem;
this.queryId = queryId;
@@ -35,7 +35,7 @@ public class MockJoinAccessor implements IJoinAccessor {
}
@Override
- public int delete(OseeConnection connection, JoinItem joinItem, int queryId) {
+ public int delete(JdbcConnection connection, JoinItem joinItem, int queryId) {
this.connection = connection;
this.joinItem = joinItem;
this.queryId = queryId;
@@ -43,7 +43,7 @@ public class MockJoinAccessor implements IJoinAccessor {
}
@Override
- public Collection<Integer> getAllQueryIds(OseeConnection connection, JoinItem joinItem) {
+ public Collection<Integer> getAllQueryIds(JdbcConnection connection, JoinItem joinItem) {
this.connection = connection;
this.joinItem = joinItem;
return null;
@@ -56,7 +56,7 @@ public class MockJoinAccessor implements IJoinAccessor {
queryId = -1;
}
- public OseeConnection getConnection() {
+ public JdbcConnection getConnection() {
return connection;
}
diff --git a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/sql/join/TransactionJoinQueryTest.java b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/sql/join/TransactionJoinQueryTest.java
index 73fc0c4ccf..3b2ef26f75 100644
--- a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/sql/join/TransactionJoinQueryTest.java
+++ b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/sql/join/TransactionJoinQueryTest.java
@@ -11,8 +11,8 @@
package org.eclipse.osee.orcs.db.internal.sql.join;
import java.util.List;
-import org.eclipse.osee.framework.database.core.SQL3DataType;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.jdbc.SQL3DataType;
import org.junit.Assert;
import org.junit.Test;
diff --git a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/transaction/TransactionWriterTest.java b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/transaction/TransactionWriterTest.java
index 8350db194e..4b814942c4 100644
--- a/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/transaction/TransactionWriterTest.java
+++ b/plugins/org.eclipse.osee.orcs.db.test/src/org/eclipse/osee/orcs/db/internal/transaction/TransactionWriterTest.java
@@ -22,10 +22,10 @@ import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
-import org.eclipse.osee.framework.database.core.IOseeStatement;
-import org.eclipse.osee.framework.database.core.OseeConnection;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.jdbc.JdbcClient;
+import org.eclipse.osee.jdbc.JdbcConnection;
+import org.eclipse.osee.jdbc.JdbcStatement;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.core.ds.OrcsChangeSet;
import org.eclipse.osee.orcs.data.TransactionReadable;
@@ -63,11 +63,11 @@ public class TransactionWriterTest {
//@formatter:off
@Mock private Log logger;
- @Mock private IOseeDatabaseService dbService;
+ @Mock private JdbcClient jdbcClient;
@Mock private TxSqlBuilder builder;
- @Mock private OseeConnection connection;
+ @Mock private JdbcConnection connection;
@Mock private TransactionReadable tx;
@Mock private DaoToSql dao1;
@Mock private DaoToSql dao2;
@@ -75,7 +75,7 @@ public class TransactionWriterTest {
@Mock private IdJoinQuery join1;
@Mock private IdJoinQuery join2;
- @Mock private IOseeStatement chStmt;
+ @Mock private JdbcStatement chStmt;
@Captor private ArgumentCaptor<List<Object[]>> paramCaptor;
@Mock private OrcsChangeSet changeSet;
//@formatter:on
@@ -87,7 +87,7 @@ public class TransactionWriterTest {
public void setUp() throws OseeCoreException {
MockitoAnnotations.initMocks(this);
- writer = new TransactionWriter(logger, dbService, builder);
+ writer = new TransactionWriter(logger, jdbcClient, builder);
stores = Arrays.asList(dao1, dao2);
@@ -108,7 +108,7 @@ public class TransactionWriterTest {
return values;
}
});
- when(dbService.getStatement(connection)).thenReturn(chStmt);
+ when(jdbcClient.getStatement(connection)).thenReturn(chStmt);
when(chStmt.next()).thenReturn(true).thenReturn(true).thenReturn(false);
when(chStmt.getInt("transaction_id")).thenReturn(TX_1).thenReturn(TX_2);
@@ -134,7 +134,7 @@ public class TransactionWriterTest {
@Test
public void testWrite() throws OseeCoreException {
- InOrder inOrder = inOrder(builder, tx, join1, join2, dao1, dao2, dbService, chStmt);
+ InOrder inOrder = inOrder(builder, tx, join1, join2, dao1, dao2, jdbcClient, chStmt);
writer.write(connection, tx, changeSet);
@@ -159,7 +159,7 @@ public class TransactionWriterTest {
inOrder.verify(builder).getInsertData(SqlOrderEnum.TXS_DETAIL);
inOrder.verify(builder).getInsertData(SqlOrderEnum.TXS);
- inOrder.verify(dbService).runBatchUpdate(eq(connection), eq(TransactionWriter.UPDATE_TXS_NOT_CURRENT),
+ inOrder.verify(jdbcClient).runBatchUpdate(eq(connection), eq(TransactionWriter.UPDATE_TXS_NOT_CURRENT),
paramCaptor.capture());
inOrder.verify(builder).clear();
diff --git a/plugins/org.eclipse.osee.orcs.db/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.orcs.db/META-INF/MANIFEST.MF
index 0a09d22ecb..abbfe148f7 100644
--- a/plugins/org.eclipse.osee.orcs.db/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.orcs.db/META-INF/MANIFEST.MF
@@ -11,7 +11,6 @@ Import-Package: com.google.common.base;version="[11.0.0,15.0.0)",
com.google.common.io;version="[11.0.0,15.0.0)",
org.eclipse.core.runtime,
org.eclipse.osee.console.admin,
- org.eclipse.osee.database.schema,
org.eclipse.osee.executor.admin,
org.eclipse.osee.framework.core.data,
org.eclipse.osee.framework.core.enums,
@@ -21,9 +20,6 @@ Import-Package: com.google.common.base;version="[11.0.0,15.0.0)",
org.eclipse.osee.framework.core.model.change,
org.eclipse.osee.framework.core.model.type,
org.eclipse.osee.framework.core.operation,
- org.eclipse.osee.framework.database,
- org.eclipse.osee.framework.database.core,
- org.eclipse.osee.framework.database.operation,
org.eclipse.osee.framework.jdk.core.text,
org.eclipse.osee.framework.jdk.core.text.change,
org.eclipse.osee.framework.jdk.core.text.rules,
@@ -35,6 +31,7 @@ Import-Package: com.google.common.base;version="[11.0.0,15.0.0)",
org.eclipse.osee.framework.resource.management,
org.eclipse.osee.framework.resource.management.exception,
org.eclipse.osee.framework.resource.management.util,
+ org.eclipse.osee.jdbc,
org.eclipse.osee.logger,
org.eclipse.osee.orcs,
org.eclipse.osee.orcs.core,
diff --git a/plugins/org.eclipse.osee.orcs.db/OSGI-INF/attribute.provider.xml b/plugins/org.eclipse.osee.orcs.db/OSGI-INF/attribute.provider.xml
index 392b7c75fb..8d515d8adb 100644
--- a/plugins/org.eclipse.osee.orcs.db/OSGI-INF/attribute.provider.xml
+++ b/plugins/org.eclipse.osee.orcs.db/OSGI-INF/attribute.provider.xml
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="start" deactivate="stop" name="org.eclipse.osee.orcs.db.internal.resource.AttributeProvider">
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="start" deactivate="stop" >
<implementation class="org.eclipse.osee.orcs.db.internal.resource.AttributeProvider"/>
<service>
<provide interface="org.eclipse.osee.framework.resource.management.IResourceProvider"/>
diff --git a/plugins/org.eclipse.osee.orcs.db/OSGI-INF/consolidate.artifacts.console.command.xml b/plugins/org.eclipse.osee.orcs.db/OSGI-INF/consolidate.artifacts.console.command.xml
index e6bae2dfdd..530e61156d 100644
--- a/plugins/org.eclipse.osee.orcs.db/OSGI-INF/consolidate.artifacts.console.command.xml
+++ b/plugins/org.eclipse.osee.orcs.db/OSGI-INF/consolidate.artifacts.console.command.xml
@@ -5,6 +5,6 @@
<provide interface="org.eclipse.osee.console.admin.ConsoleCommand"/>
</service>
<reference bind="setLogger" cardinality="1..1" interface="org.eclipse.osee.logger.Log" name="Log" policy="static"/>
- <reference bind="setDatabaseService" cardinality="1..1" interface="org.eclipse.osee.framework.database.IOseeDatabaseService" name="IOseeDatabaseService" policy="static"/>
+ <reference bind="setJdbcService" cardinality="1..1" interface="org.eclipse.osee.jdbc.JdbcService" name="JdbcService" policy="static" target="(osgi.binding=orcs.jdbc.service)"/>
<reference bind="setSqlJoinFactory" cardinality="1..1" interface="org.eclipse.osee.orcs.db.internal.sql.join.SqlJoinFactory" name="SqlJoinFactory" policy="static"/>
</scr:component>
diff --git a/plugins/org.eclipse.osee.orcs.db/OSGI-INF/consolidate.relations.console.command.xml b/plugins/org.eclipse.osee.orcs.db/OSGI-INF/consolidate.relations.console.command.xml
index 7c268a7091..82db8bddfb 100644
--- a/plugins/org.eclipse.osee.orcs.db/OSGI-INF/consolidate.relations.console.command.xml
+++ b/plugins/org.eclipse.osee.orcs.db/OSGI-INF/consolidate.relations.console.command.xml
@@ -5,6 +5,6 @@
<provide interface="org.eclipse.osee.console.admin.ConsoleCommand"/>
</service>
<reference bind="setLogger" cardinality="1..1" interface="org.eclipse.osee.logger.Log" name="Log" policy="static"/>
- <reference bind="setDatabaseService" cardinality="1..1" interface="org.eclipse.osee.framework.database.IOseeDatabaseService" name="IOseeDatabaseService" policy="static"/>
+ <reference bind="setJdbcService" cardinality="1..1" interface="org.eclipse.osee.jdbc.JdbcService" name="JdbcService" policy="static" target="(osgi.binding=orcs.jdbc.service)"/>
<reference bind="setSqlJoinFactory" cardinality="1..1" interface="org.eclipse.osee.orcs.db.internal.sql.join.SqlJoinFactory" name="SqlJoinFactory" policy="static"/>
</scr:component>
diff --git a/plugins/org.eclipse.osee.orcs.db/OSGI-INF/convert.type.ids.xml b/plugins/org.eclipse.osee.orcs.db/OSGI-INF/convert.type.ids.xml
index ba0c96b662..db47463ba9 100644
--- a/plugins/org.eclipse.osee.orcs.db/OSGI-INF/convert.type.ids.xml
+++ b/plugins/org.eclipse.osee.orcs.db/OSGI-INF/convert.type.ids.xml
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.eclipse.osee.orcs.db.internal.console.ConvertLocalTypeIdCommand">
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0">
<implementation class="org.eclipse.osee.orcs.db.internal.console.ConvertLocalTypeIdCommand"/>
- <reference bind="setDatabaseService" cardinality="1..1" interface="org.eclipse.osee.framework.database.IOseeDatabaseService" name="IOseeDatabaseService" policy="static"/>
<service>
<provide interface="org.eclipse.osee.console.admin.ConsoleCommand"/>
</service>
<reference bind="setLogger" cardinality="1..1" interface="org.eclipse.osee.logger.Log" name="Log" policy="static"/>
+ <reference bind="setJdbcService" cardinality="1..1" interface="org.eclipse.osee.jdbc.JdbcService" name="JdbcService" policy="static" target="(osgi.binding=orcs.jdbc.service)"/>
</scr:component>
diff --git a/plugins/org.eclipse.osee.orcs.db/OSGI-INF/data.proxy.factory.provider.xml b/plugins/org.eclipse.osee.orcs.db/OSGI-INF/data.proxy.factory.provider.xml
index 110dfe4aa6..b5c52b6e83 100644
--- a/plugins/org.eclipse.osee.orcs.db/OSGI-INF/data.proxy.factory.provider.xml
+++ b/plugins/org.eclipse.osee.orcs.db/OSGI-INF/data.proxy.factory.provider.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="start" name="org.eclipse.osee.orcs.db.internal.DataProxyFactoryProviderImpl">
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="start" deactivate="stop">
<implementation class="org.eclipse.osee.orcs.db.internal.DataProxyFactoryProviderImpl"/>
<reference interface="org.eclipse.osee.logger.Log" name="Log"
cardinality="1..1"
diff --git a/plugins/org.eclipse.osee.orcs.db/OSGI-INF/exchange.provider.xml b/plugins/org.eclipse.osee.orcs.db/OSGI-INF/exchange.provider.xml
index 1e7af477de..421fe7b366 100644
--- a/plugins/org.eclipse.osee.orcs.db/OSGI-INF/exchange.provider.xml
+++ b/plugins/org.eclipse.osee.orcs.db/OSGI-INF/exchange.provider.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="start" deactivate="stop" name="org.eclipse.osee.orcs.db.internal.resource.ExchangeProvider">
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="start" deactivate="stop">
<implementation
class="org.eclipse.osee.orcs.db.internal.resource.ExchangeProvider" />
<service>
diff --git a/plugins/org.eclipse.osee.orcs.db/OSGI-INF/fix.duplicate.attributes.console.command.xml b/plugins/org.eclipse.osee.orcs.db/OSGI-INF/fix.duplicate.attributes.console.command.xml
index 1438e3221e..a8d81193da 100644
--- a/plugins/org.eclipse.osee.orcs.db/OSGI-INF/fix.duplicate.attributes.console.command.xml
+++ b/plugins/org.eclipse.osee.orcs.db/OSGI-INF/fix.duplicate.attributes.console.command.xml
@@ -5,7 +5,7 @@
<provide interface="org.eclipse.osee.console.admin.ConsoleCommand"/>
</service>
<reference bind="setLogger" cardinality="1..1" interface="org.eclipse.osee.logger.Log" name="Log" policy="static"/>
- <reference bind="setDatabaseService" cardinality="1..1" interface="org.eclipse.osee.framework.database.IOseeDatabaseService" name="IOseeDatabaseService" policy="static"/>
+ <reference bind="setJdbcService" cardinality="1..1" interface="org.eclipse.osee.jdbc.JdbcService" name="JdbcService" policy="static" target="(osgi.binding=orcs.jdbc.service)"/>
<reference bind="setOrcsApi" cardinality="1..1" interface="org.eclipse.osee.orcs.OrcsApi" name="OrcsApi" policy="static"/>
<reference bind="setSqlJoinFactory" cardinality="1..1" interface="org.eclipse.osee.orcs.db.internal.sql.join.SqlJoinFactory" name="SqlJoinFactory" policy="static"/>
</scr:component>
diff --git a/plugins/org.eclipse.osee.orcs.db/OSGI-INF/locator.provider.attribute.xml b/plugins/org.eclipse.osee.orcs.db/OSGI-INF/locator.provider.attribute.xml
index 4718a337f2..00b1d9b01b 100644
--- a/plugins/org.eclipse.osee.orcs.db/OSGI-INF/locator.provider.attribute.xml
+++ b/plugins/org.eclipse.osee.orcs.db/OSGI-INF/locator.provider.attribute.xml
@@ -1,6 +1,5 @@
<?xml version="1.0"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0"
- name="org.eclipse.osee.orcs.db.internal.resource.AttributeLocatorProvider">
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" >
<implementation
class="org.eclipse.osee.orcs.db.internal.resource.AttributeLocatorProvider" />
<service>
diff --git a/plugins/org.eclipse.osee.orcs.db/OSGI-INF/locator.provider.exchange.xml b/plugins/org.eclipse.osee.orcs.db/OSGI-INF/locator.provider.exchange.xml
index e06be31d67..fde75514e0 100644
--- a/plugins/org.eclipse.osee.orcs.db/OSGI-INF/locator.provider.exchange.xml
+++ b/plugins/org.eclipse.osee.orcs.db/OSGI-INF/locator.provider.exchange.xml
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0"
- name="org.eclipse.osee.orcs.db.internal.resource.ExchangeLocatorProvider">
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" >
<implementation
class="org.eclipse.osee.orcs.db.internal.resource.ExchangeLocatorProvider" />
<service>
diff --git a/plugins/org.eclipse.osee.orcs.db/OSGI-INF/orcs.data.store.impl.xml b/plugins/org.eclipse.osee.orcs.db/OSGI-INF/orcs.data.store.impl.xml
index 086ad0a1f7..8162321a6a 100644
--- a/plugins/org.eclipse.osee.orcs.db/OSGI-INF/orcs.data.store.impl.xml
+++ b/plugins/org.eclipse.osee.orcs.db/OSGI-INF/orcs.data.store.impl.xml
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="start" deactivate="stop" name="org.eclipse.osee.orcs.db.internal.OrcsDataStoreImpl">
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="start" deactivate="stop">
<implementation class="org.eclipse.osee.orcs.db.internal.OrcsDataStoreImpl"/>
<service>
<provide interface="org.eclipse.osee.orcs.core.ds.OrcsDataStore"/>
</service>
<reference bind="setLogger" cardinality="1..1" interface="org.eclipse.osee.logger.Log" name="Log" policy="static"/>
- <reference bind="setDatabaseService" cardinality="1..1" interface="org.eclipse.osee.framework.database.IOseeDatabaseService" name="IOseeDatabaseService" policy="static"/>
+ <reference bind="setJdbcService" cardinality="1..1" interface="org.eclipse.osee.jdbc.JdbcService" name="JdbcService" policy="static" target="(osgi.binding=orcs.jdbc.service)"/>
<reference bind="setExecutorAdmin" cardinality="1..1" interface="org.eclipse.osee.executor.admin.ExecutorAdmin" name="ExecutorAdmin" policy="static"/>
<reference bind="setResourceManager" cardinality="1..1" interface="org.eclipse.osee.framework.resource.management.IResourceManager" name="IResourceManager" policy="static"/>
<reference bind="setSystemPreferences" cardinality="1..1" interface="org.eclipse.osee.orcs.core.SystemPreferences" name="SystemPreferences" policy="static"/>
diff --git a/plugins/org.eclipse.osee.orcs.db/OSGI-INF/orcs.sql.join.factory.xml b/plugins/org.eclipse.osee.orcs.db/OSGI-INF/orcs.sql.join.factory.xml
index ce46779b9b..3936ae147f 100644
--- a/plugins/org.eclipse.osee.orcs.db/OSGI-INF/orcs.sql.join.factory.xml
+++ b/plugins/org.eclipse.osee.orcs.db/OSGI-INF/orcs.sql.join.factory.xml
@@ -5,7 +5,7 @@
<provide interface="org.eclipse.osee.orcs.db.internal.sql.join.SqlJoinFactory"/>
</service>
<reference bind="setLogger" cardinality="1..1" interface="org.eclipse.osee.logger.Log" name="Log" policy="static"/>
- <reference bind="setDatabaseService" cardinality="1..1" interface="org.eclipse.osee.framework.database.IOseeDatabaseService" name="IOseeDatabaseService" policy="static"/>
+ <reference bind="setJdbcService" cardinality="1..1" interface="org.eclipse.osee.jdbc.JdbcService" name="JdbcService" policy="static" target="(osgi.binding=orcs.jdbc.service)"/>
<reference bind="setSystemPreferences" cardinality="1..1" interface="org.eclipse.osee.orcs.core.SystemPreferences" name="SystemPreferences" policy="static"/>
<reference bind="setExecutorAdmin" cardinality="1..1" interface="org.eclipse.osee.executor.admin.ExecutorAdmin" name="ExecutorAdmin" policy="static"/>
</scr:component>
diff --git a/plugins/org.eclipse.osee.orcs.db/OSGI-INF/osee.datastore.schema.resource.xml b/plugins/org.eclipse.osee.orcs.db/OSGI-INF/osee.datastore.schema.resource.xml
index bc7c61bb8e..826d6ce195 100644
--- a/plugins/org.eclipse.osee.orcs.db/OSGI-INF/osee.datastore.schema.resource.xml
+++ b/plugins/org.eclipse.osee.orcs.db/OSGI-INF/osee.datastore.schema.resource.xml
@@ -1,8 +1,8 @@
<?xml version="1.0"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" enabled="true" name="org.eclipse.osee.orcs.db.internal.resource.OseeDatastoreSchemaResource">
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0">
<implementation
class="org.eclipse.osee.orcs.db.internal.resource.OseeDatastoreSchemaResource" />
<service>
- <provide interface="org.eclipse.osee.database.schema.SchemaResource"/>
+ <provide interface="org.eclipse.osee.jdbc.JdbcSchemaResource"/>
</service>
</scr:component>
diff --git a/plugins/org.eclipse.osee.orcs.db/OSGI-INF/resource.data.proxy.factory.xml b/plugins/org.eclipse.osee.orcs.db/OSGI-INF/resource.data.proxy.factory.xml
index 798301a155..6ea08e2189 100644
--- a/plugins/org.eclipse.osee.orcs.db/OSGI-INF/resource.data.proxy.factory.xml
+++ b/plugins/org.eclipse.osee.orcs.db/OSGI-INF/resource.data.proxy.factory.xml
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="start" name="org.eclipse.osee.orcs.db.internal.proxy.ResourceDataProxyFactory">
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="start" deactivate="stop">
<implementation class="org.eclipse.osee.orcs.db.internal.proxy.ResourceDataProxyFactory"/>
- <reference bind="setLogger" cardinality="1..1" interface="org.eclipse.osee.logger.Log" name="Log" policy="static"/>
- <reference bind="setResourceManager" cardinality="1..1" interface="org.eclipse.osee.framework.resource.management.IResourceManager" name="IResourceManager" policy="static"/>
<service>
<provide interface="org.eclipse.osee.orcs.core.ds.DataProxyFactory"/>
</service>
+ <reference bind="setLogger" cardinality="1..1" interface="org.eclipse.osee.logger.Log" name="Log" policy="static"/>
+ <reference bind="setResourceManager" cardinality="1..1" interface="org.eclipse.osee.framework.resource.management.IResourceManager" name="IResourceManager" policy="static"/>
<property name="proxy.factory.alias" type="String">
DefaultAttributeDataProvider
ClobAttributeDataProvider
diff --git a/plugins/org.eclipse.osee.orcs.db/OSGI-INF/system.preferences.data.accessor.xml b/plugins/org.eclipse.osee.orcs.db/OSGI-INF/system.preferences.data.accessor.xml
index 066a1445a4..9513053bc8 100644
--- a/plugins/org.eclipse.osee.orcs.db/OSGI-INF/system.preferences.data.accessor.xml
+++ b/plugins/org.eclipse.osee.orcs.db/OSGI-INF/system.preferences.data.accessor.xml
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="start" deactivate="stop" name="org.eclipse.osee.orcs.db.internal.accessor.OseeInfoDataAccessor">
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="start" deactivate="stop">
<implementation class="org.eclipse.osee.orcs.db.internal.accessor.OseeInfoDataAccessor"/>
<service>
<provide interface="org.eclipse.osee.orcs.core.ds.KeyValueDataAccessor"/>
</service>
<property name="store.id" type="String" value="osee.system.preferences"/>
<reference bind="setLogger" cardinality="1..1" interface="org.eclipse.osee.logger.Log" name="Log" policy="static"/>
- <reference bind="setDatabaseService" cardinality="1..1" interface="org.eclipse.osee.framework.database.IOseeDatabaseService" name="IOseeDatabaseService" policy="static"/>
+ <reference bind="setJdbcService" cardinality="1..1" interface="org.eclipse.osee.jdbc.JdbcService" name="JdbcService" policy="static" target="(osgi.binding=orcs.jdbc.service)"/>
</scr:component>
diff --git a/plugins/org.eclipse.osee.orcs.db/OSGI-INF/tx.currents.console.command.xml b/plugins/org.eclipse.osee.orcs.db/OSGI-INF/tx.currents.console.command.xml
index 5f740ee905..751f63bf4e 100644
--- a/plugins/org.eclipse.osee.orcs.db/OSGI-INF/tx.currents.console.command.xml
+++ b/plugins/org.eclipse.osee.orcs.db/OSGI-INF/tx.currents.console.command.xml
@@ -1,8 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.eclipse.osee.orcs.db.internal.console.TxCurrentsCommand">
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" >
<implementation class="org.eclipse.osee.orcs.db.internal.console.TxCurrentsCommand"/>
<service>
<provide interface="org.eclipse.osee.console.admin.ConsoleCommand"/>
</service>
- <reference bind="setDatabaseService" cardinality="1..1" interface="org.eclipse.osee.framework.database.IOseeDatabaseService" name="IOseeDatabaseService" policy="static"/>
+ <reference bind="setLogger" cardinality="1..1" interface="org.eclipse.osee.logger.Log" name="Log" policy="static"/>
+ <reference bind="setJdbcService" cardinality="1..1" interface="org.eclipse.osee.jdbc.JdbcService" name="JdbcService" policy="static" target="(osgi.binding=orcs.jdbc.service)"/>
</scr:component>
diff --git a/plugins/org.eclipse.osee.orcs.db/OSGI-INF/tx.prune.console.command.xml b/plugins/org.eclipse.osee.orcs.db/OSGI-INF/tx.prune.console.command.xml
index fbf6765e58..1eefd068ef 100644
--- a/plugins/org.eclipse.osee.orcs.db/OSGI-INF/tx.prune.console.command.xml
+++ b/plugins/org.eclipse.osee.orcs.db/OSGI-INF/tx.prune.console.command.xml
@@ -1,8 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.eclipse.osee.orcs.db.internal.console.TxPruneCommand">
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" >
<implementation class="org.eclipse.osee.orcs.db.internal.console.TxPruneCommand"/>
<service>
<provide interface="org.eclipse.osee.console.admin.ConsoleCommand"/>
</service>
- <reference bind="setDatabaseService" cardinality="1..1" interface="org.eclipse.osee.framework.database.IOseeDatabaseService" name="IOseeDatabaseService" policy="static"/>
+ <reference bind="setLogger" cardinality="1..1" interface="org.eclipse.osee.logger.Log" name="Log" policy="static"/>
+ <reference bind="setJdbcService" cardinality="1..1" interface="org.eclipse.osee.jdbc.JdbcService" name="JdbcService" policy="static" target="(osgi.binding=orcs.jdbc.service)"/>
</scr:component>
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/AdminModule.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/AdminModule.java
index 28a38ec42c..1b93402aa2 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/AdminModule.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/AdminModule.java
@@ -12,10 +12,10 @@ package org.eclipse.osee.orcs.db.internal;
import java.util.Map;
import java.util.concurrent.Callable;
-import org.eclipse.osee.database.schema.SchemaOptions;
-import org.eclipse.osee.database.schema.SchemaResourceProvider;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
import org.eclipse.osee.framework.jdk.core.util.Strings;
+import org.eclipse.osee.jdbc.JdbcClient;
+import org.eclipse.osee.jdbc.JdbcSchemaOptions;
+import org.eclipse.osee.jdbc.JdbcSchemaResource;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.OrcsSession;
import org.eclipse.osee.orcs.core.SystemPreferences;
@@ -25,6 +25,7 @@ import org.eclipse.osee.orcs.core.ds.DataStoreInfo;
import org.eclipse.osee.orcs.db.internal.callable.FetchDatastoreInfoCallable;
import org.eclipse.osee.orcs.db.internal.callable.InitializeDatastoreCallable;
import org.eclipse.osee.orcs.db.internal.util.DynamicSchemaResourceProvider;
+import com.google.common.base.Supplier;
/**
* @author Roberto E. Escobar
@@ -32,14 +33,14 @@ import org.eclipse.osee.orcs.db.internal.util.DynamicSchemaResourceProvider;
public class AdminModule {
private final Log logger;
- private final IOseeDatabaseService dbService;
+ private final JdbcClient jdbcClient;
private final IdentityManager identityService;
private final SystemPreferences preferences;
- public AdminModule(Log logger, IOseeDatabaseService dbService, IdentityManager identityService, SystemPreferences preferences) {
+ public AdminModule(Log logger, JdbcClient jdbcClient, IdentityManager identityService, SystemPreferences preferences) {
super();
this.logger = logger;
- this.dbService = dbService;
+ this.jdbcClient = jdbcClient;
this.identityService = identityService;
this.preferences = preferences;
}
@@ -53,17 +54,17 @@ public class AdminModule {
boolean useFileSpecifiedSchemas =
getOption(parameters, DataStoreConfigConstants.SCHEMA_USER_FILE_SPECIFIED_NAMESPACE, false);
- SchemaResourceProvider schemaProvider = new DynamicSchemaResourceProvider(logger);
+ Supplier<Iterable<JdbcSchemaResource>> schemaProvider = new DynamicSchemaResourceProvider(logger);
- SchemaOptions options = new SchemaOptions(tableDataSpace, indexDataSpace, useFileSpecifiedSchemas);
- return new InitializeDatastoreCallable(session, logger, dbService, identityService, branchStore,
+ JdbcSchemaOptions options = new JdbcSchemaOptions(tableDataSpace, indexDataSpace, useFileSpecifiedSchemas);
+ return new InitializeDatastoreCallable(session, logger, jdbcClient, identityService, branchStore,
preferences, schemaProvider, options);
}
@Override
public Callable<DataStoreInfo> getDataStoreInfo(OrcsSession session) {
- SchemaResourceProvider schemaProvider = new DynamicSchemaResourceProvider(logger);
- return new FetchDatastoreInfoCallable(logger, session, dbService, schemaProvider, preferences);
+ Supplier<Iterable<JdbcSchemaResource>> schemaProvider = new DynamicSchemaResourceProvider(logger);
+ return new FetchDatastoreInfoCallable(logger, session, jdbcClient, schemaProvider, preferences);
}
private boolean getOption(Map<String, String> parameters, String key, boolean defaultValue) {
@@ -85,5 +86,4 @@ public class AdminModule {
}
};
}
-
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/IdentityManager.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/IdentityManager.java
index d7c6743a21..7cde6c806d 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/IdentityManager.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/IdentityManager.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.osee.orcs.db.internal;
-import org.eclipse.osee.framework.core.exception.OseeDataStoreException;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
/**
@@ -18,16 +17,26 @@ import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
*/
public interface IdentityManager extends IdentityLocator {
- int getNextArtifactId() throws OseeCoreException;
+ public static final String ART_ID_SEQ = "SKYNET_ART_ID_SEQ";
+ public static final String ATTR_ID_SEQ = "SKYNET_ATTR_ID_SEQ";
+ public static final String REL_LINK_ID_SEQ = "SKYNET_REL_LINK_ID_SEQ";
+ public static final String GAMMA_ID_SEQ = "SKYNET_GAMMA_ID_SEQ";
- int getNextAttributeId() throws OseeCoreException;
+ public static final String BRANCH_ID_SEQ = "SKYNET_BRANCH_ID_SEQ";
+ public static final String TRANSACTION_ID_SEQ = "SKYNET_TRANSACTION_ID_SEQ";
- int getNextRelationId() throws OseeCoreException;
+ int getNextTransactionId();
- String getUniqueGuid(String guid) throws OseeCoreException;
+ int getNextArtifactId();
+
+ int getNextAttributeId();
+
+ int getNextRelationId();
- long getNextGammaId() throws OseeCoreException;
+ long getNextGammaId();
- void invalidateIds() throws OseeDataStoreException;
+ void invalidateIds();
+
+ String getUniqueGuid(String guid) throws OseeCoreException;
}
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 d9dcb98a44..da0db32815 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
@@ -11,8 +11,9 @@
package org.eclipse.osee.orcs.db.internal;
import org.eclipse.osee.executor.admin.ExecutorAdmin;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
import org.eclipse.osee.framework.resource.management.IResourceManager;
+import org.eclipse.osee.jdbc.JdbcClient;
+import org.eclipse.osee.jdbc.JdbcService;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.OrcsTypes;
import org.eclipse.osee.orcs.core.SystemPreferences;
@@ -37,7 +38,7 @@ import org.osgi.framework.BundleContext;
public class OrcsDataStoreImpl implements OrcsDataStore {
private Log logger;
- private IOseeDatabaseService dbService;
+ private JdbcService jdbcService;
private SystemPreferences preferences;
private ExecutorAdmin executorAdmin;
private IResourceManager resourceManager;
@@ -54,8 +55,8 @@ public class OrcsDataStoreImpl implements OrcsDataStore {
this.logger = logger;
}
- public void setDatabaseService(IOseeDatabaseService dbService) {
- this.dbService = dbService;
+ public void setJdbcService(JdbcService jdbcService) {
+ this.jdbcService = jdbcService;
}
public void setExecutorAdmin(ExecutorAdmin executorAdmin) {
@@ -79,25 +80,27 @@ public class OrcsDataStoreImpl implements OrcsDataStore {
}
public void start(BundleContext context) throws Exception {
+ JdbcClient jdbcClient = jdbcService.getClient();
+
sqlProvider = createSqlProvider();
- idManager = new IdentityManagerImpl(dbService);
+ idManager = new IdentityManagerImpl(jdbcClient);
- TypesModule typesModule = new TypesModule(logger, dbService, joinFactory, resourceManager);
+ TypesModule typesModule = new TypesModule(logger, jdbcClient, joinFactory, resourceManager);
typesDataStore = typesModule.createTypesDataStore();
LoaderModule loaderModule =
- new LoaderModule(logger, dbService, idManager, sqlProvider, proxyProvider, joinFactory);
+ new LoaderModule(logger, jdbcClient, idManager, sqlProvider, proxyProvider, joinFactory);
- queryModule = new QueryModule(logger, executorAdmin, dbService, joinFactory, idManager, sqlProvider);
+ queryModule = new QueryModule(logger, executorAdmin, jdbcClient, joinFactory, idManager, sqlProvider);
queryModule.startIndexer(resourceManager);
BranchModule branchModule =
- new BranchModule(logger, dbService, joinFactory, idManager, preferences, executorAdmin, resourceManager);
+ new BranchModule(logger, jdbcClient, joinFactory, idManager, preferences, executorAdmin, resourceManager);
- TxModule txModule = new TxModule(logger, dbService, joinFactory, idManager);
+ TxModule txModule = new TxModule(logger, jdbcClient, joinFactory, idManager);
- AdminModule adminModule = new AdminModule(logger, dbService, idManager, preferences);
+ AdminModule adminModule = new AdminModule(logger, jdbcClient, idManager, preferences);
dataModuleFactory = new DataModuleFactory(logger, loaderModule, queryModule, branchModule, txModule, adminModule);
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/accessor/DatabaseConflictAccessor.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/accessor/DatabaseConflictAccessor.java
index dc36f82f07..729f05ec14 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/accessor/DatabaseConflictAccessor.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/accessor/DatabaseConflictAccessor.java
@@ -18,9 +18,9 @@ import org.eclipse.osee.framework.core.enums.ConflictStatus;
import org.eclipse.osee.framework.core.enums.ConflictType;
import org.eclipse.osee.framework.core.enums.StorageState;
import org.eclipse.osee.framework.core.model.MergeBranch;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
-import org.eclipse.osee.framework.database.core.IOseeStatement;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.jdbc.JdbcClient;
+import org.eclipse.osee.jdbc.JdbcStatement;
import org.eclipse.osee.orcs.db.internal.conflict.Conflict;
/**
@@ -37,18 +37,18 @@ public class DatabaseConflictAccessor {
private static final String SELECT_CONFLICTS = "SELECT * FROM osee_conflict WHERE merge_branch_id = ?";
- private final IOseeDatabaseService dbService;
+ private final JdbcClient jdbcClient;
- public DatabaseConflictAccessor(IOseeDatabaseService dbService) {
- this.dbService = dbService;
+ public DatabaseConflictAccessor(JdbcClient jdbcClient) {
+ this.jdbcClient = jdbcClient;
}
- public IOseeDatabaseService getDatabaseService() {
- return dbService;
+ public JdbcClient getJdbcClient() {
+ return jdbcClient;
}
public void load(Collection<Conflict> conflicts, MergeBranch mergeBranch) throws OseeCoreException {
- IOseeStatement statement = getDatabaseService().getStatement();
+ JdbcStatement statement = getJdbcClient().getStatement();
try {
statement.runPreparedQuery(SELECT_CONFLICTS, mergeBranch.getUuid());
while (statement.next()) {
@@ -86,9 +86,9 @@ public class DatabaseConflictAccessor {
}
}
}
- getDatabaseService().runBatchUpdate(INSERT_CONFLICT, insertData);
- getDatabaseService().runBatchUpdate(UPDATE_CONFLICT, updateData);
- getDatabaseService().runBatchUpdate(DELETE_CONFLICT, deleteData);
+ getJdbcClient().runBatchUpdate(INSERT_CONFLICT, insertData);
+ getJdbcClient().runBatchUpdate(UPDATE_CONFLICT, updateData);
+ getJdbcClient().runBatchUpdate(DELETE_CONFLICT, deleteData);
for (Conflict conflict : conflicts) {
conflict.clearDirty();
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/accessor/OseeInfoDataAccessor.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/accessor/OseeInfoDataAccessor.java
index f44f523406..48509f86db 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/accessor/OseeInfoDataAccessor.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/accessor/OseeInfoDataAccessor.java
@@ -14,13 +14,14 @@ import java.io.File;
import java.sql.DatabaseMetaData;
import java.util.HashSet;
import java.util.Set;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
-import org.eclipse.osee.framework.database.core.IOseeStatement;
-import org.eclipse.osee.framework.database.core.OseeConnection;
-import org.eclipse.osee.framework.database.core.SupportedDatabase;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.type.OseeStateException;
import org.eclipse.osee.framework.jdk.core.util.Strings;
+import org.eclipse.osee.jdbc.JdbcClient;
+import org.eclipse.osee.jdbc.JdbcConnection;
+import org.eclipse.osee.jdbc.JdbcDbType;
+import org.eclipse.osee.jdbc.JdbcService;
+import org.eclipse.osee.jdbc.JdbcStatement;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.core.ds.DataStoreConstants;
import org.eclipse.osee.orcs.core.ds.KeyValueDataAccessor;
@@ -37,12 +38,11 @@ public class OseeInfoDataAccessor implements KeyValueDataAccessor {
private static final String ERROR_MESSAGE = "Unsupported modification - attempt to modify [%s].";
private static final String BINARY_DATA_ERROR_MSG =
ERROR_MESSAGE + " This can be modified at startup through -D%s=<PATH>.";
- private static final String DB_KEY_ERROR_MSG =
- ERROR_MESSAGE + " This is an unmodifiable database specific setting.";
+ private static final String DB_KEY_ERROR_MSG = ERROR_MESSAGE + " This is an unmodifiable database specific setting.";
private static final String INDEX_STARTUP_ERROR_MSG = ERROR_MESSAGE + " This is an launch time setting.";
private Log logger;
- private IOseeDatabaseService dbService;
+ private JdbcClient jdbcClient;
private boolean wasBinaryDataChecked = false;
private Boolean areHintsSupported;
private String recursiveKeyword;
@@ -52,8 +52,8 @@ public class OseeInfoDataAccessor implements KeyValueDataAccessor {
this.logger = logger;
}
- public void setDatabaseService(IOseeDatabaseService dbService) {
- this.dbService = dbService;
+ public void setJdbcService(JdbcService jdbcService) {
+ this.jdbcClient = jdbcService.getClient();
}
public void start() {
@@ -80,7 +80,7 @@ public class OseeInfoDataAccessor implements KeyValueDataAccessor {
} else if (DataStoreConstants.DATASTORE_INDEX_ON_START_UP.equals(key)) {
toReturn = String.valueOf(isCheckTagQueueOnStartupAllowed());
} else {
- toReturn = dbService.runPreparedQueryFetchObject("", GET_VALUE_SQL, key);
+ toReturn = jdbcClient.runPreparedQueryFetchObject("", GET_VALUE_SQL, key);
}
return toReturn;
}
@@ -100,8 +100,8 @@ public class OseeInfoDataAccessor implements KeyValueDataAccessor {
} else if (DataStoreConstants.DATASTORE_INDEX_ON_START_UP.equals(key)) {
throw new OseeStateException(INDEX_STARTUP_ERROR_MSG, DataStoreConstants.DATASTORE_INDEX_ON_START_UP);
} else {
- dbService.runPreparedUpdate(DELETE_KEY_SQL, key);
- int updated = dbService.runPreparedUpdate(INSERT_KEY_VALUE_SQL, key, value);
+ jdbcClient.runPreparedUpdate(DELETE_KEY_SQL, key);
+ int updated = jdbcClient.runPreparedUpdate(INSERT_KEY_VALUE_SQL, key, value);
wasUpdated = updated == 1;
}
return wasUpdated;
@@ -149,10 +149,10 @@ public class OseeInfoDataAccessor implements KeyValueDataAccessor {
private boolean areHintsSupported() throws OseeCoreException {
if (areHintsSupported == null) {
areHintsSupported = false;
- OseeConnection connection = dbService.getConnection();
+ JdbcConnection connection = jdbcClient.getConnection();
try {
DatabaseMetaData metaData = connection.getMetaData();
- areHintsSupported = SupportedDatabase.areHintsSupported(metaData);
+ areHintsSupported = JdbcDbType.areHintsSupported(metaData);
} finally {
connection.close();
}
@@ -163,7 +163,7 @@ public class OseeInfoDataAccessor implements KeyValueDataAccessor {
@Override
public Set<String> getKeys() throws OseeCoreException {
Set<String> keys = new HashSet<String>();
- IOseeStatement chStmt = dbService.getStatement();
+ JdbcStatement chStmt = jdbcClient.getStatement();
try {
chStmt.runPreparedQuery(GET_KEYS_SQL);
while (chStmt.next()) {
@@ -177,10 +177,10 @@ public class OseeInfoDataAccessor implements KeyValueDataAccessor {
private String getSQLRecursiveKeyword() throws OseeCoreException {
if (recursiveKeyword == null) {
- OseeConnection connection = dbService.getConnection();
+ JdbcConnection connection = jdbcClient.getConnection();
try {
DatabaseMetaData metaData = connection.getMetaData();
- recursiveKeyword = SupportedDatabase.getRecursiveWithSql(metaData);
+ recursiveKeyword = JdbcDbType.getRecursiveWithSql(metaData);
} finally {
connection.close();
}
@@ -190,14 +190,15 @@ public class OseeInfoDataAccessor implements KeyValueDataAccessor {
private String getSQLRegExpPattern() throws OseeCoreException {
if (regExpPattern == null) {
- OseeConnection connection = dbService.getConnection();
+ JdbcConnection connection = jdbcClient.getConnection();
try {
DatabaseMetaData metaData = connection.getMetaData();
- regExpPattern = SupportedDatabase.getRegularExpMatchSql(metaData);
+ regExpPattern = JdbcDbType.getRegularExpMatchSql(metaData);
} finally {
connection.close();
}
}
return regExpPattern;
}
+
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/accessor/UpdatePreviousTxCurrent.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/accessor/UpdatePreviousTxCurrent.java
index c5af681439..099ff7fcaf 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/accessor/UpdatePreviousTxCurrent.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/accessor/UpdatePreviousTxCurrent.java
@@ -10,14 +10,14 @@
*******************************************************************************/
package org.eclipse.osee.orcs.db.internal.accessor;
-import static org.eclipse.osee.framework.database.core.IOseeStatement.MAX_FETCH;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.osee.framework.core.enums.TxChange;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
-import org.eclipse.osee.framework.database.core.IOseeStatement;
-import org.eclipse.osee.framework.database.core.OseeConnection;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.jdbc.JdbcClient;
+import org.eclipse.osee.jdbc.JdbcConnection;
+import org.eclipse.osee.jdbc.JdbcConstants;
+import org.eclipse.osee.jdbc.JdbcStatement;
import org.eclipse.osee.orcs.db.internal.sql.join.IdJoinQuery;
import org.eclipse.osee.orcs.db.internal.sql.join.SqlJoinFactory;
@@ -41,16 +41,16 @@ public class UpdatePreviousTxCurrent {
"select txsb.transaction_id, txsb.gamma_id FROM item, osee_txs txsb where item.gamma_id = txsb.gamma_id AND txsb.branch_id = ? AND transaction_id <> ? AND txsb.tx_current <> ?";
// @formatter:on
- private final IOseeDatabaseService dbService;
+ private final JdbcClient jdbcClient;
private final SqlJoinFactory joinFactory;
private final long branchUuid;
- private final OseeConnection connection;
+ private final JdbcConnection connection;
private IdJoinQuery artifactJoin;
private IdJoinQuery attributeJoin;
private IdJoinQuery relationJoin;
- public UpdatePreviousTxCurrent(IOseeDatabaseService dbService, SqlJoinFactory joinFactory, OseeConnection connection, long branchUuid) {
- this.dbService = dbService;
+ public UpdatePreviousTxCurrent(JdbcClient jdbcClient, SqlJoinFactory joinFactory, JdbcConnection connection, long branchUuid) {
+ this.jdbcClient = jdbcClient;
this.joinFactory = joinFactory;
this.branchUuid = branchUuid;
this.connection = connection;
@@ -95,9 +95,10 @@ public class UpdatePreviousTxCurrent {
String query = String.format(SELECT_TXS_AND_GAMMAS, tableName, columnName);
List<Object[]> updateData = new ArrayList<Object[]>();
- IOseeStatement chStmt = dbService.getStatement(connection);
+ JdbcStatement chStmt = jdbcClient.getStatement(connection);
try {
- chStmt.runPreparedQuery(MAX_FETCH, query, queryId, branchUuid, TxChange.NOT_CURRENT.getValue());
+ chStmt.runPreparedQuery(JdbcConstants.JDBC__MAX_FETCH_SIZE, query, queryId, branchUuid,
+ TxChange.NOT_CURRENT.getValue());
while (chStmt.next()) {
updateData.add(new Object[] {branchUuid, chStmt.getLong("gamma_id"), chStmt.getInt("transaction_id")});
}
@@ -105,15 +106,15 @@ public class UpdatePreviousTxCurrent {
chStmt.close();
}
- dbService.runBatchUpdate(connection, UPDATE_TXS_NOT_CURRENT, updateData);
+ jdbcClient.runBatchUpdate(connection, UPDATE_TXS_NOT_CURRENT, updateData);
}
public void updateTxNotCurrentsFromTx(int transaction_id) throws OseeCoreException {
List<Object[]> updateData = new ArrayList<Object[]>();
- IOseeStatement chStmt = dbService.getStatement(connection);
+ JdbcStatement chStmt = jdbcClient.getStatement(connection);
try {
- chStmt.runPreparedQuery(MAX_FETCH, SELECT_TXS_AND_GAMMAS_FROM_TXS, branchUuid, transaction_id, branchUuid,
- transaction_id, TxChange.NOT_CURRENT.getValue());
+ chStmt.runPreparedQuery(JdbcConstants.JDBC__MAX_FETCH_SIZE, SELECT_TXS_AND_GAMMAS_FROM_TXS, branchUuid,
+ transaction_id, branchUuid, transaction_id, TxChange.NOT_CURRENT.getValue());
while (chStmt.next()) {
updateData.add(new Object[] {branchUuid, chStmt.getLong("gamma_id"), chStmt.getInt("transaction_id")});
}
@@ -121,6 +122,6 @@ public class UpdatePreviousTxCurrent {
chStmt.close();
}
- dbService.runBatchUpdate(connection, UPDATE_TXS_NOT_CURRENT, updateData);
+ jdbcClient.runBatchUpdate(connection, UPDATE_TXS_NOT_CURRENT, updateData);
}
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/branch/BranchModule.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/branch/BranchModule.java
index 31b8731c58..83e504e744 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/branch/BranchModule.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/branch/BranchModule.java
@@ -18,9 +18,9 @@ import org.eclipse.osee.framework.core.data.IOseeBranch;
import org.eclipse.osee.framework.core.enums.BranchState;
import org.eclipse.osee.framework.core.enums.BranchType;
import org.eclipse.osee.framework.core.model.change.ChangeItem;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
import org.eclipse.osee.framework.jdk.core.type.PropertyStore;
import org.eclipse.osee.framework.resource.management.IResourceManager;
+import org.eclipse.osee.jdbc.JdbcClient;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.OrcsSession;
import org.eclipse.osee.orcs.OrcsTypes;
@@ -32,7 +32,7 @@ import org.eclipse.osee.orcs.data.ArtifactReadable;
import org.eclipse.osee.orcs.data.BranchReadable;
import org.eclipse.osee.orcs.data.CreateBranchData;
import org.eclipse.osee.orcs.data.TransactionReadable;
-import org.eclipse.osee.orcs.db.internal.IdentityLocator;
+import org.eclipse.osee.orcs.db.internal.IdentityManager;
import org.eclipse.osee.orcs.db.internal.callable.AbstractDatastoreTxCallable;
import org.eclipse.osee.orcs.db.internal.callable.ArchiveUnarchiveBranchCallable;
import org.eclipse.osee.orcs.db.internal.callable.BranchCopyTxCallable;
@@ -57,19 +57,19 @@ import org.eclipse.osee.orcs.db.internal.sql.join.SqlJoinFactory;
public class BranchModule {
private final Log logger;
- private final IOseeDatabaseService dbService;
+ private final JdbcClient jdbcClient;
private final SqlJoinFactory joinFactory;
- private final IdentityLocator identityService;
+ private final IdentityManager idManager;
private final SystemPreferences preferences;
private final ExecutorAdmin executorAdmin;
private final IResourceManager resourceManager;
- public BranchModule(Log logger, IOseeDatabaseService dbService, SqlJoinFactory joinFactory, IdentityLocator identityService, SystemPreferences preferences, ExecutorAdmin executorAdmin, IResourceManager resourceManager) {
+ public BranchModule(Log logger, JdbcClient jdbcClient, SqlJoinFactory joinFactory, IdentityManager idManager, SystemPreferences preferences, ExecutorAdmin executorAdmin, IResourceManager resourceManager) {
super();
this.logger = logger;
- this.dbService = dbService;
+ this.jdbcClient = jdbcClient;
this.joinFactory = joinFactory;
- this.identityService = identityService;
+ this.idManager = idManager;
this.preferences = preferences;
this.executorAdmin = executorAdmin;
this.resourceManager = resourceManager;
@@ -80,35 +80,35 @@ public class BranchModule {
return new BranchDataStore() {
@Override
public Callable<Void> createBranch(OrcsSession session, CreateBranchData branchData) {
- return new CreateBranchDatabaseTxCallable(logger, session, dbService, branchData);
+ return new CreateBranchDatabaseTxCallable(logger, session, jdbcClient, idManager, branchData);
}
@Override
public Callable<Void> createBranchCopyTx(OrcsSession session, CreateBranchData branchData) {
- return new BranchCopyTxCallable(logger, session, dbService, joinFactory, branchData);
+ return new BranchCopyTxCallable(logger, session, jdbcClient, joinFactory, idManager, branchData);
}
@Override
public Callable<Integer> commitBranch(OrcsSession session, ArtifactReadable committer, BranchReadable source, TransactionReadable sourceHead, BranchReadable destination, TransactionReadable destinationHead) {
- return new CommitBranchDatabaseCallable(logger, session, dbService, joinFactory, committer, source,
- sourceHead, destination, destinationHead, missingChangeItemFactory);
+ return new CommitBranchDatabaseCallable(logger, session, jdbcClient, joinFactory, idManager, committer,
+ source, sourceHead, destination, destinationHead, missingChangeItemFactory);
}
@Override
public Callable<Void> purgeBranch(OrcsSession session, BranchReadable toDelete) {
- return new PurgeBranchDatabaseCallable(logger, session, dbService, toDelete);
+ return new PurgeBranchDatabaseCallable(logger, session, jdbcClient, toDelete);
}
@Override
public Callable<List<ChangeItem>> compareBranch(OrcsSession session, TransactionReadable sourceTx, TransactionReadable destinationTx) {
- return new CompareDatabaseCallable(logger, session, dbService, joinFactory, sourceTx, destinationTx,
+ return new CompareDatabaseCallable(logger, session, jdbcClient, joinFactory, sourceTx, destinationTx,
missingChangeItemFactory);
}
@Override
public Callable<URI> exportBranch(OrcsSession session, OrcsTypes orcsTypes, List<IOseeBranch> branches, PropertyStore options, String exportName) {
ExportItemFactory factory =
- new ExportItemFactory(logger, preferences, dbService, resourceManager, orcsTypes);
+ new ExportItemFactory(logger, preferences, jdbcClient, resourceManager, orcsTypes);
return new ExportBranchDatabaseCallable(session, factory, joinFactory, preferences, executorAdmin,
branches, options, exportName);
}
@@ -116,30 +116,30 @@ public class BranchModule {
@Override
public Callable<URI> importBranch(OrcsSession session, OrcsTypes orcsTypes, URI fileToImport, List<IOseeBranch> branches, PropertyStore options) {
ImportBranchDatabaseCallable callable =
- new ImportBranchDatabaseCallable(logger, session, dbService, preferences, resourceManager,
- identityService, orcsTypes, fileToImport, branches, options);
+ new ImportBranchDatabaseCallable(logger, session, jdbcClient, preferences, resourceManager, idManager,
+ orcsTypes, fileToImport, branches, options);
return callable;
}
@Override
public Callable<URI> checkBranchExchangeIntegrity(OrcsSession session, URI fileToCheck) {
- return new CheckBranchExchangeIntegrityCallable(logger, session, dbService, preferences, resourceManager,
+ return new CheckBranchExchangeIntegrityCallable(logger, session, jdbcClient, preferences, resourceManager,
fileToCheck);
}
@Override
public Callable<Void> changeBranchState(OrcsSession session, IOseeBranch branch, BranchState newState) {
- return new ChangeBranchStateCallable(logger, session, dbService, branch, newState);
+ return new ChangeBranchStateCallable(logger, session, jdbcClient, branch, newState);
}
@Override
public Callable<Void> changeBranchType(OrcsSession session, IOseeBranch branch, BranchType newType) {
- return new ChangeBranchTypeCallable(logger, session, dbService, branch, newType);
+ return new ChangeBranchTypeCallable(logger, session, jdbcClient, branch, newType);
}
@Override
public Callable<Void> archiveUnArchiveBranch(OrcsSession session, IOseeBranch branch, ArchiveOperation op) {
- return new ArchiveUnarchiveBranchCallable(logger, session, dbService, branch, op);
+ return new ArchiveUnarchiveBranchCallable(logger, session, jdbcClient, branch, op);
}
@Override
@@ -149,8 +149,7 @@ public class BranchModule {
AbstractDatastoreTxCallable<?> archiveBranch =
(AbstractDatastoreTxCallable<?>) archiveUnArchiveBranch(session, branch, ArchiveOperation.ARCHIVE);
CompositeDatastoreTxCallable composite =
- new CompositeDatastoreTxCallable(logger, session, dbService,
- String.format("Delete Branch [%s]", branch), deleteBranch, archiveBranch);
+ new CompositeDatastoreTxCallable(logger, session, jdbcClient, deleteBranch, archiveBranch);
return composite;
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/AbstractDatastoreCallable.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/AbstractDatastoreCallable.java
index 40f38d9cd9..84ed27a5d8 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/AbstractDatastoreCallable.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/AbstractDatastoreCallable.java
@@ -12,7 +12,7 @@ package org.eclipse.osee.orcs.db.internal.callable;
import java.util.concurrent.Callable;
import org.eclipse.osee.executor.admin.CancellableCallable;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
+import org.eclipse.osee.jdbc.JdbcClient;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.OrcsSession;
@@ -22,22 +22,22 @@ import org.eclipse.osee.orcs.OrcsSession;
public abstract class AbstractDatastoreCallable<T> extends CancellableCallable<T> {
private final OrcsSession session;
- private final IOseeDatabaseService service;
+ private final JdbcClient jdbcClient;
private final Log logger;
private Callable<?> innerWorker;
- protected AbstractDatastoreCallable(Log logger, OrcsSession session, IOseeDatabaseService service) {
+ protected AbstractDatastoreCallable(Log logger, OrcsSession session, JdbcClient jdbcClient) {
this.logger = logger;
this.session = session;
- this.service = service;
+ this.jdbcClient = jdbcClient;
}
protected OrcsSession getSession() {
return session;
}
- protected IOseeDatabaseService getDatabaseService() {
- return service;
+ protected JdbcClient getJdbcClient() {
+ return jdbcClient;
}
protected Log getLogger() {
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/AbstractDatastoreTxCallable.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/AbstractDatastoreTxCallable.java
index 8ad53607f9..6011019023 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/AbstractDatastoreTxCallable.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/AbstractDatastoreTxCallable.java
@@ -10,11 +10,10 @@
*******************************************************************************/
package org.eclipse.osee.orcs.db.internal.callable;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
-import org.eclipse.osee.framework.database.core.DatabaseTransactions;
-import org.eclipse.osee.framework.database.core.IDbTransactionWork;
-import org.eclipse.osee.framework.database.core.OseeConnection;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.jdbc.JdbcClient;
+import org.eclipse.osee.jdbc.JdbcConnection;
+import org.eclipse.osee.jdbc.JdbcTransaction;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.OrcsSession;
@@ -23,11 +22,8 @@ import org.eclipse.osee.orcs.OrcsSession;
*/
public abstract class AbstractDatastoreTxCallable<T> extends AbstractDatastoreCallable<T> {
- private final String name;
-
- protected AbstractDatastoreTxCallable(Log logger, OrcsSession session, IOseeDatabaseService dbService, String name) {
- super(logger, session, dbService);
- this.name = name;
+ protected AbstractDatastoreTxCallable(Log logger, OrcsSession session, JdbcClient jdbcClient) {
+ super(logger, session, jdbcClient);
}
@Override
@@ -35,14 +31,9 @@ public abstract class AbstractDatastoreTxCallable<T> extends AbstractDatastoreCa
T value = null;
onExecutionStart();
try {
- OseeConnection connection = getDatabaseService().getConnection();
- try {
- InternalTxWork work = new InternalTxWork();
- DatabaseTransactions.execute(getDatabaseService(), connection, work);
- value = work.getResult();
- } finally {
- connection.close();
- }
+ InternalTxWork work = new InternalTxWork();
+ getJdbcClient().runTransaction(work);
+ value = work.getResult();
} finally {
onExecutionComplete();
}
@@ -57,7 +48,7 @@ public abstract class AbstractDatastoreTxCallable<T> extends AbstractDatastoreCa
//
}
- protected abstract T handleTxWork(OseeConnection connection) throws OseeCoreException;
+ protected abstract T handleTxWork(JdbcConnection connection) throws OseeCoreException;
protected void handleTxException(Exception ex) {
// Do nothing
@@ -67,20 +58,15 @@ public abstract class AbstractDatastoreTxCallable<T> extends AbstractDatastoreCa
// Do nothing
}
- private final class InternalTxWork implements IDbTransactionWork {
+ private final class InternalTxWork extends JdbcTransaction {
private T result;
- @Override
- public String getName() {
- return name;
- }
-
public T getResult() {
return result;
}
@Override
- public void handleTxWork(OseeConnection connection) throws OseeCoreException {
+ public void handleTxWork(JdbcConnection connection) throws OseeCoreException {
result = AbstractDatastoreTxCallable.this.handleTxWork(connection);
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/ArchiveUnarchiveBranchCallable.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/ArchiveUnarchiveBranchCallable.java
index 7eb2a77216..ddbcee64d8 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/ArchiveUnarchiveBranchCallable.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/ArchiveUnarchiveBranchCallable.java
@@ -12,9 +12,9 @@ package org.eclipse.osee.orcs.db.internal.callable;
import org.eclipse.osee.framework.core.data.IOseeBranch;
import org.eclipse.osee.framework.core.enums.BranchArchivedState;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
-import org.eclipse.osee.framework.database.core.OseeConnection;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.jdbc.JdbcClient;
+import org.eclipse.osee.jdbc.JdbcConnection;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.OrcsSession;
import org.eclipse.osee.orcs.data.ArchiveOperation;
@@ -32,28 +32,28 @@ public class ArchiveUnarchiveBranchCallable extends AbstractDatastoreTxCallable<
private final IOseeBranch branch;
private final ArchiveOperation op;
- public ArchiveUnarchiveBranchCallable(Log logger, OrcsSession session, IOseeDatabaseService dbService, IOseeBranch branch, ArchiveOperation op) {
- super(logger, session, dbService, String.format("Change ArchivedState of %s to %s", branch, op.name()));
+ public ArchiveUnarchiveBranchCallable(Log logger, OrcsSession session, JdbcClient jdbcClient, IOseeBranch branch, ArchiveOperation op) {
+ super(logger, session, jdbcClient);
this.branch = branch;
this.op = op;
}
@Override
- protected Void handleTxWork(OseeConnection connection) throws OseeCoreException {
+ protected Void handleTxWork(JdbcConnection connection) throws OseeCoreException {
boolean archive = op == ArchiveOperation.ARCHIVE;
- IOseeDatabaseService dbService = getDatabaseService();
+ JdbcClient jdbcClient = getJdbcClient();
String sourceTableName = archive ? "osee_txs" : "osee_txs_archived";
String destinationTableName = archive ? "osee_txs_archived" : "osee_txs";
String sql = String.format(INSERT_ADDRESSING, destinationTableName, sourceTableName);
- dbService.runPreparedUpdate(connection, sql, branch.getUuid());
+ jdbcClient.runPreparedUpdate(connection, sql, branch.getUuid());
sql = String.format(DELETE_ADDRESSING, sourceTableName);
- dbService.runPreparedUpdate(connection, sql, branch.getUuid());
+ jdbcClient.runPreparedUpdate(connection, sql, branch.getUuid());
BranchArchivedState newState = archive ? BranchArchivedState.ARCHIVED : BranchArchivedState.UNARCHIVED;
Object[] params = new Object[] {newState.getValue(), branch.getUuid()};
- dbService.runPreparedUpdate(connection, UPDATE_BRANCH, params);
+ jdbcClient.runPreparedUpdate(connection, UPDATE_BRANCH, params);
return null;
}
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/BranchCopyTxCallable.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/BranchCopyTxCallable.java
index fb5b7b4458..c3a84e4816 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/BranchCopyTxCallable.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/BranchCopyTxCallable.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.osee.orcs.db.internal.callable;
-import static org.eclipse.osee.framework.database.core.IOseeStatement.MAX_FETCH;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.HashSet;
@@ -20,14 +19,16 @@ import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.core.enums.TransactionDetailsType;
import org.eclipse.osee.framework.core.enums.TxChange;
import org.eclipse.osee.framework.core.exception.OseeExceptions;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
-import org.eclipse.osee.framework.database.core.IOseeStatement;
-import org.eclipse.osee.framework.database.core.OseeConnection;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.time.GlobalTime;
+import org.eclipse.osee.jdbc.JdbcClient;
+import org.eclipse.osee.jdbc.JdbcConnection;
+import org.eclipse.osee.jdbc.JdbcConstants;
+import org.eclipse.osee.jdbc.JdbcStatement;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.OrcsSession;
import org.eclipse.osee.orcs.data.CreateBranchData;
+import org.eclipse.osee.orcs.db.internal.IdentityManager;
import org.eclipse.osee.orcs.db.internal.accessor.UpdatePreviousTxCurrent;
import org.eclipse.osee.orcs.db.internal.sql.RelationalConstants;
import org.eclipse.osee.orcs.db.internal.sql.join.SqlJoinFactory;
@@ -51,41 +52,41 @@ public final class BranchCopyTxCallable extends AbstractDatastoreTxCallable<Void
"SELECT gamma_id, mod_type FROM osee_txs txs WHERE txs.branch_id = ? AND txs.transaction_id = ?";
private final SqlJoinFactory joinFactory;
+ private final IdentityManager idManager;
- public BranchCopyTxCallable(Log logger, OrcsSession session, IOseeDatabaseService databaseService, SqlJoinFactory joinFactory, CreateBranchData branchData) {
- super(logger, session, databaseService, String.format("Create Branch %s", branchData.getName()));
+ public BranchCopyTxCallable(Log logger, OrcsSession session, JdbcClient jdbcClient, SqlJoinFactory joinFactory, IdentityManager idManager, CreateBranchData branchData) {
+ super(logger, session, jdbcClient);
this.joinFactory = joinFactory;
this.branchData = branchData;
- //this.systemUserId = -1;
+ this.idManager = idManager;
}
- @SuppressWarnings("unchecked")
@Override
- public Void handleTxWork(OseeConnection connection) throws OseeCoreException {
+ public Void handleTxWork(JdbcConnection connection) throws OseeCoreException {
// copy the branch up to the prior transaction - the goal is to have the provided
// transaction available on the new branch for merging or comparison purposes
// first set aside the transaction
Callable<Void> callable =
- new CreateBranchDatabaseTxCallable(getLogger(), getSession(), getDatabaseService(), branchData);
+ new CreateBranchDatabaseTxCallable(getLogger(), getSession(), getJdbcClient(), idManager, branchData);
try {
callable.call();
Timestamp timestamp = GlobalTime.GreenwichMeanTimestamp();
- int nextTransactionId = getDatabaseService().getSequence().getNextTransactionId();
+ int nextTransactionId = idManager.getNextTransactionId();
String creationComment = branchData.getCreationComment();
- getDatabaseService().runPreparedUpdate(connection, INSERT_TX_DETAILS, branchData.getUuid(), nextTransactionId,
+ getJdbcClient().runPreparedUpdate(connection, INSERT_TX_DETAILS, branchData.getUuid(), nextTransactionId,
creationComment, timestamp, branchData.getUserArtifactId(), TransactionDetailsType.NonBaselined.getId());
populateTransaction(0.30, connection, nextTransactionId, branchData.getParentBranchUuid(),
branchData.getSavedTransaction().getGuid());
UpdatePreviousTxCurrent updater =
- new UpdatePreviousTxCurrent(getDatabaseService(), joinFactory, connection, branchData.getUuid());
+ new UpdatePreviousTxCurrent(getJdbcClient(), joinFactory, connection, branchData.getUuid());
updater.updateTxNotCurrentsFromTx(nextTransactionId);
} catch (Exception ex) {
@@ -94,7 +95,7 @@ public final class BranchCopyTxCallable extends AbstractDatastoreTxCallable<Void
return null;
}
- private void populateTransaction(double workAmount, OseeConnection connection, int intoTx, Long parentBranch, int copyTxId) throws OseeCoreException {
+ private void populateTransaction(double workAmount, JdbcConnection connection, int intoTx, Long parentBranch, int copyTxId) throws OseeCoreException {
List<Object[]> data = new ArrayList<Object[]>();
HashSet<Integer> gammas = new HashSet<Integer>(100000);
long parentBranchId = RelationalConstants.BRANCH_SENTINEL;
@@ -105,16 +106,16 @@ public final class BranchCopyTxCallable extends AbstractDatastoreTxCallable<Void
populateAddressingToCopy(connection, data, intoTx, gammas, SELECT_ADDRESSING, parentBranchId, copyTxId);
if (!data.isEmpty()) {
- getDatabaseService().runBatchUpdate(connection, INSERT_ADDRESSING, data);
+ getJdbcClient().runBatchUpdate(connection, INSERT_ADDRESSING, data);
}
checkForCancelled();
}
- private void populateAddressingToCopy(OseeConnection connection, List<Object[]> data, int baseTxId, HashSet<Integer> gammas, String query, Object... parameters) throws OseeCoreException {
- IOseeStatement chStmt = getDatabaseService().getStatement(connection);
+ private void populateAddressingToCopy(JdbcConnection connection, List<Object[]> data, int baseTxId, HashSet<Integer> gammas, String query, Object... parameters) throws OseeCoreException {
+ JdbcStatement chStmt = getJdbcClient().getStatement(connection);
try {
- chStmt.runPreparedQuery(MAX_FETCH, query, parameters);
+ chStmt.runPreparedQuery(JdbcConstants.JDBC__MAX_FETCH_SIZE, query, parameters);
while (chStmt.next()) {
checkForCancelled();
Integer gamma = chStmt.getInt("gamma_id");
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/ChangeBranchStateCallable.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/ChangeBranchStateCallable.java
index f6d912d8ec..83aa75e1da 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/ChangeBranchStateCallable.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/ChangeBranchStateCallable.java
@@ -12,9 +12,9 @@ package org.eclipse.osee.orcs.db.internal.callable;
import org.eclipse.osee.framework.core.data.IOseeBranch;
import org.eclipse.osee.framework.core.enums.BranchState;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
-import org.eclipse.osee.framework.database.core.OseeConnection;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.jdbc.JdbcClient;
+import org.eclipse.osee.jdbc.JdbcConnection;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.OrcsSession;
@@ -25,16 +25,16 @@ public class ChangeBranchStateCallable extends AbstractDatastoreTxCallable<Void>
private final IOseeBranch branch;
private final BranchState newState;
- public ChangeBranchStateCallable(Log logger, OrcsSession session, IOseeDatabaseService dbService, IOseeBranch branch, BranchState newState) {
- super(logger, session, dbService, String.format("Change BranchState of %s to %s", branch, newState));
+ public ChangeBranchStateCallable(Log logger, OrcsSession session, JdbcClient jdbcClient, IOseeBranch branch, BranchState newState) {
+ super(logger, session, jdbcClient);
this.branch = branch;
this.newState = newState;
}
@Override
- protected Void handleTxWork(OseeConnection connection) throws OseeCoreException {
+ protected Void handleTxWork(JdbcConnection connection) throws OseeCoreException {
Object[] params = new Object[] {newState.getValue(), branch.getUuid()};
- getDatabaseService().runPreparedUpdate(connection, UPDATE_BRANCH_STATE, params);
+ getJdbcClient().runPreparedUpdate(connection, UPDATE_BRANCH_STATE, params);
return null;
}
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/ChangeBranchTypeCallable.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/ChangeBranchTypeCallable.java
index 0fb8425c6f..b9f359bb13 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/ChangeBranchTypeCallable.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/ChangeBranchTypeCallable.java
@@ -12,9 +12,9 @@ package org.eclipse.osee.orcs.db.internal.callable;
import org.eclipse.osee.framework.core.data.IOseeBranch;
import org.eclipse.osee.framework.core.enums.BranchType;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
-import org.eclipse.osee.framework.database.core.OseeConnection;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.jdbc.JdbcClient;
+import org.eclipse.osee.jdbc.JdbcConnection;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.OrcsSession;
@@ -28,16 +28,16 @@ public class ChangeBranchTypeCallable extends AbstractDatastoreTxCallable<Void>
private final IOseeBranch branch;
private final BranchType newType;
- public ChangeBranchTypeCallable(Log logger, OrcsSession session, IOseeDatabaseService dbService, IOseeBranch branch, BranchType newType) {
- super(logger, session, dbService, String.format("Change BranchType of %s to %s", branch, newType));
+ public ChangeBranchTypeCallable(Log logger, OrcsSession session, JdbcClient jdbcClient, IOseeBranch branch, BranchType newType) {
+ super(logger, session, jdbcClient);
this.branch = branch;
this.newType = newType;
}
@Override
- protected Void handleTxWork(OseeConnection connection) throws OseeCoreException {
+ protected Void handleTxWork(JdbcConnection connection) throws OseeCoreException {
Object[] params = new Object[] {newType.getValue(), branch.getUuid()};
- getDatabaseService().runPreparedUpdate(connection, UPDATE_BRANCH_TYPE, params);
+ getJdbcClient().runPreparedUpdate(connection, UPDATE_BRANCH_TYPE, params);
return null;
}
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/CheckBranchExchangeIntegrityCallable.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/CheckBranchExchangeIntegrityCallable.java
index 39cde95208..3fbb097e03 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/CheckBranchExchangeIntegrityCallable.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/CheckBranchExchangeIntegrityCallable.java
@@ -17,7 +17,6 @@ import java.net.URI;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
import org.eclipse.osee.framework.jdk.core.type.HashCollection;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.type.Pair;
@@ -25,6 +24,7 @@ import org.eclipse.osee.framework.jdk.core.util.Lib;
import org.eclipse.osee.framework.jdk.core.util.xml.Xml;
import org.eclipse.osee.framework.resource.management.IResourceLocator;
import org.eclipse.osee.framework.resource.management.IResourceManager;
+import org.eclipse.osee.jdbc.JdbcClient;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.OrcsSession;
import org.eclipse.osee.orcs.core.SystemPreferences;
@@ -46,7 +46,7 @@ public class CheckBranchExchangeIntegrityCallable extends AbstractDatastoreCalla
private final SystemPreferences preferences;
private final IResourceManager resourceManager;
- public CheckBranchExchangeIntegrityCallable(Log logger, OrcsSession session, IOseeDatabaseService service, SystemPreferences preferences, IResourceManager resourceManager, URI fileToCheck) {
+ public CheckBranchExchangeIntegrityCallable(Log logger, OrcsSession session, JdbcClient service, SystemPreferences preferences, IResourceManager resourceManager, URI fileToCheck) {
super(logger, session, service);
this.fileToCheck = fileToCheck;
this.preferences = preferences;
@@ -87,7 +87,7 @@ public class CheckBranchExchangeIntegrityCallable extends AbstractDatastoreCalla
for (ReferentialIntegrityConstraint constraint : constraints) {
getLogger().info("Verifing constraint [%s]", constraint.getPrimaryKeyListing());
- constraint.checkConstraint(getLogger(), getDatabaseService(), processor);
+ constraint.checkConstraint(getLogger(), getJdbcClient(), processor);
writeConstraintResults(writer, constraint);
}
ExportImportXml.closeXmlNode(writer, ExportImportXml.DATA);
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/CommitBranchDatabaseCallable.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/CommitBranchDatabaseCallable.java
index d045c3396e..ba12c977c7 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/CommitBranchDatabaseCallable.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/CommitBranchDatabaseCallable.java
@@ -14,12 +14,13 @@ import java.util.List;
import java.util.concurrent.Callable;
import org.eclipse.osee.executor.admin.CancellableCallable;
import org.eclipse.osee.framework.core.model.change.ChangeItem;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
+import org.eclipse.osee.jdbc.JdbcClient;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.OrcsSession;
import org.eclipse.osee.orcs.data.ArtifactReadable;
import org.eclipse.osee.orcs.data.BranchReadable;
import org.eclipse.osee.orcs.data.TransactionReadable;
+import org.eclipse.osee.orcs.db.internal.IdentityManager;
import org.eclipse.osee.orcs.db.internal.change.ComputeNetChangeCallable;
import org.eclipse.osee.orcs.db.internal.change.LoadDeltasBetweenBranches;
import org.eclipse.osee.orcs.db.internal.change.MissingChangeItemFactory;
@@ -31,6 +32,7 @@ import org.eclipse.osee.orcs.db.internal.sql.join.SqlJoinFactory;
public class CommitBranchDatabaseCallable extends AbstractDatastoreCallable<Integer> {
private final SqlJoinFactory joinFactory;
+ private final IdentityManager idManager;
private final ArtifactReadable committer;
private final TransactionReadable sourceHead;
private final BranchReadable source;
@@ -43,9 +45,10 @@ public class CommitBranchDatabaseCallable extends AbstractDatastoreCallable<Inte
private static final String SELECT_MERGE_BRANCH_HEAD_TX =
"select max(transaction_id) from osee_tx_details where branch_id = ?";
- public CommitBranchDatabaseCallable(Log logger, OrcsSession session, IOseeDatabaseService service, SqlJoinFactory joinFactory, ArtifactReadable committer, BranchReadable source, TransactionReadable sourceHead, BranchReadable destination, TransactionReadable destinationHead, MissingChangeItemFactory missingChangeItemFactory) {
+ public CommitBranchDatabaseCallable(Log logger, OrcsSession session, JdbcClient service, SqlJoinFactory joinFactory, IdentityManager idManager, ArtifactReadable committer, BranchReadable source, TransactionReadable sourceHead, BranchReadable destination, TransactionReadable destinationHead, MissingChangeItemFactory missingChangeItemFactory) {
super(logger, session, service);
this.joinFactory = joinFactory;
+ this.idManager = idManager;
this.committer = committer;
this.source = source;
this.sourceHead = sourceHead;
@@ -63,11 +66,11 @@ public class CommitBranchDatabaseCallable extends AbstractDatastoreCallable<Inte
Integer mergeTxId = null;
if (mergeBranch != null && mergeBranch > 0) {
mergeBranchId = mergeBranch;
- mergeTxId = getDatabaseService().runPreparedQueryFetchObject(-1, SELECT_MERGE_BRANCH_HEAD_TX, mergeBranchId);
+ mergeTxId = getJdbcClient().runPreparedQueryFetchObject(-1, SELECT_MERGE_BRANCH_HEAD_TX, mergeBranchId);
}
Callable<List<ChangeItem>> loadChanges =
- new LoadDeltasBetweenBranches(getLogger(), getSession(), getDatabaseService(), joinFactory,
+ new LoadDeltasBetweenBranches(getLogger(), getSession(), getJdbcClient(), joinFactory,
sourceHead.getBranchId(), destinationHead.getBranchId(), destinationHead.getGuid(), mergeBranchId,
mergeTxId);
List<ChangeItem> changes = callAndCheckForCancel(loadChanges);
@@ -82,12 +85,12 @@ public class CommitBranchDatabaseCallable extends AbstractDatastoreCallable<Inte
@Override
public Integer call() throws Exception {
Long mergeBranchUuid =
- getDatabaseService().runPreparedQueryFetchObject(-1L, SELECT_MERGE_BRANCH_UUID, source.getGuid(),
+ getJdbcClient().runPreparedQueryFetchObject(-1L, SELECT_MERGE_BRANCH_UUID, source.getGuid(),
destination.getGuid());
List<ChangeItem> changes = callComputeChanges(mergeBranchUuid);
CancellableCallable<Integer> commitCallable =
- new CommitBranchDatabaseTxCallable(getLogger(), getSession(), getDatabaseService(), joinFactory,
+ new CommitBranchDatabaseTxCallable(getLogger(), getSession(), getJdbcClient(), joinFactory, idManager,
getUserArtId(), source, destination, mergeBranchUuid, changes);
Integer newTx = callAndCheckForCancel(commitCallable);
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/CommitBranchDatabaseTxCallable.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/CommitBranchDatabaseTxCallable.java
index cc0db68048..fa2223cd7d 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/CommitBranchDatabaseTxCallable.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/CommitBranchDatabaseTxCallable.java
@@ -22,14 +22,15 @@ import org.eclipse.osee.framework.core.model.change.ArtifactChangeItem;
import org.eclipse.osee.framework.core.model.change.AttributeChangeItem;
import org.eclipse.osee.framework.core.model.change.ChangeItem;
import org.eclipse.osee.framework.core.model.change.RelationChangeItem;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
-import org.eclipse.osee.framework.database.core.OseeConnection;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.type.OseeStateException;
import org.eclipse.osee.framework.jdk.core.util.time.GlobalTime;
+import org.eclipse.osee.jdbc.JdbcClient;
+import org.eclipse.osee.jdbc.JdbcConnection;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.OrcsSession;
import org.eclipse.osee.orcs.data.BranchReadable;
+import org.eclipse.osee.orcs.db.internal.IdentityManager;
import org.eclipse.osee.orcs.db.internal.accessor.UpdatePreviousTxCurrent;
import org.eclipse.osee.orcs.db.internal.sql.join.SqlJoinFactory;
@@ -57,15 +58,17 @@ public class CommitBranchDatabaseTxCallable extends AbstractDatastoreTxCallable<
private static final String UPDATE_SOURCE_BRANCH_STATE = "update osee_branch set branch_state=? where branch_id=?";
private final SqlJoinFactory joinFactory;
+ private final IdentityManager idManager;
private final int userArtId;
private final BranchReadable sourceBranch;
private final BranchReadable destinationBranch;
private final Long mergeBranchUuid;
private final List<ChangeItem> changes;
- public CommitBranchDatabaseTxCallable(Log logger, OrcsSession session, IOseeDatabaseService databaseService, SqlJoinFactory joinFactory, int userArtId, BranchReadable sourceBranch, BranchReadable destinationBranch, Long mergeBranchUuid, List<ChangeItem> changes) {
- super(logger, session, databaseService, "Commit branch");
+ public CommitBranchDatabaseTxCallable(Log logger, OrcsSession session, JdbcClient jdbcClient, SqlJoinFactory joinFactory, IdentityManager idManager, int userArtId, BranchReadable sourceBranch, BranchReadable destinationBranch, Long mergeBranchUuid, List<ChangeItem> changes) {
+ super(logger, session, jdbcClient);
this.joinFactory = joinFactory;
+ this.idManager = idManager;
this.userArtId = userArtId;
this.sourceBranch = sourceBranch;
this.destinationBranch = destinationBranch;
@@ -74,7 +77,7 @@ public class CommitBranchDatabaseTxCallable extends AbstractDatastoreTxCallable<
}
@Override
- protected Integer handleTxWork(OseeConnection connection) throws OseeCoreException {
+ protected Integer handleTxWork(JdbcConnection connection) throws OseeCoreException {
BranchState storedBranchState;
if (changes.isEmpty()) {
throw new OseeStateException("A branch can not be committed without any changes made.");
@@ -88,12 +91,12 @@ public class CommitBranchDatabaseTxCallable extends AbstractDatastoreTxCallable<
updatePreviousCurrentsOnDestinationBranch(connection);
insertCommitAddressing(newTx, connection);
- getDatabaseService().runPreparedUpdate(connection, UPDATE_MERGE_COMMIT_TX, newTx, sourceBranch.getUuid(),
+ getJdbcClient().runPreparedUpdate(connection, UPDATE_MERGE_COMMIT_TX, newTx, sourceBranch.getUuid(),
destinationBranch.getUuid());
manageBranchStates();
if (mergeBranchUuid != null && mergeBranchUuid > 0) {
- getDatabaseService().runPreparedUpdate(UPDATE_CONFLICT_STATUS, ConflictStatus.COMMITTED.getValue(),
+ getJdbcClient().runPreparedUpdate(UPDATE_CONFLICT_STATUS, ConflictStatus.COMMITTED.getValue(),
ConflictStatus.RESOLVED.getValue(), mergeBranchUuid);
}
} catch (OseeCoreException ex) {
@@ -105,7 +108,7 @@ public class CommitBranchDatabaseTxCallable extends AbstractDatastoreTxCallable<
public synchronized void checkPreconditions() throws OseeCoreException {
int count =
- getDatabaseService().runPreparedQueryFetchObject(0, SELECT_SOURCE_BRANCH_STATE, sourceBranch.getUuid(),
+ getJdbcClient().runPreparedQueryFetchObject(0, SELECT_SOURCE_BRANCH_STATE, sourceBranch.getUuid(),
BranchState.COMMIT_IN_PROGRESS.getValue());
if (sourceBranch.getBranchState().isCommitInProgress() || sourceBranch.getArchiveState().isArchived() || count > 0) {
throw new OseeStateException("Commit completed or in progress for [%s]", sourceBranch);
@@ -117,12 +120,12 @@ public class CommitBranchDatabaseTxCallable extends AbstractDatastoreTxCallable<
}
public void updateBranchState(BranchState state, Long branchUuid) throws OseeCoreException {
- getDatabaseService().runPreparedUpdate(UPDATE_SOURCE_BRANCH_STATE, state.getValue(), branchUuid);
+ getJdbcClient().runPreparedUpdate(UPDATE_SOURCE_BRANCH_STATE, state.getValue(), branchUuid);
}
- private void updatePreviousCurrentsOnDestinationBranch(OseeConnection connection) throws OseeCoreException {
+ private void updatePreviousCurrentsOnDestinationBranch(JdbcConnection connection) throws OseeCoreException {
UpdatePreviousTxCurrent updater =
- new UpdatePreviousTxCurrent(getDatabaseService(), joinFactory, connection, destinationBranch.getUuid());
+ new UpdatePreviousTxCurrent(getJdbcClient(), joinFactory, connection, destinationBranch.getUuid());
for (ChangeItem change : changes) {
if (change instanceof ArtifactChangeItem) {
updater.addArtifact(change.getItemId());
@@ -137,20 +140,19 @@ public class CommitBranchDatabaseTxCallable extends AbstractDatastoreTxCallable<
updater.updateTxNotCurrents();
}
- @SuppressWarnings("unchecked")
- private Integer addCommitTransactionToDatabase(int userArtId, OseeConnection connection) throws OseeCoreException {
- int newTransactionNumber = getDatabaseService().getSequence().getNextTransactionId();
+ private Integer addCommitTransactionToDatabase(int userArtId, JdbcConnection connection) throws OseeCoreException {
+ int newTransactionNumber = idManager.getNextTransactionId();
Timestamp timestamp = GlobalTime.GreenwichMeanTimestamp();
String comment = COMMIT_COMMENT + sourceBranch.getName();
- getDatabaseService().runPreparedUpdate(connection, INSERT_COMMIT_TRANSACTION,
+ getJdbcClient().runPreparedUpdate(connection, INSERT_COMMIT_TRANSACTION,
TransactionDetailsType.NonBaselined.getId(), destinationBranch.getUuid(), newTransactionNumber, comment,
timestamp, userArtId, sourceBranch.getAssociatedArtifactId());
return newTransactionNumber;
}
- private void insertCommitAddressing(Integer newTx, OseeConnection connection) throws OseeCoreException {
+ private void insertCommitAddressing(Integer newTx, JdbcConnection connection) throws OseeCoreException {
List<Object[]> insertData = new ArrayList<Object[]>();
for (ChangeItem change : changes) {
ModificationType modType = change.getNetChange().getModType();
@@ -161,7 +163,7 @@ public class CommitBranchDatabaseTxCallable extends AbstractDatastoreTxCallable<
modType.getValue(),
TxChange.getCurrent(modType).getValue()});
}
- getDatabaseService().runBatchUpdate(connection, INSERT_COMMIT_ADDRESSING, insertData);
+ getJdbcClient().runBatchUpdate(connection, INSERT_COMMIT_ADDRESSING, insertData);
}
private void manageBranchStates() throws OseeCoreException {
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/CompareDatabaseCallable.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/CompareDatabaseCallable.java
index 8edacfad23..0ec98a0394 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/CompareDatabaseCallable.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/CompareDatabaseCallable.java
@@ -13,7 +13,7 @@ package org.eclipse.osee.orcs.db.internal.callable;
import java.util.List;
import java.util.concurrent.Callable;
import org.eclipse.osee.framework.core.model.change.ChangeItem;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
+import org.eclipse.osee.jdbc.JdbcClient;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.OrcsSession;
import org.eclipse.osee.orcs.data.TransactionReadable;
@@ -32,15 +32,12 @@ public class CompareDatabaseCallable extends AbstractDatastoreCallable<List<Chan
private final TransactionReadable destinationTx;
private final MissingChangeItemFactory missingChangeItemFactory;
- private static final String SELECT_BASE_TRANSACTION =
- "select baseline_transaction_id from osee_branch where branch_id = ?";
-
private static final String SELECT_MERGE_BRANCH_UUID =
"select merge_branch_id from osee_merge where source_branch_id = ? and dest_branch_id = ?";
private static final String SELECT_MERGE_BRANCH_HEAD_TX =
"select max(transaction_id) from osee_tx_details where branch_id = ?";
- public CompareDatabaseCallable(Log logger, OrcsSession session, IOseeDatabaseService service, SqlJoinFactory joinFactory, TransactionReadable sourceTx, TransactionReadable destinationTx, MissingChangeItemFactory missingChangeItemFactory) {
+ public CompareDatabaseCallable(Log logger, OrcsSession session, JdbcClient service, SqlJoinFactory joinFactory, TransactionReadable sourceTx, TransactionReadable destinationTx, MissingChangeItemFactory missingChangeItemFactory) {
super(logger, session, service);
this.joinFactory = joinFactory;
this.sourceTx = sourceTx;
@@ -55,22 +52,20 @@ public class CompareDatabaseCallable extends AbstractDatastoreCallable<List<Chan
Callable<List<ChangeItem>> callable;
if (txDelta.areOnTheSameBranch()) {
callable =
- new LoadDeltasBetweenTxsOnTheSameBranch(getLogger(), getSession(), getDatabaseService(), joinFactory,
- txDelta);
+ new LoadDeltasBetweenTxsOnTheSameBranch(getLogger(), getSession(), getJdbcClient(), joinFactory, txDelta);
} else {
Long mergeBranchId =
- getDatabaseService().runPreparedQueryFetchObject(-1L, SELECT_MERGE_BRANCH_UUID, sourceTx.getBranchId(),
+ getJdbcClient().runPreparedQueryFetchObject(-1L, SELECT_MERGE_BRANCH_UUID, sourceTx.getBranchId(),
destinationTx.getBranchId());
Integer mergeTxId = null;
if (mergeBranchId > 0) {
- mergeTxId =
- getDatabaseService().runPreparedQueryFetchObject(-1, SELECT_MERGE_BRANCH_HEAD_TX, mergeBranchId);
+ mergeTxId = getJdbcClient().runPreparedQueryFetchObject(-1, SELECT_MERGE_BRANCH_HEAD_TX, mergeBranchId);
} else {
mergeBranchId = null;
}
callable =
- new LoadDeltasBetweenBranches(getLogger(), getSession(), getDatabaseService(), joinFactory,
+ new LoadDeltasBetweenBranches(getLogger(), getSession(), getJdbcClient(), joinFactory,
sourceTx.getBranchId(), destinationTx.getBranchId(), destinationTx.getGuid(), mergeBranchId, mergeTxId);
}
List<ChangeItem> changes = callAndCheckForCancel(callable);
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/CompositeDatastoreTxCallable.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/CompositeDatastoreTxCallable.java
index a1a811745c..4242139475 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/CompositeDatastoreTxCallable.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/CompositeDatastoreTxCallable.java
@@ -11,9 +11,9 @@
package org.eclipse.osee.orcs.db.internal.callable;
import java.util.List;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
-import org.eclipse.osee.framework.database.core.OseeConnection;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.jdbc.JdbcClient;
+import org.eclipse.osee.jdbc.JdbcConnection;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.OrcsSession;
import com.google.common.collect.Lists;
@@ -22,13 +22,13 @@ public class CompositeDatastoreTxCallable extends AbstractDatastoreTxCallable<Vo
private final List<AbstractDatastoreTxCallable<?>> callables;
- public CompositeDatastoreTxCallable(Log logger, OrcsSession session, IOseeDatabaseService dbService, String name, AbstractDatastoreTxCallable<?>... callables) {
- super(logger, session, dbService, name);
+ public CompositeDatastoreTxCallable(Log logger, OrcsSession session, JdbcClient jdbcClient, AbstractDatastoreTxCallable<?>... callables) {
+ super(logger, session, jdbcClient);
this.callables = Lists.newArrayList(callables);
}
@Override
- protected Void handleTxWork(OseeConnection connection) throws OseeCoreException {
+ protected Void handleTxWork(JdbcConnection connection) throws OseeCoreException {
for (AbstractDatastoreTxCallable<?> callable : callables) {
callable.handleTxWork(connection);
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/ConsolidateArtifactVersionDatabaseTxCallable.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/ConsolidateArtifactVersionDatabaseTxCallable.java
index 51e11f5c9f..2cd704adf2 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/ConsolidateArtifactVersionDatabaseTxCallable.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/ConsolidateArtifactVersionDatabaseTxCallable.java
@@ -15,23 +15,23 @@ import static org.eclipse.osee.framework.core.enums.ModificationType.INTRODUCED;
import static org.eclipse.osee.framework.core.enums.ModificationType.MERGED;
import static org.eclipse.osee.framework.core.enums.ModificationType.MODIFIED;
import static org.eclipse.osee.framework.core.enums.ModificationType.NEW;
-import static org.eclipse.osee.framework.database.core.IOseeStatement.MAX_FETCH;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.osee.console.admin.Console;
import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.core.enums.TxChange;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
-import org.eclipse.osee.framework.database.core.IOseeStatement;
-import org.eclipse.osee.framework.database.core.OseeConnection;
-import org.eclipse.osee.framework.database.operation.Address;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.type.OseeStateException;
+import org.eclipse.osee.jdbc.JdbcClient;
+import org.eclipse.osee.jdbc.JdbcConnection;
+import org.eclipse.osee.jdbc.JdbcConstants;
+import org.eclipse.osee.jdbc.JdbcStatement;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.OrcsSession;
import org.eclipse.osee.orcs.db.internal.sql.join.ArtifactJoinQuery;
import org.eclipse.osee.orcs.db.internal.sql.join.ExportImportJoinQuery;
import org.eclipse.osee.orcs.db.internal.sql.join.SqlJoinFactory;
+import org.eclipse.osee.orcs.db.internal.util.Address;
/**
* @author Ryan D. Brooks
@@ -61,16 +61,16 @@ public class ConsolidateArtifactVersionDatabaseTxCallable extends AbstractDatast
private static final String UPDATE_TXS_MOD_CURRENT =
"update osee_txs%s set mod_type = ?, tx_current = ? where transaction_id = ? and gamma_id = ?";
- private List<Long[]> deleteArtifactVersionData;
+ private List<Object[]> deleteArtifactVersionData;
private final List<Long> obsoleteGammas = new ArrayList<Long>();
private final List<Object[]> addressingToDelete = new ArrayList<Object[]>(13000);
private final List<Object[]> updateAddressingData = new ArrayList<Object[]>(5000);
private final List<Object[]> updateTxsCurrentModData = new ArrayList<Object[]>(5000);
private ExportImportJoinQuery gammaJoin;
- private OseeConnection connection;
+ private JdbcConnection connection;
private int previousArtifactId;
private long netGamma;
- private IOseeStatement chStmt;
+ private JdbcStatement chStmt;
private long previousNetGammaId;
private long previousBranchId;
private int previuosTransactionId;
@@ -80,14 +80,14 @@ public class ConsolidateArtifactVersionDatabaseTxCallable extends AbstractDatast
private final SqlJoinFactory joinFactory;
private final Console console;
- public ConsolidateArtifactVersionDatabaseTxCallable(Log logger, OrcsSession session, IOseeDatabaseService databaseService, SqlJoinFactory joinFactory, Console console) {
- super(logger, session, databaseService, "Consolidate Artifact Versions");
+ public ConsolidateArtifactVersionDatabaseTxCallable(Log logger, OrcsSession session, JdbcClient jdbcClient, SqlJoinFactory joinFactory, Console console) {
+ super(logger, session, jdbcClient);
this.joinFactory = joinFactory;
this.console = console;
}
private void init() throws OseeCoreException {
- deleteArtifactVersionData = new ArrayList<Long[]>(14000);
+ deleteArtifactVersionData = new ArrayList<Object[]>(14000);
obsoleteGammas.clear();
updateAddressingData.clear();
addressingToDelete.clear();
@@ -97,7 +97,7 @@ public class ConsolidateArtifactVersionDatabaseTxCallable extends AbstractDatast
previuosTransactionId = -1;
updateTxsCounter = 0;
deleteTxsCounter = 0;
- chStmt = getDatabaseService().getStatement(connection);
+ chStmt = getJdbcClient().getStatement(connection);
gammaJoin = joinFactory.createExportImportJoinQuery();
}
@@ -117,7 +117,7 @@ public class ConsolidateArtifactVersionDatabaseTxCallable extends AbstractDatast
ArtifactJoinQuery artifactJoinQuery = populateJoinTableWithArtifacts();
List<Address> mods = new ArrayList<Address>();
try {
- chStmt.runPreparedQuery(MAX_FETCH, FIND_ARTIFACT_MODS, artifactJoinQuery.getQueryId());
+ chStmt.runPreparedQuery(JdbcConstants.JDBC__MAX_FETCH_SIZE, FIND_ARTIFACT_MODS, artifactJoinQuery.getQueryId());
while (chStmt.next()) {
int artifactId = chStmt.getInt("art_id");
long branchUuid = chStmt.getLong("branch_id");
@@ -198,7 +198,7 @@ public class ConsolidateArtifactVersionDatabaseTxCallable extends AbstractDatast
}
@Override
- protected Object handleTxWork(OseeConnection connection) throws OseeCoreException {
+ protected Object handleTxWork(JdbcConnection connection) throws OseeCoreException {
this.connection = connection;
init();
@@ -208,15 +208,14 @@ public class ConsolidateArtifactVersionDatabaseTxCallable extends AbstractDatast
console.writeln("updateTxsCurrentModData size: %d", updateTxsCurrentModData.size());
console.writeln("addressingToDelete size: %d", addressingToDelete.size());
- getDatabaseService().runBatchUpdate(connection, prepareSql(UPDATE_TXS_MOD_CURRENT, false),
- updateTxsCurrentModData);
- getDatabaseService().runBatchUpdate(connection, prepareSql(DELETE_TXS, false), addressingToDelete);
+ getJdbcClient().runBatchUpdate(connection, prepareSql(UPDATE_TXS_MOD_CURRENT, false), updateTxsCurrentModData);
+ getJdbcClient().runBatchUpdate(connection, prepareSql(DELETE_TXS, false), addressingToDelete);
findObsoleteGammas();
console.writeln("gamma join size: %d", gammaJoin.size());
console.writeln("Number of artifact version rows deleted: %d",
- getDatabaseService().runBatchUpdate(connection, DELETE_ARTIFACT_VERSIONS, deleteArtifactVersionData));
+ getJdbcClient().runBatchUpdate(connection, DELETE_ARTIFACT_VERSIONS, deleteArtifactVersionData));
deleteArtifactVersionData = null;
gammaJoin.store(connection);
@@ -233,13 +232,13 @@ public class ConsolidateArtifactVersionDatabaseTxCallable extends AbstractDatast
}
private void updataConflicts(String columnName) throws OseeCoreException {
- int count = getDatabaseService().runPreparedUpdate(connection, String.format(UPDATE_CONFLICTS, columnName));
+ int count = getJdbcClient().runPreparedUpdate(connection, String.format(UPDATE_CONFLICTS, columnName));
console.writeln("updated %s in %d rows", columnName, count);
}
private void findObsoleteGammas() throws OseeCoreException {
try {
- chStmt.runPreparedQuery(MAX_FETCH, SELECT_ARTIFACT_VERSIONS);
+ chStmt.runPreparedQuery(JdbcConstants.JDBC__MAX_FETCH_SIZE, SELECT_ARTIFACT_VERSIONS);
while (chStmt.next()) {
int artifactId = chStmt.getInt("art_id");
@@ -268,8 +267,8 @@ public class ConsolidateArtifactVersionDatabaseTxCallable extends AbstractDatast
private void determineAffectedAddressingAndFix(boolean archived) throws OseeCoreException {
try {
console.writeln("query id: %d", gammaJoin.getQueryId());
- chStmt.runPreparedQuery(MAX_FETCH, String.format(SELECT_ADDRESSING, archived ? "_archived" : ""),
- gammaJoin.getQueryId());
+ chStmt.runPreparedQuery(JdbcConstants.JDBC__MAX_FETCH_SIZE,
+ String.format(SELECT_ADDRESSING, archived ? "_archived" : ""), gammaJoin.getQueryId());
while (chStmt.next()) {
long obsoleteGammaId = chStmt.getLong("gamma_id");
@@ -329,15 +328,14 @@ public class ConsolidateArtifactVersionDatabaseTxCallable extends AbstractDatast
String archivedStr = archived ? "_archived" : "";
if (addressingToDelete.size() > 99960 || force) {
deleteTxsCounter +=
- getDatabaseService().runBatchUpdate(connection, prepareSql(DELETE_TXS, archived), addressingToDelete);
+ getJdbcClient().runBatchUpdate(connection, prepareSql(DELETE_TXS, archived), addressingToDelete);
console.writeln("Number of txs%s rows deleted: %d", archivedStr, deleteTxsCounter);
addressingToDelete.clear();
}
if (updateAddressingData.size() > 99960 || force) {
updateTxsCounter +=
- getDatabaseService().runBatchUpdate(connection, prepareSql(UPDATE_TXS_GAMMAS, archived),
- updateAddressingData);
+ getJdbcClient().runBatchUpdate(connection, prepareSql(UPDATE_TXS_GAMMAS, archived), updateAddressingData);
console.writeln("Number of txs%s rows updated: %d", archivedStr, updateTxsCounter);
updateAddressingData.clear();
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/ConsolidateRelationsDatabaseTxCallable.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/ConsolidateRelationsDatabaseTxCallable.java
index c8974689dc..75d1b6d188 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/ConsolidateRelationsDatabaseTxCallable.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/ConsolidateRelationsDatabaseTxCallable.java
@@ -10,18 +10,18 @@
*******************************************************************************/
package org.eclipse.osee.orcs.db.internal.callable;
-import static org.eclipse.osee.framework.database.core.IOseeStatement.MAX_FETCH;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.osee.console.admin.Console;
import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.core.enums.TxChange;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
-import org.eclipse.osee.framework.database.core.IOseeStatement;
-import org.eclipse.osee.framework.database.core.OseeConnection;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.type.OseeStateException;
import org.eclipse.osee.framework.jdk.core.util.Strings;
+import org.eclipse.osee.jdbc.JdbcClient;
+import org.eclipse.osee.jdbc.JdbcConnection;
+import org.eclipse.osee.jdbc.JdbcConstants;
+import org.eclipse.osee.jdbc.JdbcStatement;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.OrcsSession;
import org.eclipse.osee.orcs.db.internal.sql.join.ExportImportJoinQuery;
@@ -45,13 +45,13 @@ public class ConsolidateRelationsDatabaseTxCallable extends AbstractDatastoreTxC
private static final String DELETE_RELATIONS = "delete from osee_relation_link where gamma_id = ?";
- private final List<Long[]> relationDeleteData = new ArrayList<Long[]>(14000);
+ private final List<Object[]> relationDeleteData = new ArrayList<Object[]>(14000);
private final List<Long> obsoleteGammas = new ArrayList<Long>();
private final StringBuilder addressingBackup = new StringBuilder(100000);
private final List<Object[]> addressingToDelete = new ArrayList<Object[]>(13000);
private final List<Object[]> updateAddressingData = new ArrayList<Object[]>(5000);
private ExportImportJoinQuery gammaJoin;
- private OseeConnection connection;
+ private JdbcConnection connection;
private long previousRelationTypeId;
private int previousArtifactAId;
private int previousArtiafctBId;
@@ -60,7 +60,7 @@ public class ConsolidateRelationsDatabaseTxCallable extends AbstractDatastoreTxC
boolean materiallyDifferent;
boolean updateAddressing;
private int counter;
- private IOseeStatement chStmt;
+ private JdbcStatement chStmt;
private final SqlJoinFactory joinFactory;
private final Console console;
@@ -71,8 +71,8 @@ public class ConsolidateRelationsDatabaseTxCallable extends AbstractDatastoreTxC
ModificationType netModType;
TxChange netTxCurrent;
- public ConsolidateRelationsDatabaseTxCallable(Log logger, OrcsSession session, IOseeDatabaseService databaseService, SqlJoinFactory joinFactory, Console console) {
- super(logger, session, databaseService, "Consolidate Relations");
+ public ConsolidateRelationsDatabaseTxCallable(Log logger, OrcsSession session, JdbcClient jdbcClient, SqlJoinFactory joinFactory, Console console) {
+ super(logger, session, jdbcClient);
this.joinFactory = joinFactory;
this.console = console;
}
@@ -91,14 +91,14 @@ public class ConsolidateRelationsDatabaseTxCallable extends AbstractDatastoreTxC
previousNetGammaId = -1;
previousTransactionId = -1;
- chStmt = getDatabaseService().getStatement();
+ chStmt = getJdbcClient().getStatement();
gammaJoin = joinFactory.createExportImportJoinQuery();
counter = 0;
}
@Override
- protected Object handleTxWork(OseeConnection connection) throws OseeCoreException {
+ protected Object handleTxWork(JdbcConnection connection) throws OseeCoreException {
this.connection = connection;
console.writeln("Consolidating relations:");
init();
@@ -116,7 +116,7 @@ public class ConsolidateRelationsDatabaseTxCallable extends AbstractDatastoreTxC
private void findObsoleteRelations() throws OseeCoreException {
try {
- chStmt.runPreparedQuery(MAX_FETCH, SELECT_RELATIONS);
+ chStmt.runPreparedQuery(JdbcConstants.JDBC__MAX_FETCH_SIZE, SELECT_RELATIONS);
while (chStmt.next()) {
long relationTypeId = chStmt.getLong("rel_link_type_id");
int artifactAId = chStmt.getInt("a_art_id");
@@ -156,7 +156,7 @@ public class ConsolidateRelationsDatabaseTxCallable extends AbstractDatastoreTxC
try {
console.writeln("counter: [%s]", counter);
console.writeln("query id: [%s]", gammaJoin.getQueryId());
- chStmt.runPreparedQuery(MAX_FETCH, SELECT_RELATION_ADDRESSING, gammaJoin.getQueryId());
+ chStmt.runPreparedQuery(JdbcConstants.JDBC__MAX_FETCH_SIZE, SELECT_RELATION_ADDRESSING, gammaJoin.getQueryId());
while (chStmt.next()) {
long obsoleteGammaId = chStmt.getLong("gamma_id");
@@ -235,13 +235,13 @@ public class ConsolidateRelationsDatabaseTxCallable extends AbstractDatastoreTxC
private void updateGammas() throws OseeCoreException {
console.writeln("Number of txs rows deleted: [%s]",
- getDatabaseService().runBatchUpdate(connection, DELETE_TXS, addressingToDelete));
+ getJdbcClient().runBatchUpdate(connection, DELETE_TXS, addressingToDelete));
console.writeln("Number of relation rows deleted: [%s]",
- getDatabaseService().runBatchUpdate(connection, DELETE_RELATIONS, relationDeleteData));
+ getJdbcClient().runBatchUpdate(connection, DELETE_RELATIONS, relationDeleteData));
console.writeln("Number of txs rows updated: [%s]",
- getDatabaseService().runBatchUpdate(connection, UPDATE_TXS_GAMMAS, updateAddressingData));
+ getJdbcClient().runBatchUpdate(connection, UPDATE_TXS_GAMMAS, updateAddressingData));
}
private void writeAddressingBackup(long obsoleteGammaId, int transactionId, long netGammaId, int modType, TxChange txCurrent) {
@@ -264,7 +264,7 @@ public class ConsolidateRelationsDatabaseTxCallable extends AbstractDatastoreTxC
return previousRelationTypeId != relationTypeId || previousArtifactAId != artifactAId || previousArtiafctBId != artiafctBId;
}
- private void relationMateriallyDiffers(IOseeStatement chStmt) throws OseeCoreException {
+ private void relationMateriallyDiffers(JdbcStatement chStmt) throws OseeCoreException {
if (!materiallyDifferent) {
String currentRationale = chStmt.getString("rationale");
materiallyDifferent |= Strings.isValid(currentRationale) && !currentRationale.equals(netRationale);
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 4e98f213a7..805ef897dd 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
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.osee.orcs.db.internal.callable;
-import static org.eclipse.osee.framework.database.core.IOseeStatement.MAX_FETCH;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.HashSet;
@@ -23,18 +22,20 @@ import org.eclipse.osee.framework.core.enums.PermissionEnum;
import org.eclipse.osee.framework.core.enums.SystemUser;
import org.eclipse.osee.framework.core.enums.TransactionDetailsType;
import org.eclipse.osee.framework.core.enums.TxChange;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
-import org.eclipse.osee.framework.database.core.IOseeStatement;
-import org.eclipse.osee.framework.database.core.OseeConnection;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.type.OseeStateException;
import org.eclipse.osee.framework.jdk.core.util.GUID;
import org.eclipse.osee.framework.jdk.core.util.Lib;
import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.framework.jdk.core.util.time.GlobalTime;
+import org.eclipse.osee.jdbc.JdbcClient;
+import org.eclipse.osee.jdbc.JdbcConnection;
+import org.eclipse.osee.jdbc.JdbcConstants;
+import org.eclipse.osee.jdbc.JdbcStatement;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.OrcsSession;
import org.eclipse.osee.orcs.data.CreateBranchData;
+import org.eclipse.osee.orcs.db.internal.IdentityManager;
import org.eclipse.osee.orcs.db.internal.sql.RelationalConstants;
/**
@@ -91,12 +92,14 @@ public class CreateBranchDatabaseTxCallable extends AbstractDatastoreTxCallable<
private static final String SELECT_INHERIT_ACCESS_CONTROL =
"SELECT inherit_access_control from osee_branch where branch_id = ?";
+ private final IdentityManager idManager;
private int systemUserId;
private final CreateBranchData newBranchData;
- public CreateBranchDatabaseTxCallable(Log logger, OrcsSession session, IOseeDatabaseService databaseService, CreateBranchData branchData) {
- super(logger, session, databaseService, String.format("Create Branch %s", branchData.getName()));
+ public CreateBranchDatabaseTxCallable(Log logger, OrcsSession session, JdbcClient jdbcClient, IdentityManager idManager, CreateBranchData branchData) {
+ super(logger, session, jdbcClient);
+ this.idManager = idManager;
this.newBranchData = branchData;
this.systemUserId = -1;
}
@@ -105,7 +108,7 @@ public class CreateBranchDatabaseTxCallable extends AbstractDatastoreTxCallable<
if (systemUserId == -1) {
try {
systemUserId =
- getDatabaseService().runPreparedQueryFetchObject(-1, USER_ID_QUERY, SystemUser.OseeSystem.getGuid());
+ getJdbcClient().runPreparedQueryFetchObject(-1, USER_ID_QUERY, SystemUser.OseeSystem.getGuid());
} catch (OseeCoreException ex) {
getLogger().warn(ex, "Unable to retrieve the system user");
}
@@ -115,7 +118,7 @@ public class CreateBranchDatabaseTxCallable extends AbstractDatastoreTxCallable<
public void checkPreconditions(Long parentBranch, Long destinationBranch) throws OseeCoreException {
if (newBranchData.getBranchType().isMergeBranch()) {
- if (getDatabaseService().runPreparedQueryFetchObject(0, TEST_MERGE_BRANCH_EXISTENCE, parentBranch,
+ if (getJdbcClient().runPreparedQueryFetchObject(0, TEST_MERGE_BRANCH_EXISTENCE, parentBranch,
destinationBranch) > 0) {
throw new OseeStateException("Existing merge branch detected for [%d] and [%d]", parentBranch,
destinationBranch);
@@ -127,7 +130,7 @@ public class CreateBranchDatabaseTxCallable extends AbstractDatastoreTxCallable<
// this checks to see if there are any branches that aren't either DELETED or REBASELINED with the same artifact ID
if (associatedArtifactId > -1 && associatedArtifactId != systemUserId) {
int count =
- getDatabaseService().runPreparedQueryFetchObject(0,
+ getJdbcClient().runPreparedQueryFetchObject(0,
"SELECT (1) FROM osee_branch WHERE associated_art_id = ? AND branch_state NOT IN (?, ?)",
newBranchData.getAssociatedArtifactId(), BranchState.DELETED.getValue(),
BranchState.REBASELINED.getValue());
@@ -138,7 +141,7 @@ public class CreateBranchDatabaseTxCallable extends AbstractDatastoreTxCallable<
if (newBranchData.getBranchType().equals(BranchType.PORT)) {
int portcount =
- getDatabaseService().runPreparedQueryFetchObject(
+ getJdbcClient().runPreparedQueryFetchObject(
0,
"SELECT (1) FROM osee_branch WHERE associated_art_id = ? AND branch_state NOT IN (?, ?) AND branch_type = ?",
newBranchData.getAssociatedArtifactId(), BranchState.DELETED.getValue(),
@@ -155,9 +158,8 @@ public class CreateBranchDatabaseTxCallable extends AbstractDatastoreTxCallable<
}
}
- @SuppressWarnings("unchecked")
@Override
- protected Void handleTxWork(OseeConnection connection) throws OseeCoreException {
+ protected Void handleTxWork(JdbcConnection connection) throws OseeCoreException {
Long parentBranchUuid = newBranchData.getParentBranchUuid();
Long destinationBranchUuid = newBranchData.getMergeDestinationBranchId();
@@ -168,7 +170,7 @@ public class CreateBranchDatabaseTxCallable extends AbstractDatastoreTxCallable<
final String truncatedName = Strings.truncate(newBranchData.getName(), 195, true);
Timestamp timestamp = GlobalTime.GreenwichMeanTimestamp();
- int nextTransactionId = getDatabaseService().getSequence().getNextTransactionId();
+ int nextTransactionId = idManager.getNextTransactionId();
int sourceTx;
if (newBranchData.getBranchType().isSystemRootBranch()) {
@@ -184,8 +186,7 @@ public class CreateBranchDatabaseTxCallable extends AbstractDatastoreTxCallable<
int inheritAccessControl = 0;
if (parentBranchUuid != null) {
inheritAccessControl =
- getDatabaseService().runPreparedQueryFetchObject(connection, 0, SELECT_INHERIT_ACCESS_CONTROL,
- parentBranchUuid);
+ getJdbcClient().runPreparedQueryFetchObject(connection, 0, SELECT_INHERIT_ACCESS_CONTROL, parentBranchUuid);
}
//write to branch table
@@ -222,13 +223,13 @@ public class CreateBranchDatabaseTxCallable extends AbstractDatastoreTxCallable<
}
String insertBranch = insertBranchGuid ? INSERT_BRANCH_WITH_GUID : INSERT_BRANCH;
- getDatabaseService().runPreparedUpdate(connection, insertBranch, toInsert);
+ getJdbcClient().runPreparedUpdate(connection, insertBranch, toInsert);
if (inheritAccessControl != 0) {
copyAccessRules(connection, newBranchData.getUserArtifactId(), parentBranchUuid, uuid);
}
- getDatabaseService().runPreparedUpdate(connection, INSERT_TX_DETAILS, uuid, nextTransactionId,
+ getJdbcClient().runPreparedUpdate(connection, INSERT_TX_DETAILS, uuid, nextTransactionId,
newBranchData.getCreationComment(), timestamp, newBranchData.getUserArtifactId(),
TransactionDetailsType.Baselined.getId());
@@ -238,21 +239,21 @@ public class CreateBranchDatabaseTxCallable extends AbstractDatastoreTxCallable<
return null;
}
- private boolean isBranchGuidNeeded(OseeConnection connection) {
- return getDatabaseService().runPreparedQueryFetchObject(connection, false,
+ private boolean isBranchGuidNeeded(JdbcConnection connection) {
+ return getJdbcClient().runPreparedQueryFetchObject(connection, false,
"select osee_value from osee_info where osee_key = ?", "osee.insert.branch.guid.on.create");
}
- private void addMergeBranchEntry(double workAmount, OseeConnection connection) {
+ private void addMergeBranchEntry(double workAmount, JdbcConnection connection) {
if (newBranchData.getBranchType().isMergeBranch()) {
long parentBranchId = newBranchData.getParentBranchUuid() != null ? newBranchData.getParentBranchUuid() : -1;
- getDatabaseService().runPreparedUpdate(connection, MERGE_BRANCH_INSERT, parentBranchId,
+ getJdbcClient().runPreparedUpdate(connection, MERGE_BRANCH_INSERT, parentBranchId,
newBranchData.getMergeDestinationBranchId(), newBranchData.getUuid(), 0);
}
checkForCancelled();
}
- private void populateBaseTransaction(double workAmount, OseeConnection connection, int baseTxId, int sourceTxId) throws OseeCoreException {
+ private void populateBaseTransaction(double workAmount, JdbcConnection connection, int baseTxId, int sourceTxId) throws OseeCoreException {
if (newBranchData.getBranchType() != BranchType.SYSTEM_ROOT) {
List<Object[]> data = new ArrayList<Object[]>();
HashSet<Integer> gammas = new HashSet<Integer>(100000);
@@ -269,16 +270,16 @@ public class CreateBranchDatabaseTxCallable extends AbstractDatastoreTxCallable<
populateAddressingToCopy(connection, data, baseTxId, gammas, SELECT_ADDRESSING, parentBranchId, sourceTxId);
}
if (!data.isEmpty()) {
- getDatabaseService().runBatchUpdate(connection, INSERT_ADDRESSING, data);
+ getJdbcClient().runBatchUpdate(connection, INSERT_ADDRESSING, data);
}
}
checkForCancelled();
}
- private void populateAddressingToCopy(OseeConnection connection, List<Object[]> data, int baseTxId, HashSet<Integer> gammas, String query, Object... parameters) throws OseeCoreException {
- IOseeStatement chStmt = getDatabaseService().getStatement(connection);
+ private void populateAddressingToCopy(JdbcConnection connection, List<Object[]> data, int baseTxId, HashSet<Integer> gammas, String query, Object... parameters) throws OseeCoreException {
+ JdbcStatement chStmt = getJdbcClient().getStatement(connection);
try {
- chStmt.runPreparedQuery(MAX_FETCH, query, parameters);
+ chStmt.runPreparedQuery(JdbcConstants.JDBC__MAX_FETCH_SIZE, query, parameters);
while (chStmt.next()) {
checkForCancelled();
Integer gamma = chStmt.getInt("gamma_id");
@@ -299,14 +300,14 @@ public class CreateBranchDatabaseTxCallable extends AbstractDatastoreTxCallable<
}
}
- private void copyAccessRules(OseeConnection connection, int userArtId, Long parentBranch, Long branchUuid) {
+ private void copyAccessRules(JdbcConnection connection, int userArtId, Long parentBranch, Long branchUuid) {
int owner = PermissionEnum.OWNER.getPermId();
int deny = PermissionEnum.DENY.getPermId();
List<Object[]> data = new ArrayList<Object[]>();
- IOseeStatement chStmt = getDatabaseService().getStatement(connection);
+ JdbcStatement chStmt = getJdbcClient().getStatement(connection);
try {
- chStmt.runPreparedQuery(MAX_FETCH, GET_BRANCH_ACCESS_CONTROL_LIST, parentBranch);
+ chStmt.runPreparedQuery(JdbcConstants.JDBC__MAX_FETCH_SIZE, GET_BRANCH_ACCESS_CONTROL_LIST, parentBranch);
while (chStmt.next()) {
int permissionId = chStmt.getInt("permission_id");
int priviledgeId = chStmt.getInt("privilege_entity_id");
@@ -319,7 +320,7 @@ public class CreateBranchDatabaseTxCallable extends AbstractDatastoreTxCallable<
Lib.close(chStmt);
}
if (!data.isEmpty()) {
- getDatabaseService().runBatchUpdate(INSERT_INTO_BRANCH_ACL, data);
+ getJdbcClient().runBatchUpdate(INSERT_INTO_BRANCH_ACL, data);
}
}
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/DeleteRelationDatabaseCallable.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/DeleteRelationDatabaseCallable.java
index 01a407f00f..596472b37e 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/DeleteRelationDatabaseCallable.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/DeleteRelationDatabaseCallable.java
@@ -18,16 +18,17 @@ import org.eclipse.osee.framework.core.enums.TransactionDetailsType;
import org.eclipse.osee.framework.core.enums.TxChange;
import org.eclipse.osee.framework.core.model.Branch;
import org.eclipse.osee.framework.core.model.cache.BranchCache;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
-import org.eclipse.osee.framework.database.core.IOseeStatement;
-import org.eclipse.osee.framework.database.core.OseeConnection;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.type.OseeStateException;
import org.eclipse.osee.framework.jdk.core.type.Triplet;
import org.eclipse.osee.framework.jdk.core.util.Lib;
import org.eclipse.osee.framework.jdk.core.util.time.GlobalTime;
+import org.eclipse.osee.jdbc.JdbcClient;
+import org.eclipse.osee.jdbc.JdbcConnection;
+import org.eclipse.osee.jdbc.JdbcStatement;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.OrcsSession;
+import org.eclipse.osee.orcs.db.internal.IdentityManager;
import org.eclipse.osee.orcs.db.internal.accessor.UpdatePreviousTxCurrent;
import org.eclipse.osee.orcs.db.internal.sql.join.SqlJoinFactory;
@@ -46,6 +47,7 @@ public class DeleteRelationDatabaseCallable extends AbstractDatastoreTxCallable<
"insert into osee_txs (mod_type, tx_current, transaction_id, gamma_id, branch_id) values (?, ?, ?, ?, ?)";
private final SqlJoinFactory joinFactory;
+ private final IdentityManager idManager;
private final BranchCache branchCache;
private final IOseeBranch branchToken;
@@ -55,9 +57,10 @@ public class DeleteRelationDatabaseCallable extends AbstractDatastoreTxCallable<
private final int bArtId;
private final String comment;
- public DeleteRelationDatabaseCallable(Log logger, OrcsSession session, IOseeDatabaseService databaseService, SqlJoinFactory joinFactory, BranchCache branchCache, IOseeBranch branchToken, IRelationTypeSide relationType, int aArtId, int bArtId, int artUserId, String comment) {
- super(logger, session, databaseService, "Delete Relation");
+ public DeleteRelationDatabaseCallable(Log logger, OrcsSession session, JdbcClient jdbcClient, SqlJoinFactory joinFactory, IdentityManager idManager, BranchCache branchCache, IOseeBranch branchToken, IRelationTypeSide relationType, int aArtId, int bArtId, int artUserId, String comment) {
+ super(logger, session, jdbcClient);
this.joinFactory = joinFactory;
+ this.idManager = idManager;
this.branchCache = branchCache;
this.branchToken = branchToken;
@@ -70,7 +73,7 @@ public class DeleteRelationDatabaseCallable extends AbstractDatastoreTxCallable<
}
@Override
- protected Branch handleTxWork(OseeConnection connection) throws OseeCoreException {
+ protected Branch handleTxWork(JdbcConnection connection) throws OseeCoreException {
Branch branch = branchCache.get(branchToken);
Triplet<Integer, Integer, Integer> relIdModTypeGammaId =
getRelationModAndGammaTxData(branch, relationType, aArtId, bArtId);
@@ -78,7 +81,7 @@ public class DeleteRelationDatabaseCallable extends AbstractDatastoreTxCallable<
int modType = relIdModTypeGammaId.getSecond();
if (modType != ModificationType.ARTIFACT_DELETED.getValue() && modType != ModificationType.DELETED.getValue()) {
UpdatePreviousTxCurrent txc =
- new UpdatePreviousTxCurrent(getDatabaseService(), joinFactory, connection, branch.getUuid());
+ new UpdatePreviousTxCurrent(getJdbcClient(), joinFactory, connection, branch.getUuid());
txc.addRelation(relIdModTypeGammaId.getFirst());
txc.updateTxNotCurrents();
@@ -92,7 +95,7 @@ public class DeleteRelationDatabaseCallable extends AbstractDatastoreTxCallable<
private Triplet<Integer, Integer, Integer> getRelationModAndGammaTxData(Branch commonBranch, IRelationTypeSide relationType, int aArtId, int bArtId) throws OseeCoreException {
long relationTypeId = relationType.getGuid();
- IOseeStatement chStmt = getDatabaseService().getStatement();
+ JdbcStatement chStmt = getJdbcClient().getStatement();
try {
chStmt.runPreparedQuery(1, SELECT_RELATION_LINK, relationTypeId, aArtId, bArtId, commonBranch.getUuid(),
TxChange.NOT_CURRENT.getValue());
@@ -111,15 +114,14 @@ public class DeleteRelationDatabaseCallable extends AbstractDatastoreTxCallable<
}
}
- @SuppressWarnings("unchecked")
- private void createNewTxAddressing(OseeConnection connection, Branch commonBranch, String comment, int userId, int currentGammaId) throws OseeCoreException {
- int transactionId = getDatabaseService().getSequence().getNextTransactionId();
+ private void createNewTxAddressing(JdbcConnection connection, Branch commonBranch, String comment, int userId, int currentGammaId) throws OseeCoreException {
+ int transactionId = idManager.getNextTransactionId();
Timestamp timestamp = GlobalTime.GreenwichMeanTimestamp();
int txType = TransactionDetailsType.NonBaselined.getId();
- getDatabaseService().runPreparedUpdate(connection, INSERT_INTO_TX_DETAILS, commonBranch.getUuid(), transactionId,
+ getJdbcClient().runPreparedUpdate(connection, INSERT_INTO_TX_DETAILS, commonBranch.getUuid(), transactionId,
comment, timestamp, userId, txType);
- getDatabaseService().runPreparedUpdate(connection, INSERT_INTO_TXS, ModificationType.DELETED.getValue(),
+ getJdbcClient().runPreparedUpdate(connection, INSERT_INTO_TXS, ModificationType.DELETED.getValue(),
TxChange.DELETED.getValue(), transactionId, currentGammaId, commonBranch.getUuid());
}
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/FetchDatastoreInfoCallable.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/FetchDatastoreInfoCallable.java
index 9c18be7e98..f956f19176 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/FetchDatastoreInfoCallable.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/FetchDatastoreInfoCallable.java
@@ -18,14 +18,13 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import org.eclipse.osee.database.schema.SchemaResource;
-import org.eclipse.osee.database.schema.SchemaResourceProvider;
import org.eclipse.osee.framework.core.exception.OseeExceptions;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
-import org.eclipse.osee.framework.database.core.OseeConnection;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.framework.resource.management.IResource;
+import org.eclipse.osee.jdbc.JdbcClient;
+import org.eclipse.osee.jdbc.JdbcConnection;
+import org.eclipse.osee.jdbc.JdbcSchemaResource;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.OrcsSession;
import org.eclipse.osee.orcs.core.SystemPreferences;
@@ -33,17 +32,18 @@ import org.eclipse.osee.orcs.core.ds.DataStoreConstants;
import org.eclipse.osee.orcs.core.ds.DataStoreInfo;
import org.eclipse.osee.orcs.db.internal.resource.ResourceConstants;
import org.eclipse.osee.orcs.db.internal.util.DataStoreInfoImpl;
+import com.google.common.base.Supplier;
/**
* @author Roberto E. Escobar
*/
public class FetchDatastoreInfoCallable extends AbstractDatastoreCallable<DataStoreInfo> {
- private final SchemaResourceProvider schemaProvider;
+ private final Supplier<Iterable<JdbcSchemaResource>> schemaProvider;
private final SystemPreferences preferences;
- public FetchDatastoreInfoCallable(Log logger, OrcsSession session, IOseeDatabaseService dbService, SchemaResourceProvider schemaProvider, SystemPreferences preferences) {
- super(logger, session, dbService);
+ public FetchDatastoreInfoCallable(Log logger, OrcsSession session, JdbcClient jdbcClient, Supplier<Iterable<JdbcSchemaResource>> schemaProvider, SystemPreferences preferences) {
+ super(logger, session, jdbcClient);
this.schemaProvider = schemaProvider;
this.preferences = preferences;
}
@@ -61,7 +61,7 @@ public class FetchDatastoreInfoCallable extends AbstractDatastoreCallable<DataSt
List<IResource> configResources = new ArrayList<IResource>();
dataStoreInfo.setConfigurationResources(configResources);
- for (SchemaResource resource : schemaProvider.getSchemaResources()) {
+ for (JdbcSchemaResource resource : schemaProvider.get()) {
configResources.add(asResource(resource));
}
return dataStoreInfo;
@@ -82,7 +82,7 @@ public class FetchDatastoreInfoCallable extends AbstractDatastoreCallable<DataSt
}
private void addDbMetaData(Map<String, String> props) throws OseeCoreException {
- OseeConnection connection = getDatabaseService().getConnection();
+ JdbcConnection connection = getJdbcClient().getConnection();
try {
DatabaseMetaData meta = connection.getMetaData();
props.put("db.connection.url", meta.getURL());
@@ -101,16 +101,16 @@ public class FetchDatastoreInfoCallable extends AbstractDatastoreCallable<DataSt
}
}
- private IResource asResource(SchemaResource resource) {
+ private IResource asResource(JdbcSchemaResource resource) {
return new SchemaResourceAdaptor(getLogger(), resource);
}
private static final class SchemaResourceAdaptor implements IResource {
private final Log logger;
- private final SchemaResource resource;
+ private final JdbcSchemaResource resource;
- public SchemaResourceAdaptor(Log logger, SchemaResource resource) {
+ public SchemaResourceAdaptor(Log logger, JdbcSchemaResource resource) {
super();
this.logger = logger;
this.resource = resource;
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/ImportBranchDatabaseCallable.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/ImportBranchDatabaseCallable.java
index fb434bef91..45d8436d28 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/ImportBranchDatabaseCallable.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/ImportBranchDatabaseCallable.java
@@ -22,9 +22,6 @@ import java.util.Date;
import java.util.List;
import org.eclipse.osee.framework.core.data.IOseeBranch;
import org.eclipse.osee.framework.core.exception.OseeExceptions;
-import org.eclipse.osee.framework.core.operation.OperationLogger;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
-import org.eclipse.osee.framework.database.core.OseeConnection;
import org.eclipse.osee.framework.jdk.core.type.OseeArgumentException;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.type.OseeStateException;
@@ -33,6 +30,8 @@ import org.eclipse.osee.framework.jdk.core.type.PropertyStore;
import org.eclipse.osee.framework.resource.management.IResource;
import org.eclipse.osee.framework.resource.management.IResourceLocator;
import org.eclipse.osee.framework.resource.management.IResourceManager;
+import org.eclipse.osee.jdbc.JdbcClient;
+import org.eclipse.osee.jdbc.JdbcConnection;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.ImportOptions;
import org.eclipse.osee.orcs.OrcsSession;
@@ -70,7 +69,6 @@ public class ImportBranchDatabaseCallable extends AbstractDatastoreCallable<URI>
private final OrcsTypes orcsTypes;
private final SavePointManager savePointManager;
- private final OperationLogger legacyLogger;
private final URI exchangeFile;
private final List<IOseeBranch> selectedBranches;
@@ -84,14 +82,13 @@ public class ImportBranchDatabaseCallable extends AbstractDatastoreCallable<URI>
private ExchangeDataProcessor exchangeDataProcessor;
private long[] branchesToImport;
- public ImportBranchDatabaseCallable(Log logger, OrcsSession session, IOseeDatabaseService dbService, SystemPreferences preferences, IResourceManager resourceManager, IdentityLocator identityService, OrcsTypes orcsTypes, URI exchangeFile, List<IOseeBranch> selectedBranches, PropertyStore options) {
- super(logger, session, dbService);
+ public ImportBranchDatabaseCallable(Log logger, OrcsSession session, JdbcClient jdbcClient, SystemPreferences preferences, IResourceManager resourceManager, IdentityLocator identityService, OrcsTypes orcsTypes, URI exchangeFile, List<IOseeBranch> selectedBranches, PropertyStore options) {
+ super(logger, session, jdbcClient);
this.preferences = preferences;
this.resourceManager = resourceManager;
this.identityService = identityService;
this.orcsTypes = orcsTypes;
- this.savePointManager = new SavePointManager(dbService);
- this.legacyLogger = new OperationLoggerAdaptor();
+ this.savePointManager = new SavePointManager(jdbcClient);
this.exchangeFile = exchangeFile;
this.selectedBranches = selectedBranches;
this.options = options;
@@ -113,7 +110,7 @@ public class ImportBranchDatabaseCallable extends AbstractDatastoreCallable<URI>
loadTypeModel(modelUri);
ImportBranchesTx importBranchesTx =
- new ImportBranchesTx(getLogger(), getSession(), getDatabaseService(), savePointManager,
+ new ImportBranchesTx(getLogger(), getSession(), getJdbcClient(), savePointManager,
manifestHandler.getBranchFile());
callAndCheckForCancel(importBranchesTx);
@@ -130,7 +127,7 @@ public class ImportBranchDatabaseCallable extends AbstractDatastoreCallable<URI>
importBranchesTx.updateBaselineAndParentTransactionId();
- exchangeTransformer.applyFinalTransforms(legacyLogger);
+ exchangeTransformer.applyFinalTransforms();
savePointManager.setCurrentSetPointId("stop");
savePointManager.addCurrentSavePointToProcessed();
@@ -146,7 +143,7 @@ public class ImportBranchDatabaseCallable extends AbstractDatastoreCallable<URI>
}
private void checkPreconditions() throws OseeCoreException {
- if (getDatabaseService().isProduction()) {
+ if (getJdbcClient().getConfig().isProduction()) {
throw new OseeStateException("DO NOT IMPORT ON PRODUCTION");
}
@@ -172,20 +169,21 @@ public class ImportBranchDatabaseCallable extends AbstractDatastoreCallable<URI>
savePointManager.setCurrentSetPointId("sourceSetup");
IExchangeTransformProvider transformProvider = new ExchangeTransformProvider();
- exchangeTransformer = new ExchangeTransformer(getDatabaseService(), transformProvider, exchangeDataProcessor);
- exchangeTransformer.applyTransforms(legacyLogger);
+ exchangeTransformer =
+ new ExchangeTransformer(getLogger(), getSession(), getJdbcClient(), transformProvider, exchangeDataProcessor);
+ exchangeTransformer.applyTransforms();
savePointManager.setCurrentSetPointId("manifest");
manifestHandler = new ManifestSaxHandler();
exchangeDataProcessor.parse(ExportItem.EXPORT_MANIFEST, manifestHandler);
savePointManager.setCurrentSetPointId("setup");
- translator = new TranslationManager(getDatabaseService());
+ translator = new TranslationManager(getJdbcClient());
translator.configure(options);
// Process database meta data
savePointManager.setCurrentSetPointId(manifestHandler.getMetadataFile());
- metadataHandler = new MetaDataSaxHandler(getDatabaseService());
+ metadataHandler = new MetaDataSaxHandler(getJdbcClient());
exchangeDataProcessor.parse(ExportItem.EXPORT_DB_SCHEMA, metadataHandler);
metadataHandler.checkAndLoadTargetDbMetadata();
@@ -198,7 +196,7 @@ public class ImportBranchDatabaseCallable extends AbstractDatastoreCallable<URI>
private void processImportFiles(long[] branchesToImport, Collection<IExportItem> importItems) throws Exception {
final DbTableSaxHandler handler =
- DbTableSaxHandler.createWithLimitedCache(getLogger(), getDatabaseService(), resourceManager, identityService,
+ DbTableSaxHandler.createWithLimitedCache(getLogger(), getJdbcClient(), resourceManager, identityService,
exportDataProvider, 50000);
handler.setSelectedBranchIds(branchesToImport);
@@ -249,8 +247,7 @@ public class ImportBranchDatabaseCallable extends AbstractDatastoreCallable<URI>
private void cleanup() throws Exception {
try {
- CommitImportSavePointsTx callable =
- new CommitImportSavePointsTx(getLogger(), getSession(), getDatabaseService());
+ CommitImportSavePointsTx callable = new CommitImportSavePointsTx(getLogger(), getSession(), getJdbcClient());
callAndCheckForCancel(callable);
} catch (Exception ex) {
getLogger().warn(ex, "Error during save point save - you will not be able to reimport from last source again.");
@@ -306,23 +303,24 @@ public class ImportBranchDatabaseCallable extends AbstractDatastoreCallable<URI>
getLogger().info("Type Model Import complete");
}
private final class CommitImportSavePointsTx extends AbstractDatastoreTxCallable<Boolean> {
+
+ private static final String IMPORT_ID_SEQ = "SKYNET_IMPORT_ID_SEQ";
private static final String INSERT_INTO_IMPORT_SOURCES =
"INSERT INTO osee_import_source (import_id, db_source_guid, source_export_date, date_imported) VALUES (?, ?, ?, ?)";
- public CommitImportSavePointsTx(Log logger, OrcsSession session, IOseeDatabaseService dbService) {
- super(logger, session, dbService, "Commit Import Save Points Tx");
+ public CommitImportSavePointsTx(Log logger, OrcsSession session, JdbcClient jdbcClient) {
+ super(logger, session, jdbcClient);
}
- @SuppressWarnings("unchecked")
@Override
- protected Boolean handleTxWork(OseeConnection connection) throws OseeCoreException {
+ protected Boolean handleTxWork(JdbcConnection connection) throws OseeCoreException {
if (manifestHandler != null && translator != null) {
- int importIdIndex = getDatabaseService().getSequence().getNextImportId();
+ int importIdIndex = (int) getJdbcClient().getNextSequence(IMPORT_ID_SEQ);
String sourceDatabaseId = manifestHandler.getSourceDatabaseId();
Timestamp importDate = new Timestamp(new Date().getTime());
Timestamp exportDate = new Timestamp(manifestHandler.getSourceExportDate().getTime());
- getDatabaseService().runPreparedUpdate(connection, INSERT_INTO_IMPORT_SOURCES, importIdIndex,
- sourceDatabaseId, exportDate, importDate);
+ getJdbcClient().runPreparedUpdate(connection, INSERT_INTO_IMPORT_SOURCES, importIdIndex, sourceDatabaseId,
+ exportDate, importDate);
translator.store(connection, importIdIndex);
@@ -334,16 +332,6 @@ public class ImportBranchDatabaseCallable extends AbstractDatastoreCallable<URI>
}
}
- private final class OperationLoggerAdaptor extends OperationLogger {
-
- @Override
- public void log(String... rows) {
- for (String row : rows) {
- getLogger().info(row);
- }
- }
- }
-
private final class ImportBranchesTx extends AbstractDatastoreTxCallable<Object> {
private final SavePointManager savePointManager;
@@ -351,11 +339,11 @@ public class ImportBranchDatabaseCallable extends AbstractDatastoreCallable<URI>
private final IExportItem branchExportItem;
private long[] branchesStored;
- public ImportBranchesTx(Log logger, OrcsSession session, IOseeDatabaseService dbService, SavePointManager savePointManager, IExportItem branchExportItem) {
- super(logger, session, dbService, "Import Branch Tx");
+ public ImportBranchesTx(Log logger, OrcsSession session, JdbcClient jdbcClient, SavePointManager savePointManager, IExportItem branchExportItem) {
+ super(logger, session, jdbcClient);
this.savePointManager = savePointManager;
this.branchExportItem = branchExportItem;
- branchHandler = BranchDataSaxHandler.createWithCacheAll(logger, dbService);
+ branchHandler = BranchDataSaxHandler.createWithCacheAll(logger, jdbcClient);
branchesStored = new long[0];
}
@@ -370,7 +358,7 @@ public class ImportBranchDatabaseCallable extends AbstractDatastoreCallable<URI>
}
@Override
- protected Object handleTxWork(OseeConnection connection) throws OseeCoreException {
+ protected Object handleTxWork(JdbcConnection connection) throws OseeCoreException {
// Import Branches
savePointManager.setCurrentSetPointId(branchExportItem.getSource());
branchHandler.setConnection(connection);
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 4a5f0d5f26..5f3b1ca25a 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
@@ -14,18 +14,17 @@ import java.io.File;
import java.util.LinkedList;
import java.util.List;
import java.util.concurrent.Callable;
-import org.eclipse.osee.database.schema.InitializeSchemaCallable;
-import org.eclipse.osee.database.schema.SchemaOptions;
-import org.eclipse.osee.database.schema.SchemaResourceProvider;
import org.eclipse.osee.framework.core.enums.BranchType;
import org.eclipse.osee.framework.core.enums.CoreBranches;
import org.eclipse.osee.framework.core.enums.PermissionEnum;
import org.eclipse.osee.framework.core.exception.OseeDataStoreException;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.Conditions;
import org.eclipse.osee.framework.jdk.core.util.GUID;
import org.eclipse.osee.framework.jdk.core.util.Lib;
+import org.eclipse.osee.jdbc.JdbcClient;
+import org.eclipse.osee.jdbc.JdbcSchemaOptions;
+import org.eclipse.osee.jdbc.JdbcSchemaResource;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.OrcsSession;
import org.eclipse.osee.orcs.core.SystemPreferences;
@@ -36,6 +35,7 @@ import org.eclipse.osee.orcs.data.CreateBranchData;
import org.eclipse.osee.orcs.db.internal.IdentityManager;
import org.eclipse.osee.orcs.db.internal.resource.ResourceConstants;
import org.eclipse.osee.orcs.db.internal.sql.RelationalConstants;
+import com.google.common.base.Supplier;
/**
* @author Roberto E. Escobar
@@ -46,13 +46,13 @@ public class InitializeDatastoreCallable extends AbstractDatastoreCallable<DataS
"INSERT INTO OSEE_PERMISSION (PERMISSION_ID, PERMISSION_NAME) VALUES (?,?)";
private final SystemPreferences preferences;
- private final SchemaResourceProvider schemaProvider;
- private final SchemaOptions options;
+ private final Supplier<Iterable<JdbcSchemaResource>> schemaProvider;
+ private final JdbcSchemaOptions options;
private final IdentityManager identityService;
private final BranchDataStore branchStore;
- public InitializeDatastoreCallable(OrcsSession session, Log logger, IOseeDatabaseService dbService, IdentityManager identityService, BranchDataStore branchStore, SystemPreferences preferences, SchemaResourceProvider schemaProvider, SchemaOptions options) {
- super(logger, session, dbService);
+ public InitializeDatastoreCallable(OrcsSession session, Log logger, JdbcClient jdbcClient, IdentityManager identityService, BranchDataStore branchStore, SystemPreferences preferences, Supplier<Iterable<JdbcSchemaResource>> schemaProvider, JdbcSchemaOptions options) {
+ super(logger, session, jdbcClient);
this.identityService = identityService;
this.branchStore = branchStore;
this.preferences = preferences;
@@ -62,12 +62,10 @@ public class InitializeDatastoreCallable extends AbstractDatastoreCallable<DataS
@Override
public DataStoreInfo call() throws Exception {
- Conditions.checkExpressionFailOnTrue(getDatabaseService().isProduction(),
+ Conditions.checkExpressionFailOnTrue(getJdbcClient().getConfig().isProduction(),
"Error - attempting to initialize a production datastore.");
- Callable<Object> callable =
- new InitializeSchemaCallable(getLogger(), getDatabaseService(), schemaProvider, options);
- callAndCheckForCancel(callable);
+ getJdbcClient().initSchema(options, schemaProvider.get());
String attributeDataPath = ResourceConstants.getAttributeDataPath(preferences);
getLogger().info("Deleting application server binary data [%s]...", attributeDataPath);
@@ -89,7 +87,7 @@ public class InitializeDatastoreCallable extends AbstractDatastoreCallable<DataS
callAndCheckForCancel(createSystemRoot);
Callable<DataStoreInfo> fetchCallable =
- new FetchDatastoreInfoCallable(getLogger(), getSession(), getDatabaseService(), schemaProvider, preferences);
+ new FetchDatastoreInfoCallable(getLogger(), getSession(), getJdbcClient(), schemaProvider, preferences);
DataStoreInfo dataStoreInfo = callAndCheckForCancel(fetchCallable);
return dataStoreInfo;
@@ -121,6 +119,6 @@ public class InitializeDatastoreCallable extends AbstractDatastoreCallable<DataS
for (PermissionEnum permission : PermissionEnum.values()) {
data.add(new Object[] {permission.getPermId(), permission.getName()});
}
- getDatabaseService().runBatchUpdate(ADD_PERMISSION, data);
+ getJdbcClient().runBatchUpdate(ADD_PERMISSION, data);
}
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/InvalidTxCurrentsAndModTypesCallable.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/InvalidTxCurrentsAndModTypesCallable.java
new file mode 100644
index 0000000000..6c24907d4c
--- /dev/null
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/InvalidTxCurrentsAndModTypesCallable.java
@@ -0,0 +1,205 @@
+/*******************************************************************************
+ * Copyright (c) 2010 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.orcs.db.internal.callable;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.eclipse.osee.framework.core.enums.ModificationType;
+import org.eclipse.osee.framework.core.enums.TransactionDetailsType;
+import org.eclipse.osee.framework.core.enums.TxChange;
+import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.jdbc.JdbcClient;
+import org.eclipse.osee.jdbc.JdbcConnection;
+import org.eclipse.osee.jdbc.JdbcConstants;
+import org.eclipse.osee.jdbc.JdbcStatement;
+import org.eclipse.osee.logger.Log;
+import org.eclipse.osee.orcs.OrcsSession;
+import org.eclipse.osee.orcs.db.internal.util.Address;
+
+/**
+ * @author Ryan D. Brooks
+ */
+public class InvalidTxCurrentsAndModTypesCallable extends AbstractDatastoreTxCallable<Void> {
+ private static final String SELECT_ADDRESSES =
+ "select %s, txs.branch_id, txs.transaction_id, txs.gamma_id, txs.mod_type, txs.tx_current, txd.tx_type from %s t1, osee_txs%s txs, osee_tx_details txd where t1.gamma_id = txs.gamma_id and txd.transaction_id = txs.transaction_id and txs.branch_id = txd.branch_id order by txs.branch_id, %s, txs.transaction_id desc, txs.gamma_id desc";
+
+ private static final String DELETE_ADDRESS =
+ "delete from osee_txs%s where transaction_id = ? and gamma_id = ? and branch_id = ?";
+ private static final String UPDATE_ADDRESS =
+ "update osee_txs%s set tx_current = ? where transaction_id = ? and gamma_id = ? and branch_id = ?";
+
+ private final List<Address> addresses = new ArrayList<Address>();
+
+ private final List<Object[]> purgeData = new ArrayList<Object[]>();
+ private final List<Object[]> currentData = new ArrayList<Object[]>();
+ private final String tableName;
+ private final String columnName;
+ private final boolean isFixOperationEnabled;
+ private final String txsTableName;
+
+ public InvalidTxCurrentsAndModTypesCallable(Log logger, OrcsSession session, JdbcClient jdbcClient, String operationName, String tableName, String columnName, boolean isFixOperationEnabled, boolean archived) {
+ super(logger, session, jdbcClient);
+ this.tableName = tableName;
+ this.columnName = columnName;
+ this.isFixOperationEnabled = isFixOperationEnabled;
+ txsTableName = archived ? "_archived" : "";
+ }
+
+ private void fixIssues() throws OseeCoreException {
+ if (isFixOperationEnabled) {
+ checkForCancelled();
+ getJdbcClient().runBatchUpdate(String.format(DELETE_ADDRESS, txsTableName), purgeData);
+ getJdbcClient().runBatchUpdate(String.format(UPDATE_ADDRESS, txsTableName), currentData);
+ }
+ }
+
+ private void consolidateAddressing() {
+ checkForMultipleVersionsInOneTransaction();
+ checkForIdenticalAddressingInDifferentTransactions();
+ checkForMultipleCurrents();
+ checkForInvalidMergedModType();
+
+ if (issueDetected()) {
+ for (Address address : addresses) {
+ if (address.isPurge()) {
+ logIssue("purged", address);
+
+ purgeData.add(new Object[] {address.getTransactionId(), address.getGammaId(), address.getBranchId()});
+ } else if (address.getCorrectedTxCurrent() != null) {
+ logIssue("corrected txCurrent: " + address.getCorrectedTxCurrent(), address);
+
+ currentData.add(new Object[] {
+ address.getCorrectedTxCurrent().getValue(),
+ address.getTransactionId(),
+ address.getGammaId(),
+ address.getBranchId()});
+ } else {
+ logIssue("would have fixed merge here");
+ }
+ }
+ }
+ }
+
+ private void checkForInvalidMergedModType() {
+ int index = addresses.size() - 1;
+ Address lastAddress = addresses.get(index);
+ if (!lastAddress.isBaselineTx()) {
+ for (; index > -1; index--) {
+ if (!addresses.get(index).isPurge()) {
+ if (addresses.get(index).getModType() == ModificationType.MERGED) {
+ // logIssue("found merged mod type for item not in baseline: ", addresses.get(index));
+ }
+ return;
+ }
+ }
+ }
+ }
+
+ private void checkForIdenticalAddressingInDifferentTransactions() {
+ Address previousAddress = null;
+
+ for (Address address : addresses) {
+ if (address.hasSameGamma(previousAddress) && address.hasSameModType(previousAddress)) {
+ previousAddress.setPurge(true);
+ }
+ previousAddress = address;
+ }
+ }
+
+ private boolean issueDetected() {
+ for (Address address : addresses) {
+ if (address.hasIssue()) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private void checkForMultipleVersionsInOneTransaction() {
+ Address previousAddress = null;
+
+ for (Address address : addresses) {
+ if (address.isSameTransaction(previousAddress)) {
+ if (address.hasSameModType(previousAddress) || !address.getModType().isDeleted() && previousAddress.getModType().isEdited()) {
+ address.setPurge(true);
+ } else {
+ logIssue("multiple versions in one transaction - unknown case", address);
+ }
+ }
+ previousAddress = address;
+ }
+ }
+
+ private void checkForMultipleCurrents() {
+ boolean mostRecentTx = true;
+ for (Address address : addresses) {
+ if (!address.isPurge()) {
+ if (mostRecentTx) {
+ address.ensureCorrectCurrent();
+ mostRecentTx = false;
+ } else {
+ address.ensureNotCurrent();
+ }
+ }
+ }
+ }
+
+ @Override
+ protected Void handleTxWork(JdbcConnection connection) {
+ checkForCancelled();
+
+ JdbcStatement chStmt = getJdbcClient().getStatement();
+ String sql = String.format(SELECT_ADDRESSES, columnName, tableName, txsTableName, columnName);
+ try {
+ chStmt.runPreparedQuery(JdbcConstants.JDBC__MAX_FETCH_SIZE, sql);
+
+ Address previousAddress = null;
+ while (chStmt.next()) {
+ checkForCancelled();
+ ModificationType modType = ModificationType.getMod(chStmt.getInt("mod_type"));
+ TxChange txCurrent = TxChange.getChangeType(chStmt.getInt("tx_current"));
+ TransactionDetailsType type = TransactionDetailsType.toEnum(chStmt.getInt("tx_type"));
+ Address address =
+ new Address(type.isBaseline(), chStmt.getLong("branch_id"), chStmt.getInt(columnName),
+ chStmt.getInt("transaction_id"), chStmt.getLong("gamma_id"), modType, txCurrent);
+
+ if (!address.isSimilar(previousAddress)) {
+ if (!addresses.isEmpty()) {
+ consolidateAddressing();
+ }
+ addresses.clear();
+ }
+
+ addresses.add(address);
+ previousAddress = address;
+ }
+ } finally {
+ chStmt.close();
+ }
+ fixIssues();
+ return null;
+ }
+
+ private void logIssue(String message, Address address) {
+ getLogger().info("msg[%s] - branchId[%s] itemId[%s] txId[%s] gammaId[%s] modType[%s] txCurrent[%s]",//
+ message, //
+ address.getBranchId(), //
+ address.getItemId(),//
+ address.getTransactionId(),//
+ address.getGammaId(),//
+ address.getModType(), //
+ address.getTxCurrent());
+ }
+
+ private void logIssue(String message) {
+ getLogger().info(message);
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/OrcsTypeLoaderCallable.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/OrcsTypeLoaderCallable.java
index 52f04f016f..4be4635227 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/OrcsTypeLoaderCallable.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/OrcsTypeLoaderCallable.java
@@ -21,8 +21,6 @@ import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
import org.eclipse.osee.framework.core.enums.CoreBranches;
import org.eclipse.osee.framework.core.enums.TxChange;
import org.eclipse.osee.framework.core.exception.OseeExceptions;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
-import org.eclipse.osee.framework.database.core.IOseeStatement;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.type.PropertyStore;
import org.eclipse.osee.framework.jdk.core.util.Conditions;
@@ -31,6 +29,8 @@ import org.eclipse.osee.framework.resource.management.IResource;
import org.eclipse.osee.framework.resource.management.IResourceLocator;
import org.eclipse.osee.framework.resource.management.IResourceManager;
import org.eclipse.osee.framework.resource.management.StandardOptions;
+import org.eclipse.osee.jdbc.JdbcClient;
+import org.eclipse.osee.jdbc.JdbcStatement;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.OrcsSession;
@@ -44,8 +44,8 @@ public class OrcsTypeLoaderCallable extends AbstractDatastoreCallable<IResource>
private final IResourceManager resourceManager;
- public OrcsTypeLoaderCallable(Log logger, OrcsSession session, IOseeDatabaseService dbService, IResourceManager resourceManager) {
- super(logger, session, dbService);
+ public OrcsTypeLoaderCallable(Log logger, OrcsSession session, JdbcClient jdbcClient, IResourceManager resourceManager) {
+ super(logger, session, jdbcClient);
this.resourceManager = resourceManager;
}
@@ -65,9 +65,9 @@ public class OrcsTypeLoaderCallable extends AbstractDatastoreCallable<IResource>
Long artifactTypeId = CoreArtifactTypes.OseeTypeDefinition.getGuid();
Long attributeTypeId = CoreAttributeTypes.UriGeneralStringData.getGuid();
- IOseeStatement chStmt = null;
+ JdbcStatement chStmt = null;
try {
- chStmt = getDatabaseService().getStatement();
+ chStmt = getJdbcClient().getStatement();
chStmt.runPreparedQuery(LOAD_OSEE_TYPE_DEF_URIS, CoreBranches.COMMON.getUuid(), TxChange.CURRENT.getValue(),
TxChange.CURRENT.getValue(), artifactTypeId, attributeTypeId);
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/PurgeArtifactTypeDatabaseTxCallable.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/PurgeArtifactTypeDatabaseTxCallable.java
index 67a06709e9..f1e96f73ce 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/PurgeArtifactTypeDatabaseTxCallable.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/PurgeArtifactTypeDatabaseTxCallable.java
@@ -12,8 +12,8 @@ package org.eclipse.osee.orcs.db.internal.callable;
import java.util.Collection;
import org.eclipse.osee.framework.core.data.IArtifactType;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
-import org.eclipse.osee.framework.database.core.OseeConnection;
+import org.eclipse.osee.jdbc.JdbcClient;
+import org.eclipse.osee.jdbc.JdbcConnection;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.OrcsSession;
@@ -24,13 +24,13 @@ public final class PurgeArtifactTypeDatabaseTxCallable extends AbstractDatastore
@SuppressWarnings("unused")
private final Collection<? extends IArtifactType> typesToPurge;
- public PurgeArtifactTypeDatabaseTxCallable(Log logger, OrcsSession session, IOseeDatabaseService databaseService, Collection<? extends IArtifactType> typesToPurge) {
- super(logger, session, databaseService, "Purge Artifact Type");
+ public PurgeArtifactTypeDatabaseTxCallable(Log logger, OrcsSession session, JdbcClient jdbcClient, Collection<? extends IArtifactType> typesToPurge) {
+ super(logger, session, jdbcClient);
this.typesToPurge = typesToPurge;
}
@Override
- protected Void handleTxWork(OseeConnection connection) {
+ protected Void handleTxWork(JdbcConnection connection) {
throw new UnsupportedOperationException("operation is not currently supported");
}
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/PurgeAttributeTypeDatabaseTxCallable.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/PurgeAttributeTypeDatabaseTxCallable.java
index 6d76ed5e27..f794c0f4d0 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/PurgeAttributeTypeDatabaseTxCallable.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/PurgeAttributeTypeDatabaseTxCallable.java
@@ -14,10 +14,10 @@ import java.util.Collection;
import java.util.LinkedList;
import java.util.List;
import org.eclipse.osee.framework.core.data.IAttributeType;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
-import org.eclipse.osee.framework.database.core.IOseeStatement;
-import org.eclipse.osee.framework.database.core.OseeConnection;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.jdbc.JdbcClient;
+import org.eclipse.osee.jdbc.JdbcConnection;
+import org.eclipse.osee.jdbc.JdbcStatement;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.OrcsSession;
import org.eclipse.osee.orcs.db.internal.sql.join.IdJoinQuery;
@@ -49,23 +49,23 @@ public final class PurgeAttributeTypeDatabaseTxCallable extends AbstractDatastor
private final Collection<? extends IAttributeType> typesToPurge;
private final SqlJoinFactory joinFactory;
- public PurgeAttributeTypeDatabaseTxCallable(Log logger, OrcsSession session, IOseeDatabaseService databaseService, SqlJoinFactory joinFactory, Collection<? extends IAttributeType> typesToPurge) {
- super(logger, session, databaseService, "Purge Attribute Type");
+ public PurgeAttributeTypeDatabaseTxCallable(Log logger, OrcsSession session, JdbcClient jdbcClient, SqlJoinFactory joinFactory, Collection<? extends IAttributeType> typesToPurge) {
+ super(logger, session, jdbcClient);
this.joinFactory = joinFactory;
this.typesToPurge = typesToPurge;
}
@Override
- protected Void handleTxWork(OseeConnection connection) throws OseeCoreException {
- List<Long[]> gammasAndBranchIds = retrieveBranchAndGammaIds(connection, typesToPurge);
- List<Integer[]> gammas = retrieveGammaIds(connection, typesToPurge);
+ protected Void handleTxWork(JdbcConnection connection) throws OseeCoreException {
+ List<Object[]> gammasAndBranchIds = retrieveBranchAndGammaIds(connection, typesToPurge);
+ List<Object[]> gammas = retrieveGammaIds(connection, typesToPurge);
processDeletes(connection, gammasAndBranchIds, gammas);
return null;
}
- private List<Integer[]> retrieveGammaIds(OseeConnection connection, Collection<? extends IAttributeType> types) throws OseeCoreException {
- List<Integer[]> gammas = new LinkedList<Integer[]>();
- IOseeStatement chStmt = getDatabaseService().getStatement(connection);
+ private List<Object[]> retrieveGammaIds(JdbcConnection connection, Collection<? extends IAttributeType> types) throws OseeCoreException {
+ List<Object[]> gammas = new LinkedList<Object[]>();
+ JdbcStatement chStmt = getJdbcClient().getStatement(connection);
IdJoinQuery joinQuery = joinFactory.createIdJoinQuery();
try {
if (types.size() == 1) {
@@ -87,9 +87,9 @@ public final class PurgeAttributeTypeDatabaseTxCallable extends AbstractDatastor
return gammas;
}
- private List<Long[]> retrieveBranchAndGammaIds(OseeConnection connection, Collection<? extends IAttributeType> types) throws OseeCoreException {
- List<Long[]> gammasAndBranchIds = new LinkedList<Long[]>();
- IOseeStatement chStmt = getDatabaseService().getStatement(connection);
+ private List<Object[]> retrieveBranchAndGammaIds(JdbcConnection connection, Collection<? extends IAttributeType> types) throws OseeCoreException {
+ List<Object[]> gammasAndBranchIds = new LinkedList<Object[]>();
+ JdbcStatement chStmt = getJdbcClient().getStatement(connection);
IdJoinQuery joinQuery = joinFactory.createIdJoinQuery();
try {
if (types.size() == 1) {
@@ -110,14 +110,14 @@ public final class PurgeAttributeTypeDatabaseTxCallable extends AbstractDatastor
return gammasAndBranchIds;
}
- private void processDeletes(OseeConnection connection, List<Long[]> gammasAndBranchIds, List<Integer[]> gammas) throws OseeCoreException {
- getDatabaseService().runBatchUpdate(connection, String.format(DELETE_BY_GAMMAS_AND_BRANCH, "osee_txs"),
+ private void processDeletes(JdbcConnection connection, List<Object[]> gammasAndBranchIds, List<Object[]> gammas) throws OseeCoreException {
+ getJdbcClient().runBatchUpdate(connection, String.format(DELETE_BY_GAMMAS_AND_BRANCH, "osee_txs"),
gammasAndBranchIds);
- getDatabaseService().runBatchUpdate(connection, String.format(DELETE_BY_GAMMAS_AND_BRANCH, "osee_txs_archived"),
+ getJdbcClient().runBatchUpdate(connection, String.format(DELETE_BY_GAMMAS_AND_BRANCH, "osee_txs_archived"),
gammasAndBranchIds);
- getDatabaseService().runBatchUpdate(connection, DELETE_BY_GAMMAS, gammas);
- getDatabaseService().runBatchUpdate(connection, DELETE_FROM_CONFLICT_TABLE_SOURCE_SIDE, gammas);
- getDatabaseService().runBatchUpdate(connection, DELETE_FROM_CONFLICT_TABLE_DEST_SIDE, gammas);
+ getJdbcClient().runBatchUpdate(connection, DELETE_BY_GAMMAS, gammas);
+ getJdbcClient().runBatchUpdate(connection, DELETE_FROM_CONFLICT_TABLE_SOURCE_SIDE, gammas);
+ getJdbcClient().runBatchUpdate(connection, DELETE_FROM_CONFLICT_TABLE_DEST_SIDE, gammas);
}
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/PurgeBranchDatabaseCallable.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/PurgeBranchDatabaseCallable.java
index d4b4102dd1..194190139c 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/PurgeBranchDatabaseCallable.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/PurgeBranchDatabaseCallable.java
@@ -13,11 +13,11 @@ package org.eclipse.osee.orcs.db.internal.callable;
import java.util.LinkedList;
import java.util.List;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
-import org.eclipse.osee.framework.database.core.IOseeStatement;
-import org.eclipse.osee.framework.database.core.OseeConnection;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.type.Pair;
+import org.eclipse.osee.jdbc.JdbcClient;
+import org.eclipse.osee.jdbc.JdbcConnection;
+import org.eclipse.osee.jdbc.JdbcStatement;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.OrcsSession;
import org.eclipse.osee.orcs.data.BranchReadable;
@@ -39,14 +39,13 @@ public class PurgeBranchDatabaseCallable extends AbstractDatastoreTxCallable<Voi
private final BranchReadable toDelete;
- public PurgeBranchDatabaseCallable(Log logger, OrcsSession session, IOseeDatabaseService databaseService, BranchReadable toDelete) {
- super(logger, session, databaseService, String.format("Purge Branch: [(%s)-%s]", toDelete.getUuid(),
- toDelete.getName()));
+ public PurgeBranchDatabaseCallable(Log logger, OrcsSession session, JdbcClient jdbcClient, BranchReadable toDelete) {
+ super(logger, session, jdbcClient);
this.toDelete = toDelete;
}
@Override
- protected Void handleTxWork(OseeConnection connection) throws OseeCoreException {
+ protected Void handleTxWork(JdbcConnection connection) throws OseeCoreException {
List<Pair<Long, Boolean>> branches = findMergeBranches(connection);
branches.add(new Pair<Long, Boolean>(toDelete.getUuid(), toDelete.getArchiveState().isArchived()));
for (Pair<Long, Boolean> toPurge : branches) {
@@ -55,7 +54,7 @@ public class PurgeBranchDatabaseCallable extends AbstractDatastoreTxCallable<Voi
return null;
}
- private void purgeBranch(OseeConnection connection, Long branchUuid, boolean isArchived) {
+ private void purgeBranch(JdbcConnection connection, Long branchUuid, boolean isArchived) {
String sourceTableName = isArchived ? "osee_txs_archived" : "osee_txs";
String sql = String.format("DELETE FROM %s WHERE branch_id = ?", sourceTableName);
purgeFromTable(connection, sql, 0.20, branchUuid);
@@ -67,9 +66,9 @@ public class PurgeBranchDatabaseCallable extends AbstractDatastoreTxCallable<Voi
purgeFromTable(connection, DELETE_ARTIFACT_ACL_FROM_BRANCH, 0.01, branchUuid);
}
- private List<Pair<Long, Boolean>> findMergeBranches(OseeConnection connection) {
+ private List<Pair<Long, Boolean>> findMergeBranches(JdbcConnection connection) {
List<Pair<Long, Boolean>> toReturn = new LinkedList<Pair<Long, Boolean>>();
- IOseeStatement stmt = getDatabaseService().getStatement(connection);
+ JdbcStatement stmt = getJdbcClient().getStatement(connection);
stmt.runPreparedQuery(SELECT_MERGE_BRANCHES, toDelete.getUuid(), toDelete.getUuid());
while (stmt.next()) {
Pair<Long, Boolean> toAdd =
@@ -79,9 +78,9 @@ public class PurgeBranchDatabaseCallable extends AbstractDatastoreTxCallable<Voi
return toReturn;
}
- private void purgeFromTable(OseeConnection connection, String sql, double percentage, Object... data) throws OseeCoreException {
+ private void purgeFromTable(JdbcConnection connection, String sql, double percentage, Object... data) throws OseeCoreException {
checkForCancelled();
- getDatabaseService().runPreparedUpdate(connection, sql, data);
+ getJdbcClient().runPreparedUpdate(connection, sql, data);
}
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/PurgeRelationTypeDatabaseTxCallable.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/PurgeRelationTypeDatabaseTxCallable.java
index 3ac05c6d3d..f917bc288f 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/PurgeRelationTypeDatabaseTxCallable.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/PurgeRelationTypeDatabaseTxCallable.java
@@ -14,10 +14,10 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import org.eclipse.osee.framework.core.data.IRelationType;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
-import org.eclipse.osee.framework.database.core.IOseeStatement;
-import org.eclipse.osee.framework.database.core.OseeConnection;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.jdbc.JdbcClient;
+import org.eclipse.osee.jdbc.JdbcConnection;
+import org.eclipse.osee.jdbc.JdbcStatement;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.OrcsSession;
@@ -45,21 +45,21 @@ public final class PurgeRelationTypeDatabaseTxCallable extends AbstractDatastore
private final Collection<? extends IRelationType> typesToPurge;
- public PurgeRelationTypeDatabaseTxCallable(Log logger, OrcsSession session, IOseeDatabaseService databaseService, Collection<? extends IRelationType> typesToPurge) {
- super(logger, session, databaseService, "Purge Relation Type");
+ public PurgeRelationTypeDatabaseTxCallable(Log logger, OrcsSession session, JdbcClient jdbcClient, Collection<? extends IRelationType> typesToPurge) {
+ super(logger, session, jdbcClient);
this.typesToPurge = typesToPurge;
}
@Override
- protected Void handleTxWork(OseeConnection connection) throws OseeCoreException {
- List<Integer[]> gammaIds = retrieveGammaIds(connection, typesToPurge);
+ protected Void handleTxWork(JdbcConnection connection) throws OseeCoreException {
+ List<Object[]> gammaIds = retrieveGammaIds(connection, typesToPurge);
processDeletes(connection, gammaIds);
return null;
}
- private List<Integer[]> retrieveGammaIds(OseeConnection connection, Collection<? extends IRelationType> types) throws OseeCoreException {
- List<Integer[]> gammas = new ArrayList<Integer[]>(50000);
- IOseeStatement chStmt = getDatabaseService().getStatement(connection);
+ private List<Object[]> retrieveGammaIds(JdbcConnection connection, Collection<? extends IRelationType> types) throws OseeCoreException {
+ List<Object[]> gammas = new ArrayList<Object[]>(50000);
+ JdbcStatement chStmt = getJdbcClient().getStatement(connection);
try {
for (IRelationType type : types) {
chStmt.runPreparedQuery(RETRIEVE_GAMMAS_OF_REL_LINK_TXS, type.getGuid());
@@ -74,11 +74,11 @@ public final class PurgeRelationTypeDatabaseTxCallable extends AbstractDatastore
return gammas;
}
- private void processDeletes(OseeConnection connection, List<Integer[]> gammas) throws OseeCoreException {
- getDatabaseService().runBatchUpdate(connection, String.format(DELETE_BY_GAMMAS, "osee_txs"), gammas);
- getDatabaseService().runBatchUpdate(connection, String.format(DELETE_BY_GAMMAS, "osee_txs_archived"), gammas);
- getDatabaseService().runBatchUpdate(connection, String.format(DELETE_BY_GAMMAS, "osee_relation_link"), gammas);
- getDatabaseService().runBatchUpdate(connection, String.format(DELETE_FROM_CONFLICT_TABLE_SOURCE_SIDE), gammas);
- getDatabaseService().runBatchUpdate(connection, String.format(DELETE_FROM_CONFLICT_TABLE_DEST_SIDE), gammas);
+ private void processDeletes(JdbcConnection connection, List<Object[]> gammas) throws OseeCoreException {
+ getJdbcClient().runBatchUpdate(connection, String.format(DELETE_BY_GAMMAS, "osee_txs"), gammas);
+ getJdbcClient().runBatchUpdate(connection, String.format(DELETE_BY_GAMMAS, "osee_txs_archived"), gammas);
+ getJdbcClient().runBatchUpdate(connection, String.format(DELETE_BY_GAMMAS, "osee_relation_link"), gammas);
+ getJdbcClient().runBatchUpdate(connection, String.format(DELETE_FROM_CONFLICT_TABLE_SOURCE_SIDE), gammas);
+ getJdbcClient().runBatchUpdate(connection, String.format(DELETE_FROM_CONFLICT_TABLE_DEST_SIDE), gammas);
}
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/PurgeTransactionTxCallable.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/PurgeTransactionTxCallable.java
index bbb2995a5b..d66cfb3fd6 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/PurgeTransactionTxCallable.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/PurgeTransactionTxCallable.java
@@ -11,7 +11,6 @@
package org.eclipse.osee.orcs.db.internal.callable;
-import static org.eclipse.osee.framework.database.core.IOseeStatement.MAX_FETCH;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
@@ -23,11 +22,12 @@ import java.util.Map.Entry;
import org.eclipse.osee.framework.core.data.ITransaction;
import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.core.enums.TxChange;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
-import org.eclipse.osee.framework.database.core.IOseeStatement;
-import org.eclipse.osee.framework.database.core.OseeConnection;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.Conditions;
+import org.eclipse.osee.jdbc.JdbcClient;
+import org.eclipse.osee.jdbc.JdbcConnection;
+import org.eclipse.osee.jdbc.JdbcConstants;
+import org.eclipse.osee.jdbc.JdbcStatement;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.OrcsSession;
import org.eclipse.osee.orcs.db.internal.sql.RelationalConstants;
@@ -64,8 +64,8 @@ public class PurgeTransactionTxCallable extends AbstractDatastoreTxCallable<Inte
private final SqlJoinFactory joinFactory;
private final Collection<? extends ITransaction> txIdsToDelete;
- public PurgeTransactionTxCallable(Log logger, OrcsSession session, IOseeDatabaseService databaseService, SqlJoinFactory joinFactory, Collection<? extends ITransaction> txIdsToDelete) {
- super(logger, session, databaseService, "Purge transactions");
+ public PurgeTransactionTxCallable(Log logger, OrcsSession session, JdbcClient jdbcClient, SqlJoinFactory joinFactory, Collection<? extends ITransaction> txIdsToDelete) {
+ super(logger, session, jdbcClient);
this.joinFactory = joinFactory;
this.txIdsToDelete = txIdsToDelete;
}
@@ -85,7 +85,7 @@ public class PurgeTransactionTxCallable extends AbstractDatastoreTxCallable<Inte
}
@Override
- protected Integer handleTxWork(OseeConnection connection) throws OseeCoreException {
+ protected Integer handleTxWork(JdbcConnection connection) throws OseeCoreException {
Conditions.checkNotNull(txIdsToDelete, "transaction ids to delete");
Conditions.checkExpressionFailOnTrue(txIdsToDelete.isEmpty(), "transaction ids to delete cannot be empty");
@@ -98,7 +98,7 @@ public class PurgeTransactionTxCallable extends AbstractDatastoreTxCallable<Inte
List<Object[]> txsToDelete = new ArrayList<Object[]>();
long txBranchId =
- getDatabaseService().runPreparedQueryFetchObject(RelationalConstants.BRANCH_SENTINEL,
+ getJdbcClient().runPreparedQueryFetchObject(RelationalConstants.BRANCH_SENTINEL,
SELECT_TRANSACTION_BRANCH_ID, txIdToDelete);
Conditions.checkExpressionFailOnTrue(RelationalConstants.BRANCH_SENTINEL == txBranchId,
@@ -106,7 +106,7 @@ public class PurgeTransactionTxCallable extends AbstractDatastoreTxCallable<Inte
txsToDelete.add(new Object[] {txBranchId, txIdToDelete});
int previousTransactionId =
- getDatabaseService().runPreparedQueryFetchObject(RelationalConstants.TRANSACTION_SENTINEL,
+ getJdbcClient().runPreparedQueryFetchObject(RelationalConstants.TRANSACTION_SENTINEL,
GET_PRIOR_TRANSACTION, txBranchId, txIdToDelete);
Conditions.checkExpressionFailOnTrue(
@@ -124,31 +124,31 @@ public class PurgeTransactionTxCallable extends AbstractDatastoreTxCallable<Inte
setChildBranchBaselineTxs(connection, txIdToDelete, previousTransactionId);
//Remove txs Rows
- getDatabaseService().runBatchUpdate(connection, DELETE_TX_DETAILS, txsToDelete);
- getDatabaseService().runBatchUpdate(connection, DELETE_TXS, txsToDelete);
+ getJdbcClient().runBatchUpdate(connection, DELETE_TX_DETAILS, txsToDelete);
+ getJdbcClient().runBatchUpdate(connection, DELETE_TXS, txsToDelete);
//Updating Previous txs to Current
List<Object[]> updateData = new ArrayList<Object[]>();
computeNewTxCurrents(connection, updateData, "art_id", "osee_artifact", arts);
computeNewTxCurrents(connection, updateData, "attr_id", "osee_attribute", attrs);
computeNewTxCurrents(connection, updateData, "rel_link_id", "osee_relation_link", rels);
- getDatabaseService().runBatchUpdate(connection, UPDATE_TX_CURRENT, updateData);
+ getJdbcClient().runBatchUpdate(connection, UPDATE_TX_CURRENT, updateData);
purgeCount++;
getLogger().info("Transaction: [%s] - purged", txIdToDelete);
}
return purgeCount;
}
- private void computeNewTxCurrents(OseeConnection connection, Collection<Object[]> updateData, String itemId, String tableName, Map<Integer, IdJoinQuery> affected) throws OseeCoreException {
+ private void computeNewTxCurrents(JdbcConnection connection, Collection<Object[]> updateData, String itemId, String tableName, Map<Integer, IdJoinQuery> affected) throws OseeCoreException {
String query = String.format(FIND_NEW_TX_CURRENTS, tableName, itemId);
for (Entry<Integer, IdJoinQuery> entry : affected.entrySet()) {
Integer branchUuid = entry.getKey();
IdJoinQuery joinQuery = entry.getValue();
try {
- IOseeStatement statement = getDatabaseService().getStatement(connection);
+ JdbcStatement statement = getJdbcClient().getStatement(connection);
try {
- statement.runPreparedQuery(MAX_FETCH, query, joinQuery.getQueryId(), branchUuid);
+ statement.runPreparedQuery(JdbcConstants.JDBC__MAX_FETCH_SIZE, query, joinQuery.getQueryId(), branchUuid);
int previousItem = -1;
while (statement.next()) {
int currentItem = statement.getInt("item_id");
@@ -173,15 +173,15 @@ public class PurgeTransactionTxCallable extends AbstractDatastoreTxCallable<Inte
}
}
- private Map<Integer, IdJoinQuery> findAffectedItems(OseeConnection connection, String itemId, String itemTable, List<Object[]> bindDataList) throws OseeCoreException {
+ private Map<Integer, IdJoinQuery> findAffectedItems(JdbcConnection connection, String itemId, String itemTable, List<Object[]> bindDataList) throws OseeCoreException {
Map<Integer, IdJoinQuery> items = new HashMap<Integer, IdJoinQuery>();
- IOseeStatement statement = getDatabaseService().getStatement(connection);
+ JdbcStatement statement = getJdbcClient().getStatement(connection);
try {
for (Object[] bindData : bindDataList) {
Integer branchUuid = (Integer) bindData[0];
String query = String.format(SELECT_AFFECTED_ITEMS, itemId, itemTable);
- statement.runPreparedQuery(MAX_FETCH, query, bindData);
+ statement.runPreparedQuery(JdbcConstants.JDBC__MAX_FETCH_SIZE, query, bindData);
IdJoinQuery joinId = joinFactory.createIdJoinQuery();
items.put(branchUuid, joinId);
@@ -198,7 +198,7 @@ public class PurgeTransactionTxCallable extends AbstractDatastoreTxCallable<Inte
return items;
}
- private void setChildBranchBaselineTxs(OseeConnection connection, int toDeleteTransactionId, int previousTransactionId) throws OseeCoreException {
+ private void setChildBranchBaselineTxs(JdbcConnection connection, int toDeleteTransactionId, int previousTransactionId) throws OseeCoreException {
List<Object[]> data = new ArrayList<Object[]>();
if (RelationalConstants.TRANSACTION_SENTINEL != previousTransactionId) {
data.add(new Object[] {
@@ -207,7 +207,7 @@ public class PurgeTransactionTxCallable extends AbstractDatastoreTxCallable<Inte
"%" + toDeleteTransactionId});
}
if (!data.isEmpty()) {
- getDatabaseService().runBatchUpdate(connection, UPDATE_TXS_DETAILS_COMMENT, data);
+ getJdbcClient().runBatchUpdate(connection, UPDATE_TXS_DETAILS_COMMENT, data);
}
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/PurgeUnusedBackingDataAndTransactions.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/PurgeUnusedBackingDataAndTransactions.java
new file mode 100644
index 0000000000..593d304737
--- /dev/null
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/callable/PurgeUnusedBackingDataAndTransactions.java
@@ -0,0 +1,118 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.orcs.db.internal.callable;
+
+import java.util.LinkedList;
+import java.util.List;
+import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.jdbc.JdbcClient;
+import org.eclipse.osee.jdbc.JdbcConnection;
+import org.eclipse.osee.jdbc.JdbcStatement;
+import org.eclipse.osee.logger.Log;
+import org.eclipse.osee.orcs.OrcsSession;
+
+/**
+ * Purge artifact, attribute, and relation versions that are not addressed or nonexistent and purge empty transactions
+ *
+ * @author Ryan D. Brooks
+ */
+public class PurgeUnusedBackingDataAndTransactions extends AbstractDatastoreTxCallable<Void> {
+
+ private static final String NOT_ADDRESSESED_GAMMAS =
+ "select gamma_id from %s t1 where not exists (select 1 from osee_txs txs1 where t1.gamma_id = txs1.gamma_id) and not exists (select 1 from osee_txs_archived txs3 where t1.gamma_id = txs3.gamma_id)";
+
+ private static final String EMPTY_TRANSACTIONS =
+ "select branch_id, transaction_id from osee_tx_details txd where not exists (select 1 from osee_txs txs1 where txs1.branch_id = txd.branch_id and txs1.transaction_id = txd.transaction_id) and not exists (select 1 from osee_txs_archived txs2 where txs2.branch_id = txd.branch_id and txs2.transaction_id = txd.transaction_id)";
+
+ private static final String NONEXISTENT_GAMMAS = "SELECT gamma_id FROM %s txs WHERE " + //
+ "NOT EXISTS (SELECT 1 FROM osee_attribute att WHERE txs.gamma_id = att.gamma_id) " + //
+ "AND NOT EXISTS (SELECT 1 FROM osee_artifact art WHERE txs.gamma_id = art.gamma_id) " + //
+ "AND NOT EXISTS (SELECT 1 FROM osee_relation_link rel WHERE txs.gamma_id = rel.gamma_id)";
+
+ private static final String DELETE_GAMMAS = "DELETE FROM %s WHERE gamma_id = ?";
+ private static final String DELETE_EMPTY_TRANSACTIONS =
+ "DELETE FROM osee_tx_details WHERE branch_id = ? and transaction_id = ?";
+
+ public PurgeUnusedBackingDataAndTransactions(Log logger, OrcsSession session, JdbcClient jdbcClient) {
+ super(logger, session, jdbcClient);
+ }
+
+ private void processNotAddressedGammas(JdbcConnection connection, String tableName) throws OseeCoreException {
+ List<Object[]> notAddressedGammas = new LinkedList<Object[]>();
+
+ JdbcStatement chStmt = getJdbcClient().getStatement(connection);
+ try {
+ String sql = String.format(NOT_ADDRESSESED_GAMMAS, tableName);
+ chStmt.runPreparedQuery(sql);
+ while (chStmt.next()) {
+ notAddressedGammas.add(new Object[] {chStmt.getLong("gamma_id")});
+ getLogger().info("Not Addressed Gamma - [%s]", chStmt.getLong("gamma_id"));
+ }
+ } finally {
+ chStmt.close();
+ }
+
+ if (!notAddressedGammas.isEmpty()) {
+ getJdbcClient().runBatchUpdate(connection, String.format(DELETE_GAMMAS, tableName), notAddressedGammas);
+ }
+ }
+
+ private void processAddressedButNonexistentGammas(JdbcConnection connection, String tableName) throws OseeCoreException {
+ List<Object[]> nonexistentGammas = new LinkedList<Object[]>();
+
+ JdbcStatement chStmt = getJdbcClient().getStatement(connection);
+ try {
+ String sql = String.format(NONEXISTENT_GAMMAS, tableName);
+
+ chStmt.runPreparedQuery(sql);
+ while (chStmt.next()) {
+ nonexistentGammas.add(new Object[] {chStmt.getInt("gamma_id")});
+ getLogger().info("Non-Existent Gamma - [%s]", chStmt.getLong("gamma_id"));
+ }
+ } finally {
+ chStmt.close();
+ }
+
+ if (!nonexistentGammas.isEmpty()) {
+ getJdbcClient().runBatchUpdate(connection, String.format(DELETE_GAMMAS, tableName), nonexistentGammas);
+ }
+ }
+
+ private void processEmptyTransactions(JdbcConnection connection) throws OseeCoreException {
+ List<Object[]> emptyTransactions = new LinkedList<Object[]>();
+
+ JdbcStatement chStmt = getJdbcClient().getStatement(connection);
+ try {
+ chStmt.runPreparedQuery(EMPTY_TRANSACTIONS);
+ while (chStmt.next()) {
+ emptyTransactions.add(new Object[] {chStmt.getLong("branch_id"), chStmt.getInt("transaction_id")});
+ getLogger().info("Empty Tx - [%s]", chStmt.getInt("transaction_id"));
+ }
+ } finally {
+ chStmt.close();
+ }
+
+ if (!emptyTransactions.isEmpty()) {
+ getJdbcClient().runBatchUpdate(connection, DELETE_EMPTY_TRANSACTIONS, emptyTransactions);
+ }
+ }
+
+ @Override
+ protected Void handleTxWork(JdbcConnection connection) throws OseeCoreException {
+ processNotAddressedGammas(connection, "osee_attribute");
+ processNotAddressedGammas(connection, "osee_artifact");
+ processNotAddressedGammas(connection, "osee_relation_link");
+ processAddressedButNonexistentGammas(connection, "osee_txs");
+ processAddressedButNonexistentGammas(connection, "osee_txs_archived");
+ processEmptyTransactions(connection);
+ return null;
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/change/ArtifactChangeItemFactory.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/change/ArtifactChangeItemFactory.java
index 26c3834314..26991785cd 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/change/ArtifactChangeItemFactory.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/change/ArtifactChangeItemFactory.java
@@ -14,8 +14,8 @@ import java.util.HashMap;
import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.core.model.change.ArtifactChangeItem;
import org.eclipse.osee.framework.core.model.change.ChangeItem;
-import org.eclipse.osee.framework.database.core.IOseeStatement;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.jdbc.JdbcStatement;
import org.eclipse.osee.orcs.db.internal.change.ChangeItemLoader.ChangeItemFactory;
public final class ArtifactChangeItemFactory implements ChangeItemFactory {
@@ -35,7 +35,7 @@ public final class ArtifactChangeItemFactory implements ChangeItemFactory {
}
@Override
- public ChangeItem createItem(IOseeStatement chStmt) throws OseeCoreException {
+ public ChangeItem createItem(JdbcStatement chStmt) throws OseeCoreException {
int artId = chStmt.getInt("art_id");
long artTypeId = chStmt.getLong("art_type_id");
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/change/AttributeChangeItemFactory.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/change/AttributeChangeItemFactory.java
index 143d5c5369..f3d162d378 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/change/AttributeChangeItemFactory.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/change/AttributeChangeItemFactory.java
@@ -14,8 +14,8 @@ import java.util.HashMap;
import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.core.model.change.AttributeChangeItem;
import org.eclipse.osee.framework.core.model.change.ChangeItem;
-import org.eclipse.osee.framework.database.core.IOseeStatement;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.jdbc.JdbcStatement;
import org.eclipse.osee.orcs.db.internal.change.ChangeItemLoader.ChangeItemFactory;
public final class AttributeChangeItemFactory implements ChangeItemFactory {
@@ -35,7 +35,7 @@ public final class AttributeChangeItemFactory implements ChangeItemFactory {
}
@Override
- public ChangeItem createItem(IOseeStatement chStmt) throws OseeCoreException {
+ public ChangeItem createItem(JdbcStatement chStmt) throws OseeCoreException {
int attrId = chStmt.getInt("attr_id");
long attrTypeId = chStmt.getLong("attr_type_id");
int artId = chStmt.getInt("art_id");
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/change/ChangeItemLoader.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/change/ChangeItemLoader.java
index a0cb596911..95507d56c9 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/change/ChangeItemLoader.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/change/ChangeItemLoader.java
@@ -10,13 +10,13 @@
*******************************************************************************/
package org.eclipse.osee.orcs.db.internal.change;
-import static org.eclipse.osee.framework.database.core.IOseeStatement.MAX_FETCH;
import java.util.HashMap;
import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.core.model.change.ChangeItem;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
-import org.eclipse.osee.framework.database.core.IOseeStatement;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.jdbc.JdbcClient;
+import org.eclipse.osee.jdbc.JdbcConstants;
+import org.eclipse.osee.jdbc.JdbcStatement;
import org.eclipse.osee.orcs.db.internal.sql.join.IdJoinQuery;
/**
@@ -24,7 +24,7 @@ import org.eclipse.osee.orcs.db.internal.sql.join.IdJoinQuery;
*/
public class ChangeItemLoader {
- private final IOseeDatabaseService dbService;
+ private final JdbcClient jdbcClient;
private final HashMap<Long, ModificationType> changeByGammaId;
public static interface ChangeItemFactory {
@@ -37,11 +37,11 @@ public class ChangeItemLoader {
String getLoadByGammaQuery();
- ChangeItem createItem(IOseeStatement statement) throws OseeCoreException;
+ ChangeItem createItem(JdbcStatement statement) throws OseeCoreException;
}
- public ChangeItemLoader(IOseeDatabaseService dbService, HashMap<Long, ModificationType> changeByGammaId) {
- this.dbService = dbService;
+ public ChangeItemLoader(JdbcClient jdbcClient, HashMap<Long, ModificationType> changeByGammaId) {
+ this.jdbcClient = jdbcClient;
this.changeByGammaId = changeByGammaId;
}
@@ -58,9 +58,9 @@ public class ChangeItemLoader {
}
public void loadItemIdsBasedOnGammas(ChangeItemFactory factory, int queryId, HashMap<Integer, ChangeItem> changesByItemId, IdJoinQuery idJoin) throws OseeCoreException {
- IOseeStatement chStmt = dbService.getStatement();
+ JdbcStatement chStmt = jdbcClient.getStatement();
try {
- chStmt.runPreparedQuery(MAX_FETCH, factory.getLoadByGammaQuery(), queryId);
+ chStmt.runPreparedQuery(JdbcConstants.JDBC__MAX_FETCH_SIZE, factory.getLoadByGammaQuery(), queryId);
while (chStmt.next()) {
ChangeItem item = factory.createItem(chStmt);
Integer itemId = item.getItemId();
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/change/LoadDeltasBetweenBranches.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/change/LoadDeltasBetweenBranches.java
index 0599e8d0f2..95fcc3ed3c 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/change/LoadDeltasBetweenBranches.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/change/LoadDeltasBetweenBranches.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.osee.orcs.db.internal.change;
-import static org.eclipse.osee.framework.database.core.IOseeStatement.MAX_FETCH;
import java.util.Collection;
import java.util.HashMap;
import java.util.LinkedList;
@@ -19,10 +18,11 @@ import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.core.enums.TxChange;
import org.eclipse.osee.framework.core.model.change.ChangeItem;
import org.eclipse.osee.framework.core.model.change.ChangeVersion;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
-import org.eclipse.osee.framework.database.core.IOseeStatement;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.Conditions;
+import org.eclipse.osee.jdbc.JdbcClient;
+import org.eclipse.osee.jdbc.JdbcConstants;
+import org.eclipse.osee.jdbc.JdbcStatement;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.OrcsSession;
import org.eclipse.osee.orcs.db.internal.callable.AbstractDatastoreCallable;
@@ -53,15 +53,15 @@ public class LoadDeltasBetweenBranches extends AbstractDatastoreCallable<List<Ch
private final ChangeItemLoader changeItemLoader;
private final SqlJoinFactory joinFactory;
- public LoadDeltasBetweenBranches(Log logger, OrcsSession session, IOseeDatabaseService dbService, SqlJoinFactory joinFactory, Long sourceBranchId, Long destinationBranchId, Integer destinationHeadTxId, Long mergeBranchId, Integer mergeTxId) {
- super(logger, session, dbService);
+ public LoadDeltasBetweenBranches(Log logger, OrcsSession session, JdbcClient jdbcClient, SqlJoinFactory joinFactory, Long sourceBranchId, Long destinationBranchId, Integer destinationHeadTxId, Long mergeBranchId, Integer mergeTxId) {
+ super(logger, session, jdbcClient);
this.joinFactory = joinFactory;
this.sourceBranchId = sourceBranchId;
this.destinationBranchId = destinationBranchId;
this.destinationHeadTxId = destinationHeadTxId;
this.mergeBranchId = mergeBranchId;
this.mergeTxId = mergeTxId;
- this.changeItemLoader = new ChangeItemLoader(dbService, changeByGammaId);
+ this.changeItemLoader = new ChangeItemLoader(jdbcClient, changeByGammaId);
}
private boolean hasMergeBranch() {
@@ -100,9 +100,9 @@ public class LoadDeltasBetweenBranches extends AbstractDatastoreCallable<List<Ch
}
private void loadSourceBranchChanges(TransactionJoinQuery txJoin, int sourceBaselineTxId) throws OseeCoreException {
- IOseeStatement chStmt = getDatabaseService().getStatement();
+ JdbcStatement chStmt = getJdbcClient().getStatement();
try {
- chStmt.runPreparedQuery(MAX_FETCH, SELECT_SOURCE_BRANCH_CHANGES, sourceBranchId,
+ chStmt.runPreparedQuery(JdbcConstants.JDBC__MAX_FETCH_SIZE, SELECT_SOURCE_BRANCH_CHANGES, sourceBranchId,
TxChange.NOT_CURRENT.getValue(), sourceBaselineTxId, sourceBranchId, sourceBaselineTxId);
while (chStmt.next()) {
checkForCancelled();
@@ -145,14 +145,14 @@ public class LoadDeltasBetweenBranches extends AbstractDatastoreCallable<List<Ch
}
private void loadCurrentData(String tableName, String columnName, IdJoinQuery idJoin, HashMap<Integer, ChangeItem> changesByItemId, Long txBranchId, Integer txId, boolean isMergeBranch) throws OseeCoreException {
- IOseeStatement chStmt = getDatabaseService().getStatement();
+ JdbcStatement chStmt = getJdbcClient().getStatement();
try {
String query = "select txs.gamma_id, txs.mod_type, item." + columnName + " from osee_join_id idj, " //
+ tableName + " item, osee_txs txs where idj.query_id = ? and idj.id = item." + columnName + //
" and item.gamma_id = txs.gamma_id and txs.tx_current <> ? and txs.branch_id = ? and txs.transaction_id <= ?";
- chStmt.runPreparedQuery(MAX_FETCH, query, idJoin.getQueryId(), TxChange.NOT_CURRENT.getValue(), txBranchId,
- txId);
+ chStmt.runPreparedQuery(JdbcConstants.JDBC__MAX_FETCH_SIZE, query, idJoin.getQueryId(),
+ TxChange.NOT_CURRENT.getValue(), txBranchId, txId);
while (chStmt.next()) {
checkForCancelled();
@@ -175,7 +175,7 @@ public class LoadDeltasBetweenBranches extends AbstractDatastoreCallable<List<Ch
}
private void loadNonCurrentSourceData(String tableName, String idColumnName, IdJoinQuery idJoin, HashMap<Integer, ChangeItem> changesByItemId, String columnValueName, int sourceBaselineTxId) throws OseeCoreException {
- IOseeStatement chStmt = getDatabaseService().getStatement();
+ JdbcStatement chStmt = getJdbcClient().getStatement();
String query;
try {
@@ -185,7 +185,8 @@ public class LoadDeltasBetweenBranches extends AbstractDatastoreCallable<List<Ch
+ tableName + " item, osee_txs txs where idj.query_id = ? and idj.id = item." + idColumnName + //
" and item.gamma_id = txs.gamma_id and txs.tx_current = ? and txs.branch_id = ? order by idj.id, txs.transaction_id asc";
- chStmt.runPreparedQuery(MAX_FETCH, query, idJoin.getQueryId(), TxChange.NOT_CURRENT.getValue(), sourceBranchId);
+ chStmt.runPreparedQuery(JdbcConstants.JDBC__MAX_FETCH_SIZE, query, idJoin.getQueryId(),
+ TxChange.NOT_CURRENT.getValue(), sourceBranchId);
int previousItemId = -1;
boolean isFirstSet = false;
@@ -230,7 +231,7 @@ public class LoadDeltasBetweenBranches extends AbstractDatastoreCallable<List<Ch
}
private int getBaseTxId(long branchId) throws OseeCoreException {
- return getDatabaseService().runPreparedQueryFetchObject(RelationalConstants.TRANSACTION_SENTINEL,
+ return getJdbcClient().runPreparedQueryFetchObject(RelationalConstants.TRANSACTION_SENTINEL,
SELECT_BASE_TRANSACTION, branchId);
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/change/LoadDeltasBetweenTxsOnTheSameBranch.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/change/LoadDeltasBetweenTxsOnTheSameBranch.java
index 69371ac42c..9259f1f108 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/change/LoadDeltasBetweenTxsOnTheSameBranch.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/change/LoadDeltasBetweenTxsOnTheSameBranch.java
@@ -10,17 +10,17 @@
*******************************************************************************/
package org.eclipse.osee.orcs.db.internal.change;
-import static org.eclipse.osee.framework.database.core.IOseeStatement.MAX_FETCH;
import java.util.Collection;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.core.model.change.ChangeItem;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
-import org.eclipse.osee.framework.database.core.IOseeStatement;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.Conditions;
+import org.eclipse.osee.jdbc.JdbcClient;
+import org.eclipse.osee.jdbc.JdbcConstants;
+import org.eclipse.osee.jdbc.JdbcStatement;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.OrcsSession;
import org.eclipse.osee.orcs.data.TransactionReadable;
@@ -48,11 +48,11 @@ public class LoadDeltasBetweenTxsOnTheSameBranch extends AbstractDatastoreCallab
private final TransactionReadableDelta txDelta;
private final ChangeItemLoader changeItemLoader;
- public LoadDeltasBetweenTxsOnTheSameBranch(Log logger, OrcsSession session, IOseeDatabaseService dbService, SqlJoinFactory joinFactory, TransactionReadableDelta txDelta) {
- super(logger, session, dbService);
+ public LoadDeltasBetweenTxsOnTheSameBranch(Log logger, OrcsSession session, JdbcClient jdbcClient, SqlJoinFactory joinFactory, TransactionReadableDelta txDelta) {
+ super(logger, session, jdbcClient);
this.joinFactory = joinFactory;
this.txDelta = txDelta;
- this.changeItemLoader = new ChangeItemLoader(dbService, changeByGammaId);
+ this.changeItemLoader = new ChangeItemLoader(jdbcClient, changeByGammaId);
}
private long getBranchId() {
@@ -94,10 +94,10 @@ public class LoadDeltasBetweenTxsOnTheSameBranch extends AbstractDatastoreCallab
}
private void loadChangesAtEndTx(TransactionJoinQuery txJoin) throws OseeCoreException {
- IOseeStatement chStmt = getDatabaseService().getStatement();
+ JdbcStatement chStmt = getJdbcClient().getStatement();
try {
- chStmt.runPreparedQuery(MAX_FETCH, SELECT_CHANGES_BETWEEN_TRANSACTIONS, getBranchId(), getStartTx().getGuid(),
- getEndTx().getGuid());
+ chStmt.runPreparedQuery(JdbcConstants.JDBC__MAX_FETCH_SIZE, SELECT_CHANGES_BETWEEN_TRANSACTIONS,
+ getBranchId(), getStartTx().getGuid(), getEndTx().getGuid());
while (chStmt.next()) {
checkForCancelled();
Long gammaId = chStmt.getLong("gamma_id");
@@ -130,13 +130,14 @@ public class LoadDeltasBetweenTxsOnTheSameBranch extends AbstractDatastoreCallab
}
private void loadCurrentData(String tableName, String columnName, int queryId, HashMap<Integer, ChangeItem> changesByItemId, TransactionReadable transactionLimit) throws OseeCoreException {
- IOseeStatement chStmt = getDatabaseService().getStatement();
+ JdbcStatement chStmt = getJdbcClient().getStatement();
try {
String query = "select txs.gamma_id, txs.mod_type, item." + columnName + " from osee_join_id idj, " //
+ tableName + " item, osee_txs txs where idj.query_id = ? and idj.id = item." + columnName + //
" and item.gamma_id = txs.gamma_id and txs.branch_id = ? and txs.transaction_id <= ?";
- chStmt.runPreparedQuery(MAX_FETCH, query, queryId, transactionLimit.getBranchId(), transactionLimit.getGuid());
+ chStmt.runPreparedQuery(JdbcConstants.JDBC__MAX_FETCH_SIZE, query, queryId, transactionLimit.getBranchId(),
+ transactionLimit.getGuid());
while (chStmt.next()) {
checkForCancelled();
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/change/RelationChangeItemFactory.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/change/RelationChangeItemFactory.java
index 80a28450e9..c15e7db25b 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/change/RelationChangeItemFactory.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/change/RelationChangeItemFactory.java
@@ -14,8 +14,8 @@ import java.util.HashMap;
import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.core.model.change.ChangeItem;
import org.eclipse.osee.framework.core.model.change.RelationChangeItem;
-import org.eclipse.osee.framework.database.core.IOseeStatement;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.jdbc.JdbcStatement;
import org.eclipse.osee.orcs.db.internal.change.ChangeItemLoader.ChangeItemFactory;
public final class RelationChangeItemFactory implements ChangeItemFactory {
@@ -35,7 +35,7 @@ public final class RelationChangeItemFactory implements ChangeItemFactory {
}
@Override
- public ChangeItem createItem(IOseeStatement chStmt) throws OseeCoreException {
+ public ChangeItem createItem(JdbcStatement chStmt) throws OseeCoreException {
int relLinkId = chStmt.getInt("rel_link_id");
long relTypeId = chStmt.getLong("rel_link_type_id");
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/conflict/ConflictUtil.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/conflict/ConflictUtil.java
index 812d44351d..f9c28c0f41 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/conflict/ConflictUtil.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/conflict/ConflictUtil.java
@@ -95,7 +95,7 @@ public final class ConflictUtil {
// //add it with an unedited setting and return unedited
// //If gammas are out of date, update the gammas and down grade markedMerged to Edited
//
- // IOseeStatement chStmt = ConnectionHandler.getStatement();
+ // JdbcStatement chStmt = ConnectionHandler.getStatement();
// try {
// chStmt.runPreparedQuery(MERGE_ATTRIBUTE_STATUS, branchID, objectID, conflictType);
//
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/console/AbstractDatastoreConsoleCommand.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/console/AbstractDatastoreConsoleCommand.java
index b0735bec1b..a53aad966b 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/console/AbstractDatastoreConsoleCommand.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/console/AbstractDatastoreConsoleCommand.java
@@ -11,9 +11,10 @@
package org.eclipse.osee.orcs.db.internal.console;
import org.eclipse.osee.console.admin.ConsoleCommand;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
import org.eclipse.osee.framework.jdk.core.type.BaseIdentity;
import org.eclipse.osee.framework.jdk.core.util.GUID;
+import org.eclipse.osee.jdbc.JdbcClient;
+import org.eclipse.osee.jdbc.JdbcService;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.OrcsSession;
@@ -23,7 +24,7 @@ import org.eclipse.osee.orcs.OrcsSession;
public abstract class AbstractDatastoreConsoleCommand implements ConsoleCommand {
private Log logger;
- private IOseeDatabaseService dbService;
+ private JdbcClient jdbcClient;
public Log getLogger() {
return logger;
@@ -33,12 +34,12 @@ public abstract class AbstractDatastoreConsoleCommand implements ConsoleCommand
this.logger = logger;
}
- public IOseeDatabaseService getDatabaseService() {
- return dbService;
+ public JdbcClient getJdbcClient() {
+ return jdbcClient;
}
- public void setDatabaseService(IOseeDatabaseService dbService) {
- this.dbService = dbService;
+ public void setJdbcService(JdbcService jdbcService) {
+ this.jdbcClient = jdbcService.getClient();
}
public OrcsSession getSession() {
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/console/ConsolidateArtifactVersionsCommand.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/console/ConsolidateArtifactVersionsCommand.java
index 9843c0c196..2561f23651 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/console/ConsolidateArtifactVersionsCommand.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/console/ConsolidateArtifactVersionsCommand.java
@@ -44,7 +44,7 @@ public class ConsolidateArtifactVersionsCommand extends AbstractDatastoreConsole
@Override
public Callable<?> createCallable(Console console, ConsoleParameters params) {
- return new ConsolidateArtifactVersionDatabaseTxCallable(getLogger(), getSession(), getDatabaseService(),
- joinFactory, console);
+ return new ConsolidateArtifactVersionDatabaseTxCallable(getLogger(), getSession(), getJdbcClient(), joinFactory,
+ console);
}
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/console/ConsolidateRelationsCommand.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/console/ConsolidateRelationsCommand.java
index 1c16ae9fcc..07ac149d71 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/console/ConsolidateRelationsCommand.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/console/ConsolidateRelationsCommand.java
@@ -44,7 +44,7 @@ public class ConsolidateRelationsCommand extends AbstractDatastoreConsoleCommand
@Override
public Callable<?> createCallable(Console console, ConsoleParameters params) {
- return new ConsolidateRelationsDatabaseTxCallable(getLogger(), getSession(), getDatabaseService(), joinFactory,
+ return new ConsolidateRelationsDatabaseTxCallable(getLogger(), getSession(), getJdbcClient(), joinFactory,
console);
}
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/console/ConvertLocalTypeIdCommand.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/console/ConvertLocalTypeIdCommand.java
index 759f73fdc4..c258c1b6a3 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/console/ConvertLocalTypeIdCommand.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/console/ConvertLocalTypeIdCommand.java
@@ -9,10 +9,10 @@ import java.util.Collection;
import java.util.concurrent.Callable;
import org.eclipse.osee.console.admin.Console;
import org.eclipse.osee.console.admin.ConsoleParameters;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
-import org.eclipse.osee.framework.database.core.IOseeStatement;
-import org.eclipse.osee.framework.database.core.OseeConnection;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.jdbc.JdbcClient;
+import org.eclipse.osee.jdbc.JdbcConnection;
+import org.eclipse.osee.jdbc.JdbcStatement;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.OrcsSession;
import org.eclipse.osee.orcs.db.internal.callable.AbstractDatastoreTxCallable;
@@ -50,7 +50,7 @@ public class ConvertLocalTypeIdCommand extends AbstractDatastoreConsoleCommand {
boolean runConversion = options.contains("P");
boolean undoConversion = options.contains("U");
- return new ConvertTypeIdsCallable(runConversion, undoConversion, console, getDatabaseService(), getLogger(),
+ return new ConvertTypeIdsCallable(runConversion, undoConversion, console, getJdbcClient(), getLogger(),
getSession());
}
@@ -61,17 +61,17 @@ public class ConvertLocalTypeIdCommand extends AbstractDatastoreConsoleCommand {
private final boolean runConversion;
private final boolean undoConversion;
private final Console console;
- private final IOseeDatabaseService dbService;
+ private final JdbcClient jdbcClient;
- public ConvertTypeIdsCallable(boolean runConversion, boolean undoConversion, Console console, IOseeDatabaseService dbService, Log logger, OrcsSession session) {
- super(logger, session, dbService, "Convert Type Ids");
+ public ConvertTypeIdsCallable(boolean runConversion, boolean undoConversion, Console console, JdbcClient jdbcClient, Log logger, OrcsSession session) {
+ super(logger, session, jdbcClient);
this.runConversion = runConversion;
this.undoConversion = undoConversion;
this.console = console;
- this.dbService = dbService;
+ this.jdbcClient = jdbcClient;
}
- private void updateTableIds(OseeConnection connection) throws OseeCoreException {
+ private void updateTableIds(JdbcConnection connection) throws OseeCoreException {
for (int i = 0; i < tables.length; i++) {
String table = tables[i];
String column = columns[i];
@@ -80,22 +80,22 @@ public class ConvertLocalTypeIdCommand extends AbstractDatastoreConsoleCommand {
String sql =
String.format("update %s set %s = (select %s from osee_type_id_map where %s = %s)", table, column,
idCol1, idCol2, column);
- int rowsUpdated = dbService.runPreparedUpdate(connection, sql);
+ int rowsUpdated = jdbcClient.runPreparedUpdate(connection, sql);
console.writeln("[%s] had %d rows updated.", table, rowsUpdated);
}
}
- private void updateOseeInfo(OseeConnection connection) throws OseeCoreException {
+ private void updateOseeInfo(JdbcConnection connection) throws OseeCoreException {
String oseeInfoKey = "use.long.type.ids";
String value = runConversion ? "true" : "false";
- dbService.runPreparedUpdate(connection, "DELETE FROM osee_info WHERE OSEE_KEY = ?", oseeInfoKey);
- dbService.runPreparedUpdate(connection, "INSERT INTO osee_info (OSEE_KEY, OSEE_VALUE) VALUES (?, ?)",
+ jdbcClient.runPreparedUpdate(connection, "DELETE FROM osee_info WHERE OSEE_KEY = ?", oseeInfoKey);
+ jdbcClient.runPreparedUpdate(connection, "INSERT INTO osee_info (OSEE_KEY, OSEE_VALUE) VALUES (?, ?)",
oseeInfoKey, value);
}
private void performRowCounts() throws OseeCoreException {
for (String table : tables) {
- IOseeStatement stmt = dbService.getStatement();
+ JdbcStatement stmt = jdbcClient.getStatement();
try {
String query = String.format("select count(1) from %s", table);
stmt.runPreparedQuery(query);
@@ -110,7 +110,7 @@ public class ConvertLocalTypeIdCommand extends AbstractDatastoreConsoleCommand {
}
@Override
- protected Void handleTxWork(OseeConnection connection) throws OseeCoreException {
+ protected Void handleTxWork(JdbcConnection connection) throws OseeCoreException {
if (runConversion && undoConversion) {
console.writeln("Options U and P cannot be specified together");
return null;
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/console/FixDuplicateAttributesCommand.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/console/FixDuplicateAttributesCommand.java
index 3c61f26b32..02b2d5cf6e 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/console/FixDuplicateAttributesCommand.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/console/FixDuplicateAttributesCommand.java
@@ -10,16 +10,16 @@
*******************************************************************************/
package org.eclipse.osee.orcs.db.internal.console;
-import static org.eclipse.osee.framework.database.core.IOseeStatement.MAX_FETCH;
import java.util.concurrent.Callable;
import org.eclipse.osee.console.admin.Console;
import org.eclipse.osee.console.admin.ConsoleParameters;
import org.eclipse.osee.framework.core.data.IAttributeType;
import org.eclipse.osee.framework.core.enums.TxChange;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
-import org.eclipse.osee.framework.database.core.IOseeStatement;
-import org.eclipse.osee.framework.database.core.OseeConnection;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.jdbc.JdbcClient;
+import org.eclipse.osee.jdbc.JdbcConnection;
+import org.eclipse.osee.jdbc.JdbcConstants;
+import org.eclipse.osee.jdbc.JdbcStatement;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.OrcsApi;
import org.eclipse.osee.orcs.OrcsSession;
@@ -62,7 +62,7 @@ public class FixDuplicateAttributesCommand extends AbstractDatastoreConsoleComma
@Override
public Callable<?> createCallable(Console console, ConsoleParameters params) {
- return new DuplicateAttributesDatabaseTxCallable(getLogger(), getSession(), getDatabaseService(), console);
+ return new DuplicateAttributesDatabaseTxCallable(getLogger(), getSession(), getJdbcClient(), console);
}
private final class DuplicateAttributesDatabaseTxCallable extends AbstractDatastoreTxCallable<Object> {
@@ -73,13 +73,13 @@ public class FixDuplicateAttributesCommand extends AbstractDatastoreConsoleComma
private final Console console;
- public DuplicateAttributesDatabaseTxCallable(Log logger, OrcsSession session, IOseeDatabaseService databaseService, Console console) {
- super(logger, session, databaseService, "Duplicate Attributes");
+ public DuplicateAttributesDatabaseTxCallable(Log logger, OrcsSession session, JdbcClient jdbcClient, Console console) {
+ super(logger, session, jdbcClient);
this.console = console;
}
@Override
- protected Object handleTxWork(OseeConnection connection) throws OseeCoreException {
+ protected Object handleTxWork(JdbcConnection connection) throws OseeCoreException {
ExportImportJoinQuery gammaJoin = joinFactory.createExportImportJoinQuery();
try {
selectAttributes(gammaJoin, connection);
@@ -94,13 +94,13 @@ public class FixDuplicateAttributesCommand extends AbstractDatastoreConsoleComma
return null;
}
- private void selectAttributes(ExportImportJoinQuery gammaJoin, OseeConnection connection) throws OseeCoreException {
+ private void selectAttributes(ExportImportJoinQuery gammaJoin, JdbcConnection connection) throws OseeCoreException {
IdJoinQuery typeJoin = joinFactory.createIdJoinQuery();
populateAttributeTypeJoin(typeJoin);
- IOseeStatement chStmt = getDatabaseService().getStatement(connection);
+ JdbcStatement chStmt = getJdbcClient().getStatement(connection);
try {
- chStmt.runPreparedQuery(MAX_FETCH, SELECT_ATTRIBUTES, typeJoin.getQueryId());
+ chStmt.runPreparedQuery(JdbcConstants.JDBC__MAX_FETCH_SIZE, SELECT_ATTRIBUTES, typeJoin.getQueryId());
while (chStmt.next()) {
gammaJoin.add(chStmt.getLong("gamma1"), chStmt.getLong("gamma2"));
}
@@ -110,8 +110,8 @@ public class FixDuplicateAttributesCommand extends AbstractDatastoreConsoleComma
}
}
- private void selectDuplicates(ExportImportJoinQuery gammaJoin, OseeConnection connection) throws OseeCoreException {
- IOseeStatement chStmt = getDatabaseService().getStatement(connection);
+ private void selectDuplicates(ExportImportJoinQuery gammaJoin, JdbcConnection connection) throws OseeCoreException {
+ JdbcStatement chStmt = getJdbcClient().getStatement(connection);
try {
chStmt.runPreparedQuery(SELECT_DUPLICATES, gammaJoin.getQueryId(), TxChange.CURRENT.getValue(),
TxChange.CURRENT.getValue());
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/console/TxCurrentsCommand.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/console/TxCurrentsCommand.java
index 51202e486b..8370c51a5a 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/console/TxCurrentsCommand.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/console/TxCurrentsCommand.java
@@ -12,29 +12,13 @@ package org.eclipse.osee.orcs.db.internal.console;
import java.util.concurrent.Callable;
import org.eclipse.osee.console.admin.Console;
-import org.eclipse.osee.console.admin.ConsoleCommand;
import org.eclipse.osee.console.admin.ConsoleParameters;
-import org.eclipse.osee.framework.core.operation.IOperation;
-import org.eclipse.osee.framework.core.operation.OperationLogger;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
import org.eclipse.osee.orcs.db.internal.exchange.TxCurrentsOpFactory;
-import org.eclipse.osee.orcs.db.internal.util.OperationCallableAdapter;
-import org.eclipse.osee.orcs.db.internal.util.OperationLoggerAdapter;
/**
* @author Roberto E. Escobar
*/
-public class TxCurrentsCommand implements ConsoleCommand {
-
- private IOseeDatabaseService dbService;
-
- public IOseeDatabaseService getDatabaseService() {
- return dbService;
- }
-
- public void setDatabaseService(IOseeDatabaseService dbService) {
- this.dbService = dbService;
- }
+public class TxCurrentsCommand extends AbstractDatastoreConsoleCommand {
@Override
public String getName() {
@@ -54,9 +38,7 @@ public class TxCurrentsCommand implements ConsoleCommand {
@Override
public Callable<?> createCallable(Console console, ConsoleParameters params) {
boolean isArchivedTable = params.getBoolean("onTxsArchived");
- OperationLogger logger = new OperationLoggerAdapter(console);
- IOperation operation =
- TxCurrentsOpFactory.createTxCurrentsAndModTypesOp(getDatabaseService(), logger, isArchivedTable);
- return new OperationCallableAdapter(operation);
+ return TxCurrentsOpFactory.createTxCurrentsAndModTypesOp(getLogger(), getSession(), getJdbcClient(),
+ isArchivedTable);
}
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/console/TxPruneCommand.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/console/TxPruneCommand.java
index 842278cd6f..fec643c4f9 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/console/TxPruneCommand.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/console/TxPruneCommand.java
@@ -12,29 +12,13 @@ package org.eclipse.osee.orcs.db.internal.console;
import java.util.concurrent.Callable;
import org.eclipse.osee.console.admin.Console;
-import org.eclipse.osee.console.admin.ConsoleCommand;
import org.eclipse.osee.console.admin.ConsoleParameters;
-import org.eclipse.osee.framework.core.operation.IOperation;
-import org.eclipse.osee.framework.core.operation.OperationLogger;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
-import org.eclipse.osee.framework.database.operation.PurgeUnusedBackingDataAndTransactions;
-import org.eclipse.osee.orcs.db.internal.util.OperationCallableAdapter;
-import org.eclipse.osee.orcs.db.internal.util.OperationLoggerAdapter;
+import org.eclipse.osee.orcs.db.internal.callable.PurgeUnusedBackingDataAndTransactions;
/**
* @author Roberto E. Escobar
*/
-public class TxPruneCommand implements ConsoleCommand {
-
- private IOseeDatabaseService dbService;
-
- public IOseeDatabaseService getDatabaseService() {
- return dbService;
- }
-
- public void setDatabaseService(IOseeDatabaseService dbService) {
- this.dbService = dbService;
- }
+public class TxPruneCommand extends AbstractDatastoreConsoleCommand {
@Override
public String getName() {
@@ -53,8 +37,6 @@ public class TxPruneCommand implements ConsoleCommand {
@Override
public Callable<?> createCallable(Console console, ConsoleParameters params) {
- OperationLogger logger = new OperationLoggerAdapter(console);
- IOperation operation = new PurgeUnusedBackingDataAndTransactions(getDatabaseService(), logger);
- return new OperationCallableAdapter(operation);
+ return new PurgeUnusedBackingDataAndTransactions(getLogger(), getSession(), getJdbcClient());
}
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/ExchangeDb.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/ExchangeDb.java
index 7fe783b7c8..a7acbfd915 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/ExchangeDb.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/ExchangeDb.java
@@ -15,8 +15,8 @@ import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
-import org.eclipse.osee.framework.database.core.IOseeSequence;
+import org.eclipse.osee.jdbc.JdbcClient;
+import org.eclipse.osee.orcs.db.internal.IdentityManager;
import org.eclipse.osee.orcs.db.internal.exchange.handler.ExportItem;
/**
@@ -105,14 +105,14 @@ public final class ExchangeDb {
return items;
}
- static List<IdTranslator> createTranslators(IOseeDatabaseService service) {
+ static List<IdTranslator> createTranslators(JdbcClient service) {
List<IdTranslator> translators = new ArrayList<IdTranslator>();
- translators.add(new IdTranslator(service, IOseeSequence.GAMMA_ID_SEQ, GAMMA_ID_ALIASES));
- translators.add(new IdTranslator(service, IOseeSequence.TRANSACTION_ID_SEQ, TRANSACTION_ID_ALIASES));
- translators.add(new IdTranslator(service, IOseeSequence.BRANCH_ID_SEQ, BRANCH_ID_ALIASES));
- translators.add(new IdTranslator(service, IOseeSequence.ART_ID_SEQ, ARTIFACT_ID_ALIASES));
- translators.add(new IdTranslator(service, IOseeSequence.ATTR_ID_SEQ, ATTRIBUTE_ID));
- translators.add(new IdTranslator(service, IOseeSequence.REL_LINK_ID_SEQ, RELATION_ID));
+ translators.add(new IdTranslator(service, IdentityManager.GAMMA_ID_SEQ, GAMMA_ID_ALIASES));
+ translators.add(new IdTranslator(service, IdentityManager.TRANSACTION_ID_SEQ, TRANSACTION_ID_ALIASES));
+ translators.add(new IdTranslator(service, IdentityManager.BRANCH_ID_SEQ, BRANCH_ID_ALIASES));
+ translators.add(new IdTranslator(service, IdentityManager.ART_ID_SEQ, ARTIFACT_ID_ALIASES));
+ translators.add(new IdTranslator(service, IdentityManager.ATTR_ID_SEQ, ATTRIBUTE_ID));
+ translators.add(new IdTranslator(service, IdentityManager.REL_LINK_ID_SEQ, RELATION_ID));
return translators;
}
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/ExportItemFactory.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/ExportItemFactory.java
index 7a15323666..54550cb45a 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/ExportItemFactory.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/ExportItemFactory.java
@@ -14,18 +14,18 @@ import java.sql.DatabaseMetaData;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
-import org.eclipse.osee.framework.database.core.IOseeSequence;
-import org.eclipse.osee.framework.database.core.OseeConnection;
import org.eclipse.osee.framework.jdk.core.type.OseeArgumentException;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.type.PropertyStore;
import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.framework.resource.management.IResourceManager;
+import org.eclipse.osee.jdbc.JdbcClient;
+import org.eclipse.osee.jdbc.JdbcConnection;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.ExportOptions;
import org.eclipse.osee.orcs.OrcsTypes;
import org.eclipse.osee.orcs.core.SystemPreferences;
+import org.eclipse.osee.orcs.db.internal.IdentityManager;
import org.eclipse.osee.orcs.db.internal.exchange.export.AbstractExportItem;
import org.eclipse.osee.orcs.db.internal.exchange.export.DbTableExportItem;
import org.eclipse.osee.orcs.db.internal.exchange.export.ManifestExportItem;
@@ -35,7 +35,7 @@ import org.eclipse.osee.orcs.db.internal.exchange.handler.ExportItem;
public class ExportItemFactory {
private static final String GET_MAX_TX =
- "SELECT last_sequence FROM osee_sequence WHERE sequence_name = '" + IOseeSequence.TRANSACTION_ID_SEQ + "'";
+ "SELECT last_sequence FROM osee_sequence WHERE sequence_name = '" + IdentityManager.TRANSACTION_ID_SEQ + "'";
private static final String BRANCH_TABLE_QUERY =
"SELECT br.* FROM osee_join_export_import jex, osee_branch br WHERE jex.query_id=? AND jex.id1=br.branch_id ORDER BY br.branch_id";
@@ -70,14 +70,14 @@ public class ExportItemFactory {
private final Log logger;
private final SystemPreferences preferences;
- private final IOseeDatabaseService dbService;
+ private final JdbcClient jdbcClient;
private final IResourceManager resourceManager;
private final OrcsTypes orcsTypes;
- public ExportItemFactory(Log logger, SystemPreferences preferences, IOseeDatabaseService dbService, IResourceManager resourceManager, OrcsTypes orcsTypes) {
+ public ExportItemFactory(Log logger, SystemPreferences preferences, JdbcClient jdbcClient, IResourceManager resourceManager, OrcsTypes orcsTypes) {
this.logger = logger;
this.preferences = preferences;
- this.dbService = dbService;
+ this.jdbcClient = jdbcClient;
this.resourceManager = resourceManager;
this.orcsTypes = orcsTypes;
}
@@ -86,8 +86,8 @@ public class ExportItemFactory {
return logger;
}
- public IOseeDatabaseService getDbService() {
- return dbService;
+ public JdbcClient getDbService() {
+ return jdbcClient;
}
public IResourceManager getResourceManager() {
@@ -138,7 +138,7 @@ public class ExportItemFactory {
}
}
- private int createGammaJoin(IOseeDatabaseService databaseService, int exportJoinId, PropertyStore options) throws OseeCoreException {
+ private int createGammaJoin(JdbcClient jdbcClient, int exportJoinId, PropertyStore options) throws OseeCoreException {
List<Object> bindList = new ArrayList<Object>();
int gammaJoinId = new Random().nextInt();
StringBuilder sql =
@@ -153,7 +153,7 @@ public class ExportItemFactory {
Object[] bindData = bindList.toArray(new Object[bindList.size()]);
String insert = String.format(sql.toString(), gammaJoinId, gammaJoinId);
- int itemsInserted = databaseService.runPreparedUpdate(insert, bindData);
+ int itemsInserted = jdbcClient.runPreparedUpdate(insert, bindData);
getLogger().info("Export join rows: [%s]", itemsInserted);
@@ -218,8 +218,8 @@ public class ExportItemFactory {
return toReturn;
}
- private static DatabaseMetaData getMetaData(IOseeDatabaseService dbService) throws OseeCoreException {
- OseeConnection connection = dbService.getConnection();
+ private static DatabaseMetaData getMetaData(JdbcClient jdbcClient) throws OseeCoreException {
+ JdbcConnection connection = jdbcClient.getConnection();
try {
return connection.getMetaData();
} finally {
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/ForeignKeyReader.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/ForeignKeyReader.java
index 40746cf3d8..ab9d455840 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/ForeignKeyReader.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/ForeignKeyReader.java
@@ -11,7 +11,7 @@
package org.eclipse.osee.orcs.db.internal.exchange;
import java.util.Map;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
+import org.eclipse.osee.jdbc.JdbcClient;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.db.internal.exchange.handler.BaseDbSaxHandler;
import org.eclipse.osee.orcs.db.internal.exchange.handler.IExportItem;
@@ -24,8 +24,8 @@ public class ForeignKeyReader extends BaseDbSaxHandler {
private final PrimaryKeyCollector primaryKeyCollector;
private final IExportItem foreignTable;
- public ForeignKeyReader(Log logger, IOseeDatabaseService service, PrimaryKeyCollector primaryKeyCollector, IExportItem foreignTable, String... foreignKeys) {
- super(logger, service, true, 0);
+ public ForeignKeyReader(Log logger, JdbcClient jdbcClient, PrimaryKeyCollector primaryKeyCollector, IExportItem foreignTable, String... foreignKeys) {
+ super(logger, jdbcClient, true, 0);
this.primaryKeyCollector = primaryKeyCollector;
this.foreignKeys = foreignKeys;
this.foreignTable = foreignTable;
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/IdTranslator.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/IdTranslator.java
index 77d8a6ac60..c85485d846 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/IdTranslator.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/IdTranslator.java
@@ -18,10 +18,10 @@ import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
-import org.eclipse.osee.framework.database.core.IOseeStatement;
-import org.eclipse.osee.framework.database.core.OseeConnection;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.jdbc.JdbcClient;
+import org.eclipse.osee.jdbc.JdbcConnection;
+import org.eclipse.osee.jdbc.JdbcStatement;
/**
* @author Roberto E. Escobar
@@ -37,10 +37,10 @@ public class IdTranslator {
private final Map<Long, Long> originalToMapped;
private final List<Long> newIds;
private final Set<String> aliases;
- private final IOseeDatabaseService service;
+ private final JdbcClient jdbcClient;
- IdTranslator(IOseeDatabaseService service, String sequenceName, String... aliases) {
- this.service = service;
+ IdTranslator(JdbcClient jdbcClient, String sequenceName, String... aliases) {
+ this.jdbcClient = jdbcClient;
this.sequenceName = sequenceName;
this.originalToMapped = new HashMap<Long, Long>();
this.newIds = new ArrayList<Long>();
@@ -101,14 +101,14 @@ public class IdTranslator {
} else {
newVersion = this.originalToMapped.get(original);
if (newVersion == null) {
- newVersion = service.getSequence().getNextSequence(getSequence());
+ newVersion = jdbcClient.getNextSequence(getSequenceName());
addToCache(original, newVersion);
}
}
return newVersion;
}
- public String getSequence() {
+ public String getSequenceName() {
return this.sequenceName;
}
@@ -128,10 +128,10 @@ public class IdTranslator {
}
public void load(String sourceDatabaseId) throws OseeCoreException {
- IOseeStatement chStmt = service.getStatement();
+ JdbcStatement chStmt = jdbcClient.getStatement();
try {
originalToMapped.clear();
- chStmt.runPreparedQuery(SELECT_IDS_BY_DB_SOURCE_AND_SEQ_NAME, sourceDatabaseId, getSequence());
+ chStmt.runPreparedQuery(SELECT_IDS_BY_DB_SOURCE_AND_SEQ_NAME, sourceDatabaseId, getSequenceName());
while (chStmt.next()) {
originalToMapped.put(chStmt.getLong("original_id"), chStmt.getLong("mapped_id"));
}
@@ -144,14 +144,14 @@ public class IdTranslator {
return !newIds.isEmpty();
}
- public void store(OseeConnection connection, int sequenceId) throws OseeCoreException {
+ public void store(JdbcConnection connection, int sequenceId) throws OseeCoreException {
if (hasItemsToStore()) {
List<Object[]> data = new ArrayList<Object[]>();
for (Long original : newIds) {
Long mapped = originalToMapped.get(original);
data.add(new Object[] {sequenceId, original, mapped});
}
- service.runBatchUpdate(connection, INSERT_INTO_IMPORT_INDEX_MAP, data);
+ jdbcClient.runBatchUpdate(connection, INSERT_INTO_IMPORT_INDEX_MAP, data);
}
}
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/PrimaryKeyCollector.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/PrimaryKeyCollector.java
index 9a184760ed..1adbb44cbc 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/PrimaryKeyCollector.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/PrimaryKeyCollector.java
@@ -15,8 +15,8 @@ import java.util.HashSet;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
import org.eclipse.osee.framework.jdk.core.type.HashCollection;
+import org.eclipse.osee.jdbc.JdbcClient;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.db.internal.exchange.handler.BaseDbSaxHandler;
@@ -32,7 +32,7 @@ public class PrimaryKeyCollector extends BaseDbSaxHandler {
this.primaryKey = primaryKey;
}
- public PrimaryKeyCollector(Log logger, IOseeDatabaseService service) {
+ public PrimaryKeyCollector(Log logger, JdbcClient service) {
super(logger, service, true, 0);
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/ReferentialIntegrityConstraint.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/ReferentialIntegrityConstraint.java
index bc10c2e598..8c9633f9e0 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/ReferentialIntegrityConstraint.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/ReferentialIntegrityConstraint.java
@@ -14,10 +14,10 @@ import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
import org.eclipse.osee.framework.jdk.core.type.HashCollection;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.Collections;
+import org.eclipse.osee.jdbc.JdbcClient;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.db.internal.exchange.handler.IExportItem;
import org.eclipse.osee.orcs.db.internal.exchange.transform.ExchangeDataProcessor;
@@ -88,8 +88,8 @@ public class ReferentialIntegrityConstraint {
return collector.getUnreferencedPrimaryKeys();
}
- public void checkConstraint(Log logger, IOseeDatabaseService service, ExchangeDataProcessor processor) throws OseeCoreException {
- collector = new PrimaryKeyCollector(logger, service);
+ public void checkConstraint(Log logger, JdbcClient jdbcClient, ExchangeDataProcessor processor) throws OseeCoreException {
+ collector = new PrimaryKeyCollector(logger, jdbcClient);
for (IExportItem primaryTable : getPrimaryItems()) {
collector.setPrimaryKey(getPrimaryKey());
@@ -97,7 +97,7 @@ public class ReferentialIntegrityConstraint {
}
for (IExportItem foreignTable : getForeignItems()) {
ForeignKeyReader foreignKeyReader =
- new ForeignKeyReader(logger, service, collector, foreignTable, getForeignKeys());
+ new ForeignKeyReader(logger, jdbcClient, collector, foreignTable, getForeignKeys());
processor.parse(foreignTable, foreignKeyReader);
}
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/SavePointManager.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/SavePointManager.java
index 9c1646dd9a..a4d4cf9bc3 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/SavePointManager.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/SavePointManager.java
@@ -10,7 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.orcs.db.internal.exchange;
-import static org.eclipse.osee.framework.database.IOseeDatabaseService.MAX_VARCHAR_LENGTH;
+import static org.eclipse.osee.jdbc.JdbcConstants.JDBC__MAX_VARCHAR_LENGTH;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Collections;
@@ -18,11 +18,11 @@ import java.util.Date;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
-import org.eclipse.osee.framework.database.core.IOseeStatement;
-import org.eclipse.osee.framework.database.core.OseeConnection;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.Lib;
+import org.eclipse.osee.jdbc.JdbcClient;
+import org.eclipse.osee.jdbc.JdbcConnection;
+import org.eclipse.osee.jdbc.JdbcStatement;
/**
* @author Roberto E. Escobar
@@ -41,19 +41,19 @@ public class SavePointManager {
private final Map<String, SavePoint> savePoints = new LinkedHashMap<String, SavePoint>();
- private final IOseeDatabaseService dbService;
+ private final JdbcClient jdbcClient;
private String currentSavePoint;
- public SavePointManager(IOseeDatabaseService dbService) {
- this.dbService = dbService;
+ public SavePointManager(JdbcClient jdbcClient) {
+ this.jdbcClient = jdbcClient;
}
- private IOseeDatabaseService getDatabaseService() {
- return dbService;
+ private JdbcClient getJdbcClient() {
+ return jdbcClient;
}
- public void storeSavePoints(OseeConnection connection, int importIdIndex) throws OseeCoreException {
+ public void storeSavePoints(JdbcConnection connection, int importIdIndex) throws OseeCoreException {
List<Object[]> data = new ArrayList<Object[]>();
for (SavePoint savePoint : savePoints.values()) {
int status = 1;
@@ -64,20 +64,20 @@ public class SavePointManager {
for (Throwable ex : savePoint.getErrors()) {
builder.append(Lib.exceptionToString(ex).replaceAll("\n", " "));
}
- if (builder.length() < MAX_VARCHAR_LENGTH) {
+ if (builder.length() < JDBC__MAX_VARCHAR_LENGTH) {
comment = builder.toString();
} else {
- comment = builder.substring(0, MAX_VARCHAR_LENGTH);
+ comment = builder.substring(0, JDBC__MAX_VARCHAR_LENGTH);
}
}
data.add(new Object[] {importIdIndex, savePoint.getName(), status, comment});
}
- getDatabaseService().runBatchUpdate(connection, INSERT_INTO_IMPORT_SAVE_POINT, data);
+ getJdbcClient().runBatchUpdate(connection, INSERT_INTO_IMPORT_SAVE_POINT, data);
}
public void loadSavePoints(String sourceDatabaseId, Date sourceExportDate) throws OseeCoreException {
- IOseeStatement chStmt = getDatabaseService().getStatement();
+ JdbcStatement chStmt = getJdbcClient().getStatement();
try {
setCurrentSetPointId(LOAD_SAVE_POINT_ID);
chStmt.runPreparedQuery(QUERY_SAVE_POINTS_FROM_IMPORT_MAP, sourceDatabaseId,
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/TranslationManager.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/TranslationManager.java
index f15a6103b4..b2b1198eee 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/TranslationManager.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/TranslationManager.java
@@ -14,26 +14,28 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
-import org.eclipse.osee.framework.database.core.OseeConnection;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.type.PropertyStore;
+import org.eclipse.osee.jdbc.JdbcClient;
+import org.eclipse.osee.jdbc.JdbcConnection;
import org.eclipse.osee.orcs.ImportOptions;
public class TranslationManager {
+ private static final String IMPORT_MAPPED_INDEX_SEQ = "SKYNET_IMPORT_MAPPED_INDEX_SEQ";
+
private static final String INSERT_INTO_IMPORT_MAP =
"INSERT INTO osee_import_map (import_id, sequence_id, sequence_name) VALUES (?, ?, ?)";
private final List<IdTranslator> translators;
private final Map<String, IdTranslator> translatorMap;
- private final IOseeDatabaseService service;
+ private final JdbcClient jdbcClient;
private boolean useOriginalIds;
- public TranslationManager(IOseeDatabaseService service) {
- this.service = service;
+ public TranslationManager(JdbcClient jdbcClient) {
+ this.jdbcClient = jdbcClient;
this.useOriginalIds = true;
- this.translators = ExchangeDb.createTranslators(service);
+ this.translators = ExchangeDb.createTranslators(jdbcClient);
this.translatorMap = new HashMap<String, IdTranslator>();
for (IdTranslator translator : translators) {
for (String alias : translator.getAliases()) {
@@ -57,21 +59,21 @@ public class TranslationManager {
public List<String> getSequenceNames() {
List<String> toReturn = new ArrayList<String>();
for (IdTranslator translatedIdMap : translators) {
- toReturn.add(translatedIdMap.getSequence());
+ toReturn.add(translatedIdMap.getSequenceName());
}
return toReturn;
}
- public void store(OseeConnection connection, int importIdIndex) throws OseeCoreException {
+ public void store(JdbcConnection connection, int importIdIndex) throws OseeCoreException {
List<Object[]> data = new ArrayList<Object[]>();
for (IdTranslator translatedIdMap : translators) {
if (translatedIdMap.hasItemsToStore()) {
- int importSeqId = service.getSequence().getNextImportMappedIndexId();
- data.add(new Object[] {importIdIndex, importSeqId, translatedIdMap.getSequence()});
+ int importSeqId = (int) jdbcClient.getNextSequence(IMPORT_MAPPED_INDEX_SEQ);
+ data.add(new Object[] {importIdIndex, importSeqId, translatedIdMap.getSequenceName()});
translatedIdMap.store(connection, importSeqId);
}
}
- service.runBatchUpdate(connection, INSERT_INTO_IMPORT_MAP, data);
+ jdbcClient.runBatchUpdate(connection, INSERT_INTO_IMPORT_MAP, data);
}
public boolean isTranslatable(String name) {
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/TxCurrentsOpFactory.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/TxCurrentsOpFactory.java
index 6368e0840d..bd1fb0e408 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/TxCurrentsOpFactory.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/TxCurrentsOpFactory.java
@@ -10,13 +10,13 @@
*******************************************************************************/
package org.eclipse.osee.orcs.db.internal.exchange;
-import java.util.ArrayList;
-import java.util.List;
-import org.eclipse.osee.framework.core.operation.IOperation;
-import org.eclipse.osee.framework.core.operation.OperationLogger;
-import org.eclipse.osee.framework.core.operation.Operations;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
-import org.eclipse.osee.framework.database.operation.InvalidTxCurrentsAndModTypes;
+import java.util.concurrent.Callable;
+import org.eclipse.osee.jdbc.JdbcClient;
+import org.eclipse.osee.logger.Log;
+import org.eclipse.osee.orcs.OrcsSession;
+import org.eclipse.osee.orcs.db.internal.callable.AbstractDatastoreTxCallable;
+import org.eclipse.osee.orcs.db.internal.callable.CompositeDatastoreTxCallable;
+import org.eclipse.osee.orcs.db.internal.callable.InvalidTxCurrentsAndModTypesCallable;
/**
* @author Ryan D. Brooks
@@ -27,20 +27,15 @@ public class TxCurrentsOpFactory {
//Static utility
}
- public static IOperation createTxCurrentsAndModTypesOp(IOseeDatabaseService db, OperationLogger logger, boolean archived) {
- List<IOperation> ops = createSubOperations(db, logger, archived);
- return Operations.createBuilder("TxCurrents And Mod Types").addAll(ops).build();
+ public static Callable<?> createTxCurrentsAndModTypesOp(Log logger, OrcsSession session, JdbcClient db, boolean archived) {
+ return new CompositeDatastoreTxCallable(logger, session, db, //
+ buildFixOperation(logger, session, db, archived, "1/3 ", "osee_artifact", "art_id"), //
+ buildFixOperation(logger, session, db, archived, "2/3 ", "osee_attribute", "attr_id"), //
+ buildFixOperation(logger, session, db, archived, "3/3 ", "osee_relation_link", "rel_link_id"));
}
- private static List<IOperation> createSubOperations(IOseeDatabaseService db, OperationLogger logger, boolean archived) {
- List<IOperation> operations = new ArrayList<IOperation>(3);
- operations.add(buildFixOperation(db, logger, archived, "1/3 ", "osee_artifact", "art_id"));
- operations.add(buildFixOperation(db, logger, archived, "2/3 ", "osee_attribute", "attr_id"));
- operations.add(buildFixOperation(db, logger, archived, "3/3 ", "osee_relation_link", "rel_link_id"));
- return operations;
- }
-
- private static IOperation buildFixOperation(IOseeDatabaseService db, OperationLogger logger, boolean archived, String operationName, String tableName, String columnName) {
- return new InvalidTxCurrentsAndModTypes(db, operationName, tableName, columnName, logger, true, archived);
+ private static AbstractDatastoreTxCallable<?> buildFixOperation(Log logger, OrcsSession session, JdbcClient db, boolean archived, String operationName, String tableName, String columnName) {
+ return new InvalidTxCurrentsAndModTypesCallable(logger, session, db, operationName, tableName, columnName, true,
+ archived);
}
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/export/DbTableExportItem.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/export/DbTableExportItem.java
index 6d166ba3aa..3b41abb5a5 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/export/DbTableExportItem.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/export/DbTableExportItem.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.osee.orcs.db.internal.exchange.export;
-import static org.eclipse.osee.framework.database.core.IOseeStatement.MAX_FETCH;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
@@ -20,8 +19,6 @@ import java.lang.reflect.Method;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.sql.Timestamp;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
-import org.eclipse.osee.framework.database.core.IOseeStatement;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.type.PropertyStore;
import org.eclipse.osee.framework.jdk.core.util.HexUtil;
@@ -31,6 +28,9 @@ import org.eclipse.osee.framework.jdk.core.util.xml.Xml;
import org.eclipse.osee.framework.resource.management.IResource;
import org.eclipse.osee.framework.resource.management.IResourceLocator;
import org.eclipse.osee.framework.resource.management.IResourceManager;
+import org.eclipse.osee.jdbc.JdbcClient;
+import org.eclipse.osee.jdbc.JdbcConstants;
+import org.eclipse.osee.jdbc.JdbcStatement;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.db.internal.exchange.ExportImportXml;
import org.eclipse.osee.orcs.db.internal.exchange.handler.ExportItem;
@@ -48,19 +48,19 @@ public class DbTableExportItem extends AbstractXmlExportItem {
private final String query;
private final Object[] bindData;
- private final IOseeDatabaseService dbService;
+ private final JdbcClient jdbcClient;
private final IResourceManager resourceManager;
- public DbTableExportItem(Log logger, IOseeDatabaseService dbService, IResourceManager resourceManager, ExportItem id, String query, Object[] bindData) {
+ public DbTableExportItem(Log logger, JdbcClient jdbcClient, IResourceManager resourceManager, ExportItem id, String query, Object[] bindData) {
super(logger, id);
- this.dbService = dbService;
+ this.jdbcClient = jdbcClient;
this.resourceManager = resourceManager;
this.query = query;
this.bindData = bindData;
}
- private IOseeDatabaseService getDatabaseService() {
- return dbService;
+ private JdbcClient getDatabaseService() {
+ return jdbcClient;
}
protected String exportBinaryDataTo(File tempFolder, String uriTarget) throws OseeCoreException, IOException {
@@ -92,9 +92,9 @@ public class DbTableExportItem extends AbstractXmlExportItem {
@Override
protected void doWork(Appendable appendable) throws Exception {
- IOseeStatement chStmt = getDatabaseService().getStatement();
+ JdbcStatement chStmt = getDatabaseService().getStatement();
try {
- chStmt.runPreparedQuery(MAX_FETCH, query, bindData);
+ chStmt.runPreparedQuery(JdbcConstants.JDBC__MAX_FETCH_SIZE, query, bindData);
while (chStmt.next()) {
processData(appendable, chStmt);
}
@@ -103,7 +103,7 @@ public class DbTableExportItem extends AbstractXmlExportItem {
}
}
- private void processData(Appendable appendable, IOseeStatement chStmt) throws Exception {
+ private void processData(Appendable appendable, JdbcStatement chStmt) throws Exception {
ExportImportXml.openPartialXmlNode(appendable, ExportImportXml.ENTRY);
try {
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/export/MetadataExportItem.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/export/MetadataExportItem.java
index 4f70eacd66..5e3943031a 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/export/MetadataExportItem.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/export/MetadataExportItem.java
@@ -17,10 +17,10 @@ import java.sql.SQLException;
import java.sql.Types;
import java.util.ArrayList;
import java.util.List;
-import org.eclipse.osee.framework.database.core.SQL3DataType;
-import org.eclipse.osee.framework.database.core.SupportedDatabase;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.Strings;
+import org.eclipse.osee.jdbc.JdbcDbType;
+import org.eclipse.osee.jdbc.SQL3DataType;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.db.internal.exchange.ExportImportXml;
import org.eclipse.osee.orcs.db.internal.exchange.handler.ExportItem;
@@ -151,7 +151,7 @@ public class MetadataExportItem extends AbstractXmlExportItem {
ExportImportXml.addXmlAttribute(appendable, ExportImportXml.ID, columnId);
int dataType = resultSet.getInt("DATA_TYPE");
- if (SupportedDatabase.isDatabaseType(metaData, SupportedDatabase.foxpro)) {
+ if (JdbcDbType.isDatabaseType(metaData, JdbcDbType.foxpro)) {
if (dataType == Types.CHAR) {
dataType = Types.VARCHAR;
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/handler/BaseDbSaxHandler.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/handler/BaseDbSaxHandler.java
index 6774424bd7..3981ca66fc 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/handler/BaseDbSaxHandler.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/handler/BaseDbSaxHandler.java
@@ -15,10 +15,10 @@ import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
-import org.eclipse.osee.framework.database.core.OseeConnection;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.type.PropertyStore;
+import org.eclipse.osee.jdbc.JdbcClient;
+import org.eclipse.osee.jdbc.JdbcConnection;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.db.internal.exchange.TranslationManager;
@@ -34,10 +34,10 @@ public abstract class BaseDbSaxHandler extends BaseExportImportSaxHandler {
private MetaData metadata;
private TranslationManager translator;
private PropertyStore options;
- private final IOseeDatabaseService service;
+ private final JdbcClient service;
private final Log logger;
- protected BaseDbSaxHandler(Log logger, IOseeDatabaseService service, boolean isCacheAll, int cacheLimit) {
+ protected BaseDbSaxHandler(Log logger, JdbcClient service, boolean isCacheAll, int cacheLimit) {
super();
if (cacheLimit < 0) {
throw new IllegalArgumentException(String.format("Cache limit cannot be less than zero - cacheLimit=[%d]",
@@ -95,7 +95,7 @@ public abstract class BaseDbSaxHandler extends BaseExportImportSaxHandler {
store(null);
}
- public void store(OseeConnection connection) throws OseeCoreException {
+ public void store(JdbcConnection connection) throws OseeCoreException {
if (!data.isEmpty()) {
getDatabaseService().runBatchUpdate(connection, getMetaData().getQuery(), data);
data.clear();
@@ -104,7 +104,7 @@ public abstract class BaseDbSaxHandler extends BaseExportImportSaxHandler {
private boolean isTruncateSupported() throws OseeCoreException {
boolean isTruncateSupported = false;
- OseeConnection connection = service.getConnection();
+ JdbcConnection connection = service.getConnection();
try {
DatabaseMetaData metaData = connection.getMetaData();
ResultSet resultSet = null;
@@ -145,7 +145,7 @@ public abstract class BaseDbSaxHandler extends BaseExportImportSaxHandler {
}
}
- protected IOseeDatabaseService getDatabaseService() {
+ protected JdbcClient getDatabaseService() {
return service;
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/handler/BranchDataSaxHandler.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/handler/BranchDataSaxHandler.java
index 9c33d97c70..f7a578c56a 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/handler/BranchDataSaxHandler.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/handler/BranchDataSaxHandler.java
@@ -21,12 +21,12 @@ import java.util.Set;
import org.eclipse.osee.framework.core.enums.BranchType;
import org.eclipse.osee.framework.core.enums.CoreBranches;
import org.eclipse.osee.framework.core.exception.OseeDataStoreException;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
-import org.eclipse.osee.framework.database.core.IOseeStatement;
-import org.eclipse.osee.framework.database.core.OseeConnection;
import org.eclipse.osee.framework.jdk.core.type.OseeArgumentException;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.Strings;
+import org.eclipse.osee.jdbc.JdbcClient;
+import org.eclipse.osee.jdbc.JdbcConnection;
+import org.eclipse.osee.jdbc.JdbcStatement;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.ImportOptions;
import org.eclipse.osee.orcs.db.internal.exchange.ExchangeDb;
@@ -37,17 +37,17 @@ import org.eclipse.osee.orcs.db.internal.exchange.ExchangeDb;
public class BranchDataSaxHandler extends BaseDbSaxHandler {
private final Map<Integer, BranchData> idToImportFileBranchData;
- private OseeConnection connection;
+ private JdbcConnection connection;
- public static BranchDataSaxHandler createWithCacheAll(Log logger, IOseeDatabaseService service) {
+ public static BranchDataSaxHandler createWithCacheAll(Log logger, JdbcClient service) {
return new BranchDataSaxHandler(logger, service, true, 0);
}
- public static BranchDataSaxHandler newLimitedCacheBranchDataSaxHandler(Log logger, IOseeDatabaseService service, int cacheLimit) {
+ public static BranchDataSaxHandler newLimitedCacheBranchDataSaxHandler(Log logger, JdbcClient service, int cacheLimit) {
return new BranchDataSaxHandler(logger, service, false, cacheLimit);
}
- private BranchDataSaxHandler(Log logger, IOseeDatabaseService service, boolean isCacheAll, int cacheLimit) {
+ private BranchDataSaxHandler(Log logger, JdbcClient service, boolean isCacheAll, int cacheLimit) {
super(logger, service, isCacheAll, cacheLimit);
this.idToImportFileBranchData = new HashMap<Integer, BranchData>();
this.connection = null;
@@ -115,7 +115,7 @@ public class BranchDataSaxHandler extends BaseDbSaxHandler {
}
}
- public long[] store(OseeConnection connection, boolean writeToDb, long... branchesToImport) throws OseeCoreException {
+ public long[] store(JdbcConnection connection, boolean writeToDb, long... branchesToImport) throws OseeCoreException {
checkSelectedBranches(branchesToImport);
Collection<BranchData> branchesToStore = getSelectedBranchesToImport(branchesToImport);
@@ -184,13 +184,13 @@ public class BranchDataSaxHandler extends BaseDbSaxHandler {
return newValue.intValue();
}
- private Collection<BranchData> checkTargetDbBranches(OseeConnection connection, Collection<BranchData> selectedBranches) throws OseeCoreException {
+ private Collection<BranchData> checkTargetDbBranches(JdbcConnection connection, Collection<BranchData> selectedBranches) throws OseeCoreException {
Map<String, BranchData> guidToImportFileBranchData = new HashMap<String, BranchData>();
for (BranchData data : selectedBranches) {
guidToImportFileBranchData.put(data.getBranchGuid(), data);
}
- IOseeStatement chStmt = getDatabaseService().getStatement(connection);
+ JdbcStatement chStmt = getDatabaseService().getStatement(connection);
try {
chStmt.runPreparedQuery("select * from osee_branch");
while (chStmt.next()) {
@@ -217,11 +217,11 @@ public class BranchDataSaxHandler extends BaseDbSaxHandler {
getMetaData().getTableName()));
}
- public void setConnection(OseeConnection connection) {
+ public void setConnection(JdbcConnection connection) {
this.connection = connection;
}
- public OseeConnection getConnection() {
+ public JdbcConnection getConnection() {
return connection;
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/handler/DbTableSaxHandler.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/handler/DbTableSaxHandler.java
index 0f31cd036c..a17910ac69 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/handler/DbTableSaxHandler.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/handler/DbTableSaxHandler.java
@@ -17,7 +17,6 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import org.eclipse.osee.framework.core.enums.ConflictType;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.type.OseeStateException;
import org.eclipse.osee.framework.jdk.core.type.PropertyStore;
@@ -26,6 +25,7 @@ import org.eclipse.osee.framework.jdk.core.util.Lib;
import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.framework.resource.management.IResourceLocator;
import org.eclipse.osee.framework.resource.management.IResourceManager;
+import org.eclipse.osee.jdbc.JdbcClient;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.db.internal.IdentityLocator;
import org.eclipse.osee.orcs.db.internal.exchange.ExchangeDb;
@@ -38,8 +38,8 @@ import org.eclipse.osee.orcs.db.internal.util.ZipBinaryResource;
*/
public class DbTableSaxHandler extends BaseDbSaxHandler {
- public static DbTableSaxHandler createWithLimitedCache(Log logger, IOseeDatabaseService dbService, IResourceManager resourceManager, IdentityLocator identityService, IOseeExchangeDataProvider exportDataProvider, int cacheLimit) {
- return new DbTableSaxHandler(logger, dbService, resourceManager, identityService, exportDataProvider, false,
+ public static DbTableSaxHandler createWithLimitedCache(Log logger, JdbcClient jdbcClient, IResourceManager resourceManager, IdentityLocator identityService, IOseeExchangeDataProvider exportDataProvider, int cacheLimit) {
+ return new DbTableSaxHandler(logger, jdbcClient, resourceManager, identityService, exportDataProvider, false,
cacheLimit);
}
@@ -51,8 +51,8 @@ public class DbTableSaxHandler extends BaseDbSaxHandler {
private final IdentityLocator identityService;
private IExportItem exportItem;
- protected DbTableSaxHandler(Log logger, IOseeDatabaseService dbService, IResourceManager resourceManager, IdentityLocator identityService, IOseeExchangeDataProvider exportDataProvider, boolean isCacheAll, int cacheLimit) {
- super(logger, dbService, isCacheAll, cacheLimit);
+ protected DbTableSaxHandler(Log logger, JdbcClient jdbcClient, IResourceManager resourceManager, IdentityLocator identityService, IOseeExchangeDataProvider exportDataProvider, boolean isCacheAll, int cacheLimit) {
+ super(logger, jdbcClient, isCacheAll, cacheLimit);
this.resourceManager = resourceManager;
this.identityService = identityService;
this.branchesToImport = new HashSet<Long>();
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/handler/MetaData.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/handler/MetaData.java
index 4c0035c225..f9ef7dcd4a 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/handler/MetaData.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/handler/MetaData.java
@@ -13,7 +13,7 @@ package org.eclipse.osee.orcs.db.internal.exchange.handler;
import java.util.Collection;
import java.util.LinkedHashMap;
import java.util.Map;
-import org.eclipse.osee.framework.database.core.SQL3DataType;
+import org.eclipse.osee.jdbc.SQL3DataType;
/**
* @author Roberto E. Escobar
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/handler/MetaDataSaxHandler.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/handler/MetaDataSaxHandler.java
index 09fec2ad40..a1cd30e424 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/handler/MetaDataSaxHandler.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/handler/MetaDataSaxHandler.java
@@ -17,13 +17,13 @@ import java.sql.Types;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
-import org.eclipse.osee.framework.database.core.OseeConnection;
-import org.eclipse.osee.framework.database.core.SQL3DataType;
-import org.eclipse.osee.framework.database.core.SupportedDatabase;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.framework.jdk.core.util.io.xml.AbstractSaxHandler;
+import org.eclipse.osee.jdbc.JdbcClient;
+import org.eclipse.osee.jdbc.JdbcConnection;
+import org.eclipse.osee.jdbc.JdbcDbType;
+import org.eclipse.osee.jdbc.SQL3DataType;
import org.eclipse.osee.orcs.db.internal.exchange.ExportImportXml;
import org.xml.sax.Attributes;
@@ -34,10 +34,10 @@ public class MetaDataSaxHandler extends AbstractSaxHandler {
private final Map<String, MetaData> importMetadataMap;
private final Map<String, MetaData> targetMetadataMap;
- private final IOseeDatabaseService service;
+ private final JdbcClient service;
private MetaData currentMetadata;
- public MetaDataSaxHandler(IOseeDatabaseService service) {
+ public MetaDataSaxHandler(JdbcClient service) {
this.service = service;
this.importMetadataMap = new HashMap<String, MetaData>();
this.targetMetadataMap = new HashMap<String, MetaData>();
@@ -98,7 +98,7 @@ public class MetaDataSaxHandler extends AbstractSaxHandler {
private Map<String, MetaData> getTargetDbMetadata() throws SQLException, OseeCoreException {
Map<String, MetaData> targetDbMetadata = new HashMap<String, MetaData>();
- OseeConnection connection = service.getConnection();
+ JdbcConnection connection = service.getConnection();
try {
DatabaseMetaData dbMetaData = connection.getMetaData();
for (String sourceTables : importMetadataMap.keySet()) {
@@ -146,7 +146,7 @@ public class MetaDataSaxHandler extends AbstractSaxHandler {
while (resultSet.next()) {
String columnId = resultSet.getString("COLUMN_NAME").toLowerCase();
int dataType = resultSet.getInt("DATA_TYPE");
- if (SupportedDatabase.isDatabaseType(dbMetaData, SupportedDatabase.foxpro)) {
+ if (JdbcDbType.isDatabaseType(dbMetaData, JdbcDbType.foxpro)) {
if (dataType == Types.CHAR) {
dataType = Types.VARCHAR;
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/transform/ExchangeTransformer.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/transform/ExchangeTransformer.java
index 5cfcfd50e3..a7944b8a0f 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/transform/ExchangeTransformer.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/transform/ExchangeTransformer.java
@@ -11,29 +11,34 @@
package org.eclipse.osee.orcs.db.internal.exchange.transform;
import java.util.Collection;
-import org.eclipse.osee.framework.core.operation.OperationLogger;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.Conditions;
import org.eclipse.osee.framework.jdk.core.util.Strings;
+import org.eclipse.osee.jdbc.JdbcClient;
+import org.eclipse.osee.logger.Log;
+import org.eclipse.osee.orcs.OrcsSession;
import org.eclipse.osee.orcs.db.internal.exchange.handler.ExportItem;
import org.osgi.framework.Version;
public class ExchangeTransformer {
- private final IOseeDatabaseService dbService;
+ private final Log logger;
+ private final OrcsSession session;
+ private final JdbcClient jdbcClient;
private final IExchangeTransformProvider provider;
private final ExchangeDataProcessor processor;
private Collection<IOseeExchangeVersionTransformer> transformers;
- public ExchangeTransformer(IOseeDatabaseService dbService, IExchangeTransformProvider provider, ExchangeDataProcessor processor) {
- this.dbService = dbService;
+ public ExchangeTransformer(Log logger, OrcsSession session, JdbcClient jdbcClient, IExchangeTransformProvider provider, ExchangeDataProcessor processor) {
+ this.logger = logger;
+ this.session = session;
+ this.jdbcClient = jdbcClient;
this.provider = provider;
this.processor = processor;
}
- public void applyTransforms(OperationLogger logger) throws Exception {
+ public void applyTransforms() throws Exception {
Version exchangeVersion = getExchangeManifestVersion();
transformers = provider.getApplicableTransformers(exchangeVersion);
@@ -48,10 +53,10 @@ public class ExchangeTransformer {
}
}
- public void applyFinalTransforms(OperationLogger logger) throws Exception {
+ public void applyFinalTransforms() throws Exception {
Conditions.checkNotNull(transformers, "transformers", "forgot to call apply transforms first");
for (IOseeExchangeVersionTransformer transform : transformers) {
- transform.finalizeTransform(dbService, processor, logger);
+ transform.finalizeTransform(logger, session, jdbcClient, processor);
}
transformers = null;
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/transform/IOseeExchangeVersionTransformer.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/transform/IOseeExchangeVersionTransformer.java
index 508dba33a8..efcdfba38b 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/transform/IOseeExchangeVersionTransformer.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/transform/IOseeExchangeVersionTransformer.java
@@ -10,9 +10,10 @@
*******************************************************************************/
package org.eclipse.osee.orcs.db.internal.exchange.transform;
-import org.eclipse.osee.framework.core.operation.OperationLogger;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.jdbc.JdbcClient;
+import org.eclipse.osee.logger.Log;
+import org.eclipse.osee.orcs.OrcsSession;
import org.osgi.framework.Version;
/**
@@ -20,9 +21,9 @@ import org.osgi.framework.Version;
*/
public interface IOseeExchangeVersionTransformer {
- public abstract Version applyTransform(ExchangeDataProcessor processor, OperationLogger logger) throws OseeCoreException;
+ public abstract Version applyTransform(ExchangeDataProcessor processor, Log logger) throws OseeCoreException;
public abstract Version getMaxVersion();
- public abstract void finalizeTransform(IOseeDatabaseService dbService, ExchangeDataProcessor processor, OperationLogger logger) throws OseeCoreException;
+ public abstract void finalizeTransform(Log logger, OrcsSession session, JdbcClient jdbcClient, ExchangeDataProcessor processor) throws OseeCoreException;
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/transform/V0_9_2Transformer.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/transform/V0_9_2Transformer.java
index a16a6936b9..2d844f5f36 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/transform/V0_9_2Transformer.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/transform/V0_9_2Transformer.java
@@ -24,18 +24,18 @@ import javax.xml.stream.XMLStreamWriter;
import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.core.enums.TxChange;
import org.eclipse.osee.framework.core.exception.OseeExceptions;
-import org.eclipse.osee.framework.core.operation.OperationLogger;
-import org.eclipse.osee.framework.core.operation.Operations;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
-import org.eclipse.osee.framework.database.operation.Address;
import org.eclipse.osee.framework.jdk.core.text.rules.ReplaceAll;
import org.eclipse.osee.framework.jdk.core.type.HashCollection;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.type.OseeStateException;
import org.eclipse.osee.framework.jdk.core.util.Lib;
+import org.eclipse.osee.jdbc.JdbcClient;
+import org.eclipse.osee.logger.Log;
+import org.eclipse.osee.orcs.OrcsSession;
import org.eclipse.osee.orcs.db.internal.exchange.ExchangeUtil;
import org.eclipse.osee.orcs.db.internal.exchange.TxCurrentsOpFactory;
import org.eclipse.osee.orcs.db.internal.exchange.handler.ExportItem;
+import org.eclipse.osee.orcs.db.internal.util.Address;
import org.osgi.framework.Version;
/**
@@ -59,7 +59,7 @@ public class V0_9_2Transformer implements IOseeExchangeVersionTransformer {
}
@Override
- public Version applyTransform(ExchangeDataProcessor processor, OperationLogger logger) throws OseeCoreException {
+ public Version applyTransform(ExchangeDataProcessor processor, Log logger) throws OseeCoreException {
List<Long> branchUuids = convertBranchTable(processor);
Map<Long, Long> artifactGammaToNetGammaId = convertArtifactAndConflicts(processor);
@@ -82,9 +82,13 @@ public class V0_9_2Transformer implements IOseeExchangeVersionTransformer {
}
@Override
- public void finalizeTransform(IOseeDatabaseService dbService, ExchangeDataProcessor processor, OperationLogger logger) throws OseeCoreException {
- Operations.executeWorkAndCheckStatus(TxCurrentsOpFactory.createTxCurrentsAndModTypesOp(dbService, logger, false));
- Operations.executeWorkAndCheckStatus(TxCurrentsOpFactory.createTxCurrentsAndModTypesOp(dbService, logger, true));
+ public void finalizeTransform(Log logger, OrcsSession session, JdbcClient jdbcClient, ExchangeDataProcessor processor) throws OseeCoreException {
+ try {
+ TxCurrentsOpFactory.createTxCurrentsAndModTypesOp(logger, session, jdbcClient, false).call();
+ TxCurrentsOpFactory.createTxCurrentsAndModTypesOp(logger, session, jdbcClient, true).call();
+ } catch (Exception ex) {
+ throw new OseeCoreException(ex);
+ }
}
private List<Long> convertBranchTable(ExchangeDataProcessor processor) throws OseeCoreException {
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/transform/V0_9_2TxsConsolidateParser.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/transform/V0_9_2TxsConsolidateParser.java
index f2785612a7..2d9c4d97e3 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/transform/V0_9_2TxsConsolidateParser.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/transform/V0_9_2TxsConsolidateParser.java
@@ -14,10 +14,10 @@ import java.util.Map;
import javax.xml.stream.XMLStreamException;
import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.core.enums.TxChange;
-import org.eclipse.osee.framework.database.operation.Address;
import org.eclipse.osee.framework.jdk.core.type.HashCollection;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.io.xml.SaxTransformer;
+import org.eclipse.osee.orcs.db.internal.util.Address;
import org.xml.sax.Attributes;
/**
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/transform/V0_9_4Transformer.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/transform/V0_9_4Transformer.java
index 72580e3573..f818d654db 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/transform/V0_9_4Transformer.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/exchange/transform/V0_9_4Transformer.java
@@ -10,8 +10,9 @@
*******************************************************************************/
package org.eclipse.osee.orcs.db.internal.exchange.transform;
-import org.eclipse.osee.framework.core.operation.OperationLogger;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
+import org.eclipse.osee.jdbc.JdbcClient;
+import org.eclipse.osee.logger.Log;
+import org.eclipse.osee.orcs.OrcsSession;
import org.osgi.framework.Version;
/**
@@ -21,7 +22,7 @@ public class V0_9_4Transformer implements IOseeExchangeVersionTransformer {
private static final Version MAX_VERSION = new Version("0.9.4");
@Override
- public Version applyTransform(ExchangeDataProcessor processor, OperationLogger logger) {
+ public Version applyTransform(ExchangeDataProcessor processor, Log logger) {
return getMaxVersion();
}
@@ -31,7 +32,7 @@ public class V0_9_4Transformer implements IOseeExchangeVersionTransformer {
}
@Override
- public void finalizeTransform(IOseeDatabaseService dbService, ExchangeDataProcessor processor, OperationLogger logger) {
+ public void finalizeTransform(Log logger, OrcsSession session, JdbcClient jdbcClient, ExchangeDataProcessor processor) {
//
}
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/DataLoaderFactoryImpl.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/DataLoaderFactoryImpl.java
index 64eb33d428..7e4fcbbc3b 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/DataLoaderFactoryImpl.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/DataLoaderFactoryImpl.java
@@ -14,10 +14,10 @@ import java.util.Arrays;
import java.util.Collection;
import org.eclipse.osee.executor.admin.HasCancellation;
import org.eclipse.osee.framework.core.data.IOseeBranch;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.Conditions;
import org.eclipse.osee.framework.jdk.core.util.Lib;
+import org.eclipse.osee.jdbc.JdbcClient;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.OrcsSession;
import org.eclipse.osee.orcs.core.ds.DataLoader;
@@ -39,14 +39,14 @@ import org.eclipse.osee.orcs.db.internal.sql.join.SqlJoinFactory;
public class DataLoaderFactoryImpl implements DataLoaderFactory {
private final Log logger;
- private final IOseeDatabaseService dbService;
+ private final JdbcClient jdbcClient;
private final SqlObjectLoader loader;
private final SqlJoinFactory joinFactory;
- public DataLoaderFactoryImpl(Log logger, IOseeDatabaseService dbService, SqlObjectLoader loader, SqlJoinFactory joinFactory) {
+ public DataLoaderFactoryImpl(Log logger, JdbcClient jdbcClient, SqlObjectLoader loader, SqlJoinFactory joinFactory) {
super();
this.logger = logger;
- this.dbService = dbService;
+ this.jdbcClient = jdbcClient;
this.loader = loader;
this.joinFactory = joinFactory;
}
@@ -69,7 +69,7 @@ public class DataLoaderFactoryImpl implements DataLoaderFactory {
if (cancellation != null) {
cancellation.checkForCancelled();
}
- count = dbService.runPreparedQueryFetchObject(-1, context.getSql(), context.getParameters().toArray());
+ count = jdbcClient.runPreparedQueryFetchObject(-1, context.getSql(), context.getParameters().toArray());
} finally {
for (AbstractJoinQuery join : context.getJoins()) {
try {
@@ -92,10 +92,10 @@ public class DataLoaderFactoryImpl implements DataLoaderFactory {
AbstractLoadExecutor executor;
if (queryContext instanceof ArtifactQuerySqlContext) {
ArtifactQuerySqlContext sqlQueryContext = adapt(ArtifactQuerySqlContext.class, queryContext);
- executor = new ArtifactQueryContextLoadExecutor(loader, dbService, joinFactory, sqlQueryContext);
+ executor = new ArtifactQueryContextLoadExecutor(loader, jdbcClient, joinFactory, sqlQueryContext);
} else {
QuerySqlContext sqlQueryContext = adapt(QuerySqlContext.class, queryContext);
- executor = new QueryContextLoadExecutor(loader, dbService, sqlQueryContext);
+ executor = new QueryContextLoadExecutor(loader, jdbcClient, sqlQueryContext);
}
Options options = OptionsUtil.createOptions();
return new DataLoaderImpl(logger, executor, options, null, null, loader, joinFactory);
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/LoadUtil.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/LoadUtil.java
index f920e863dd..6c311483e0 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/LoadUtil.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/LoadUtil.java
@@ -10,7 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.orcs.db.internal.loader;
-import org.eclipse.osee.orcs.db.internal.sql.RelationalConstants;
+import org.eclipse.osee.jdbc.JdbcConstants;
/**
* @author Roberto E. Escobar
@@ -33,8 +33,8 @@ public final class LoadUtil {
// Account for attribute and relation loading
fetchSize *= APPROXIMATE_NUMBER_OF_SUB_ITEMS;
- if (fetchSize < 0 || fetchSize > RelationalConstants.MAX_FETCH_SIZE) {
- fetchSize = RelationalConstants.MAX_FETCH_SIZE;
+ if (fetchSize < 0 || fetchSize > JdbcConstants.JDBC__MAX_FETCH_SIZE) {
+ fetchSize = JdbcConstants.JDBC__MAX_FETCH_SIZE;
}
return fetchSize;
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/LoaderModule.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/LoaderModule.java
index 361b680589..1a73b2d4c2 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/LoaderModule.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/LoaderModule.java
@@ -10,7 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.orcs.db.internal.loader;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
+import org.eclipse.osee.jdbc.JdbcClient;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.OrcsTypes;
import org.eclipse.osee.orcs.core.ds.DataFactory;
@@ -32,16 +32,16 @@ import org.eclipse.osee.orcs.db.internal.sql.join.SqlJoinFactory;
public class LoaderModule {
private final Log logger;
- private final IOseeDatabaseService dbService;
+ private final JdbcClient jdbcClient;
private final IdentityManager idFactory;
private final SqlProvider sqlProvider;
private final DataProxyFactoryProvider proxyProvider;
private final SqlJoinFactory joinFactory;
- public LoaderModule(Log logger, IOseeDatabaseService dbService, IdentityManager idFactory, SqlProvider sqlProvider, DataProxyFactoryProvider proxyProvider, SqlJoinFactory joinFactory) {
+ public LoaderModule(Log logger, JdbcClient jdbcClient, IdentityManager idFactory, SqlProvider sqlProvider, DataProxyFactoryProvider proxyProvider, SqlJoinFactory joinFactory) {
super();
this.logger = logger;
- this.dbService = dbService;
+ this.jdbcClient = jdbcClient;
this.idFactory = idFactory;
this.sqlProvider = sqlProvider;
this.proxyProvider = proxyProvider;
@@ -70,12 +70,12 @@ public class LoaderModule {
}
public DataLoaderFactory createDataLoaderFactory(SqlObjectLoader sqlObjectLoader) {
- return new DataLoaderFactoryImpl(logger, dbService, sqlObjectLoader, joinFactory);
+ return new DataLoaderFactoryImpl(logger, jdbcClient, sqlObjectLoader, joinFactory);
}
protected SqlObjectLoader createSqlObjectLoader(OrcsObjectFactory objectFactory, DynamicLoadProcessor dynamicLoadProcessor) {
SqlHandlerFactory handlerFactory = LoaderSqlHandlerFactoryUtil.createHandlerFactory(logger, idFactory);
- return new SqlObjectLoader(logger, dbService, joinFactory, sqlProvider, handlerFactory, objectFactory,
+ return new SqlObjectLoader(logger, jdbcClient, joinFactory, sqlProvider, handlerFactory, objectFactory,
dynamicLoadProcessor);
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/SqlObjectLoader.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/SqlObjectLoader.java
index 711286d714..3d5fec45f0 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/SqlObjectLoader.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/SqlObjectLoader.java
@@ -14,10 +14,10 @@ import java.util.concurrent.CancellationException;
import org.eclipse.osee.executor.admin.HasCancellation;
import org.eclipse.osee.framework.core.data.IOseeBranch;
import org.eclipse.osee.framework.core.enums.LoadLevel;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
-import org.eclipse.osee.framework.database.core.IOseeStatement;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.Lib;
+import org.eclipse.osee.jdbc.JdbcClient;
+import org.eclipse.osee.jdbc.JdbcStatement;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.OrcsSession;
import org.eclipse.osee.orcs.core.ds.ArtifactData;
@@ -66,15 +66,15 @@ public class SqlObjectLoader {
private final DynamicLoadProcessor dynamicProcessor;
private final Log logger;
- private final IOseeDatabaseService dbService;
+ private final JdbcClient jdbcClient;
private final SqlJoinFactory joinFactory;
private final SqlProvider sqlProvider;
private final SqlHandlerFactory handlerFactory;
- public SqlObjectLoader(Log logger, IOseeDatabaseService dbService, SqlJoinFactory joinFactory, SqlProvider sqlProvider, SqlHandlerFactory handlerFactory, OrcsObjectFactory objectFactory, DynamicLoadProcessor dynamicProcessor) {
+ public SqlObjectLoader(Log logger, JdbcClient jdbcClient, SqlJoinFactory joinFactory, SqlProvider sqlProvider, SqlHandlerFactory handlerFactory, OrcsObjectFactory objectFactory, DynamicLoadProcessor dynamicProcessor) {
super();
this.logger = logger;
- this.dbService = dbService;
+ this.jdbcClient = jdbcClient;
this.joinFactory = joinFactory;
this.sqlProvider = sqlProvider;
this.handlerFactory = handlerFactory;
@@ -95,8 +95,8 @@ public class SqlObjectLoader {
return sqlProvider;
}
- public IOseeDatabaseService getDatabaseService() {
- return dbService;
+ public JdbcClient getDatabaseService() {
+ return jdbcClient;
}
private void checkCancelled(HasCancellation cancellation) throws CancellationException {
@@ -242,7 +242,7 @@ public class SqlObjectLoader {
}
long startTime = System.currentTimeMillis();
- IOseeStatement chStmt = null;
+ JdbcStatement chStmt = null;
try {
chStmt = getDatabaseService().getStatement();
chStmt.runPreparedQuery(fetchSize, loadContext.getSql(), loadContext.getParameters().toArray());
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/OrcsObjectImpl.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/OrcsObjectImpl.java
index e379014757..7b2d5633c7 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/OrcsObjectImpl.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/data/OrcsObjectImpl.java
@@ -20,6 +20,7 @@ public abstract class OrcsObjectImpl<T extends Number> implements HasLocalId<T>
private T localId = null;
+ @SuppressWarnings("unchecked")
protected OrcsObjectImpl() {
super();
setLocalId((T) RelationalConstants.DEFAULT_ITEM_ID);
@@ -42,6 +43,7 @@ public abstract class OrcsObjectImpl<T extends Number> implements HasLocalId<T>
return result;
}
+ @SuppressWarnings("rawtypes")
@Override
public boolean equals(Object obj) {
if (this == obj) {
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/executors/AbstractLoadExecutor.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/executors/AbstractLoadExecutor.java
index 33f1faf665..a2933d6a3f 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/executors/AbstractLoadExecutor.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/executors/AbstractLoadExecutor.java
@@ -12,8 +12,8 @@ package org.eclipse.osee.orcs.db.internal.loader.executors;
import java.util.concurrent.CancellationException;
import org.eclipse.osee.executor.admin.HasCancellation;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.jdbc.JdbcClient;
import org.eclipse.osee.orcs.core.ds.LoadDataHandler;
import org.eclipse.osee.orcs.core.ds.Options;
import org.eclipse.osee.orcs.db.internal.loader.SqlObjectLoader;
@@ -25,18 +25,18 @@ import org.eclipse.osee.orcs.db.internal.loader.criteria.CriteriaOrcsLoad;
public abstract class AbstractLoadExecutor {
private final SqlObjectLoader loader;
- private final IOseeDatabaseService dbService;
+ private final JdbcClient jdbcClient;
- protected AbstractLoadExecutor(SqlObjectLoader loader, IOseeDatabaseService dbService) {
+ protected AbstractLoadExecutor(SqlObjectLoader loader, JdbcClient jdbcClient) {
super();
this.loader = loader;
- this.dbService = dbService;
+ this.jdbcClient = jdbcClient;
}
public abstract void load(HasCancellation cancellation, LoadDataHandler handler, CriteriaOrcsLoad criteria, Options options) throws OseeCoreException;
- protected IOseeDatabaseService getDatabaseService() {
- return dbService;
+ protected JdbcClient getJdbcClient() {
+ return jdbcClient;
}
protected SqlObjectLoader getLoader() {
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/executors/ArtifactQueryContextLoadExecutor.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/executors/ArtifactQueryContextLoadExecutor.java
index 9e03ca0ef4..6dc8b25622 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/executors/ArtifactQueryContextLoadExecutor.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/executors/ArtifactQueryContextLoadExecutor.java
@@ -12,10 +12,10 @@ package org.eclipse.osee.orcs.db.internal.loader.executors;
import java.util.List;
import org.eclipse.osee.executor.admin.HasCancellation;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
-import org.eclipse.osee.framework.database.core.IOseeStatement;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.Lib;
+import org.eclipse.osee.jdbc.JdbcClient;
+import org.eclipse.osee.jdbc.JdbcStatement;
import org.eclipse.osee.orcs.core.ds.LoadDataHandler;
import org.eclipse.osee.orcs.core.ds.Options;
import org.eclipse.osee.orcs.core.ds.OptionsUtil;
@@ -38,8 +38,8 @@ public class ArtifactQueryContextLoadExecutor extends AbstractLoadExecutor {
private final ArtifactQuerySqlContext queryContext;
private final SqlJoinFactory joinFactory;
- public ArtifactQueryContextLoadExecutor(SqlObjectLoader loader, IOseeDatabaseService dbService, SqlJoinFactory joinFactory, ArtifactQuerySqlContext queryContext) {
- super(loader, dbService);
+ public ArtifactQueryContextLoadExecutor(SqlObjectLoader loader, JdbcClient jdbcClient, SqlJoinFactory joinFactory, ArtifactQuerySqlContext queryContext) {
+ super(loader, jdbcClient);
this.queryContext = queryContext;
this.joinFactory = joinFactory;
}
@@ -48,7 +48,7 @@ public class ArtifactQueryContextLoadExecutor extends AbstractLoadExecutor {
public void load(HasCancellation cancellation, LoadDataHandler handler, CriteriaOrcsLoad criteria, Options options) throws OseeCoreException {
int fetchSize = computeFetchSize(queryContext);
- ArtifactJoinQuery join = createArtifactIdJoin(getDatabaseService(), cancellation, fetchSize);
+ ArtifactJoinQuery join = createArtifactIdJoin(getJdbcClient(), cancellation, fetchSize);
LoadSqlContext loadContext = new LoadSqlContext(queryContext.getSession(), options, queryContext.getBranch());
getLoader().loadArtifacts(cancellation, handler, join, criteria, loadContext, fetchSize);
@@ -62,7 +62,7 @@ public class ArtifactQueryContextLoadExecutor extends AbstractLoadExecutor {
return LoadUtil.computeFetchSize(fetchSize);
}
- private ArtifactJoinQuery createArtifactIdJoin(IOseeDatabaseService dbService, HasCancellation cancellation, int fetchSize) throws OseeCoreException {
+ private ArtifactJoinQuery createArtifactIdJoin(JdbcClient jdbcClient, HasCancellation cancellation, int fetchSize) throws OseeCoreException {
ArtifactJoinQuery artifactJoin = joinFactory.createArtifactJoinQuery();
try {
for (AbstractJoinQuery join : queryContext.getJoins()) {
@@ -70,9 +70,9 @@ public class ArtifactQueryContextLoadExecutor extends AbstractLoadExecutor {
checkCancelled(cancellation);
}
Integer transactionId = OptionsUtil.getFromTransaction(queryContext.getOptions());
- IOseeStatement chStmt = null;
+ JdbcStatement chStmt = null;
try {
- chStmt = dbService.getStatement();
+ chStmt = jdbcClient.getStatement();
checkCancelled(cancellation);
String query = queryContext.getSql();
List<Object> params = queryContext.getParameters();
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/executors/LoadExecutor.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/executors/LoadExecutor.java
index 34e7fb4e0f..5e7473fa8d 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/executors/LoadExecutor.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/executors/LoadExecutor.java
@@ -13,8 +13,8 @@ package org.eclipse.osee.orcs.db.internal.loader.executors;
import java.util.Collection;
import org.eclipse.osee.executor.admin.HasCancellation;
import org.eclipse.osee.framework.core.data.IOseeBranch;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.jdbc.JdbcClient;
import org.eclipse.osee.orcs.OrcsSession;
import org.eclipse.osee.orcs.core.ds.LoadDataHandler;
import org.eclipse.osee.orcs.core.ds.Options;
@@ -36,8 +36,8 @@ public class LoadExecutor extends AbstractLoadExecutor {
private final IOseeBranch branch;
private final Collection<Integer> artifactIds;
- public LoadExecutor(SqlObjectLoader loader, IOseeDatabaseService dbService, SqlJoinFactory joinFactory, OrcsSession session, IOseeBranch branch, Collection<Integer> artifactIds) {
- super(loader, dbService);
+ public LoadExecutor(SqlObjectLoader loader, JdbcClient jdbcClient, SqlJoinFactory joinFactory, OrcsSession session, IOseeBranch branch, Collection<Integer> artifactIds) {
+ super(loader, jdbcClient);
this.joinFactory = joinFactory;
this.session = session;
this.branch = branch;
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/executors/QueryContextLoadExecutor.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/executors/QueryContextLoadExecutor.java
index 6bc656bfad..e460262064 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/executors/QueryContextLoadExecutor.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/executors/QueryContextLoadExecutor.java
@@ -12,9 +12,9 @@ package org.eclipse.osee.orcs.db.internal.loader.executors;
import static org.eclipse.osee.orcs.db.internal.sql.RelationalConstants.MIN_FETCH_SIZE;
import org.eclipse.osee.executor.admin.HasCancellation;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.type.OseeStateException;
+import org.eclipse.osee.jdbc.JdbcClient;
import org.eclipse.osee.orcs.core.ds.LoadDataHandler;
import org.eclipse.osee.orcs.core.ds.Options;
import org.eclipse.osee.orcs.db.internal.loader.LoadUtil;
@@ -30,8 +30,8 @@ public class QueryContextLoadExecutor extends AbstractLoadExecutor {
private final QuerySqlContext queryContext;
- public QueryContextLoadExecutor(SqlObjectLoader loader, IOseeDatabaseService dbService, QuerySqlContext queryContext) {
- super(loader, dbService);
+ public QueryContextLoadExecutor(SqlObjectLoader loader, JdbcClient jdbcClient, QuerySqlContext queryContext) {
+ super(loader, jdbcClient);
this.queryContext = queryContext;
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/executors/UuidsLoadExecutor.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/executors/UuidsLoadExecutor.java
index 84b5ecbf0d..f87b27d081 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/executors/UuidsLoadExecutor.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/executors/UuidsLoadExecutor.java
@@ -13,10 +13,10 @@ package org.eclipse.osee.orcs.db.internal.loader.executors;
import java.util.Collection;
import org.eclipse.osee.executor.admin.HasCancellation;
import org.eclipse.osee.framework.core.data.IOseeBranch;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
-import org.eclipse.osee.framework.database.core.IOseeStatement;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.Lib;
+import org.eclipse.osee.jdbc.JdbcClient;
+import org.eclipse.osee.jdbc.JdbcStatement;
import org.eclipse.osee.orcs.OrcsSession;
import org.eclipse.osee.orcs.core.ds.LoadDataHandler;
import org.eclipse.osee.orcs.core.ds.Options;
@@ -42,8 +42,8 @@ public class UuidsLoadExecutor extends AbstractLoadExecutor {
private final IOseeBranch branch;
private final Collection<String> artifactIds;
- public UuidsLoadExecutor(SqlObjectLoader loader, IOseeDatabaseService dbService, SqlJoinFactory joinFactory, OrcsSession session, IOseeBranch branch, Collection<String> artifactIds) {
- super(loader, dbService);
+ public UuidsLoadExecutor(SqlObjectLoader loader, JdbcClient jdbcClient, SqlJoinFactory joinFactory, OrcsSession session, IOseeBranch branch, Collection<String> artifactIds) {
+ super(loader, jdbcClient);
this.joinFactory = joinFactory;
this.session = session;
this.branch = branch;
@@ -54,14 +54,14 @@ public class UuidsLoadExecutor extends AbstractLoadExecutor {
public void load(HasCancellation cancellation, LoadDataHandler handler, CriteriaOrcsLoad criteria, Options options) throws OseeCoreException {
checkCancelled(cancellation);
if (!artifactIds.isEmpty()) {
- ArtifactJoinQuery join = createIdJoin(getDatabaseService(), options);
+ ArtifactJoinQuery join = createIdJoin(getJdbcClient(), options);
LoadSqlContext loadContext = new LoadSqlContext(session, options, branch);
int fetchSize = LoadUtil.computeFetchSize(artifactIds.size());
getLoader().loadArtifacts(cancellation, handler, join, criteria, loadContext, fetchSize);
}
}
- private ArtifactJoinQuery createIdJoin(IOseeDatabaseService dbService, Options options) throws OseeCoreException {
+ private ArtifactJoinQuery createIdJoin(JdbcClient jdbcClient, Options options) throws OseeCoreException {
ArtifactJoinQuery toReturn = joinFactory.createArtifactJoinQuery();
@@ -74,9 +74,9 @@ public class UuidsLoadExecutor extends AbstractLoadExecutor {
Integer transactionId = OptionsUtil.getFromTransaction(options);
- IOseeStatement chStmt = null;
+ JdbcStatement chStmt = null;
try {
- chStmt = dbService.getStatement();
+ chStmt = jdbcClient.getStatement();
chStmt.runPreparedQuery(artifactIds.size(), GUIDS_TO_IDS, guidJoin.getQueryId());
while (chStmt.next()) {
Integer artId = chStmt.getInt("art_id");
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/processor/AbstractLoadProcessor.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/processor/AbstractLoadProcessor.java
index 6b38616c89..f89ec6b1bc 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/processor/AbstractLoadProcessor.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/processor/AbstractLoadProcessor.java
@@ -10,8 +10,8 @@
*******************************************************************************/
package org.eclipse.osee.orcs.db.internal.loader.processor;
-import org.eclipse.osee.framework.database.core.IOseeStatement;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.jdbc.JdbcStatement;
import org.eclipse.osee.orcs.core.ds.Options;
/**
@@ -19,7 +19,7 @@ import org.eclipse.osee.orcs.core.ds.Options;
*/
public abstract class AbstractLoadProcessor<H> {
- public final int processResultSet(H handler, IOseeStatement chStmt, Options options) throws OseeCoreException {
+ public final int processResultSet(H handler, JdbcStatement chStmt, Options options) throws OseeCoreException {
int rowCount = 0;
Object conditions = createPreConditions(options);
while (chStmt.next()) {
@@ -34,7 +34,7 @@ public abstract class AbstractLoadProcessor<H> {
return null;
}
- protected abstract void onRow(H handler, IOseeStatement chStmt, Options options, Object conditions);
+ protected abstract void onRow(H handler, JdbcStatement chStmt, Options options, Object conditions);
protected void onEnd(H handler, Options options, Object conditions, int rowCount) {
// do nothing;
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 1ee8ce7627..ae6cb8ffe8 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
@@ -11,8 +11,8 @@
package org.eclipse.osee.orcs.db.internal.loader.processor;
import org.eclipse.osee.framework.core.enums.ModificationType;
-import org.eclipse.osee.framework.database.core.IOseeStatement;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.jdbc.JdbcStatement;
import org.eclipse.osee.orcs.core.ds.ArtifactData;
import org.eclipse.osee.orcs.core.ds.Options;
import org.eclipse.osee.orcs.core.ds.OptionsUtil;
@@ -29,7 +29,7 @@ public class ArtifactLoadProcessor extends LoadProcessor<ArtifactData, ArtifactO
}
@Override
- protected ArtifactData createData(Object conditions, ArtifactObjectFactory factory, IOseeStatement chStmt, Options options) throws OseeCoreException {
+ protected ArtifactData createData(Object conditions, ArtifactObjectFactory factory, JdbcStatement chStmt, Options options) throws OseeCoreException {
ArtifactData toReturn = null;
int artifactId = chStmt.getInt("art_id");
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 4eacb7af47..5e682e0147 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
@@ -11,8 +11,8 @@
package org.eclipse.osee.orcs.db.internal.loader.processor;
import org.eclipse.osee.framework.core.enums.ModificationType;
-import org.eclipse.osee.framework.database.core.IOseeStatement;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.jdbc.JdbcStatement;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.core.ds.AttributeData;
import org.eclipse.osee.orcs.core.ds.Options;
@@ -33,7 +33,7 @@ public class AttributeLoadProcessor extends LoadProcessor<AttributeData, Attribu
}
@Override
- protected AttributeData createData(Object conditions, AttributeObjectFactory factory, IOseeStatement chStmt, Options options) throws OseeCoreException {
+ protected AttributeData createData(Object conditions, AttributeObjectFactory factory, JdbcStatement chStmt, Options options) throws OseeCoreException {
AttributeData toReturn = null;
long branchUuid = chStmt.getLong("branch_id");
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/processor/BranchLoadProcessor.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/processor/BranchLoadProcessor.java
index c604bc9246..c991f53f46 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/processor/BranchLoadProcessor.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/processor/BranchLoadProcessor.java
@@ -13,8 +13,8 @@ package org.eclipse.osee.orcs.db.internal.loader.processor;
import org.eclipse.osee.framework.core.enums.BranchArchivedState;
import org.eclipse.osee.framework.core.enums.BranchState;
import org.eclipse.osee.framework.core.enums.BranchType;
-import org.eclipse.osee.framework.database.core.IOseeStatement;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.jdbc.JdbcStatement;
import org.eclipse.osee.orcs.core.ds.BranchData;
import org.eclipse.osee.orcs.core.ds.Options;
import org.eclipse.osee.orcs.db.internal.loader.data.BranchObjectFactory;
@@ -29,7 +29,7 @@ public class BranchLoadProcessor extends LoadProcessor<BranchData, BranchObjectF
}
@Override
- protected BranchData createData(Object conditions, BranchObjectFactory factory, IOseeStatement chStmt, Options options) throws OseeCoreException {
+ protected BranchData createData(Object conditions, BranchObjectFactory factory, JdbcStatement chStmt, Options options) throws OseeCoreException {
long branchUuid = chStmt.getLong("branch_id");
String branchName = chStmt.getString("branch_name");
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/processor/DynamicLoadProcessor.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/processor/DynamicLoadProcessor.java
index ba1bf56900..beca9c882d 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/processor/DynamicLoadProcessor.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/processor/DynamicLoadProcessor.java
@@ -18,7 +18,7 @@ import org.eclipse.osee.framework.core.enums.BranchType;
import org.eclipse.osee.framework.core.enums.ModificationType;
import org.eclipse.osee.framework.core.enums.TransactionDetailsType;
import org.eclipse.osee.framework.core.enums.TxChange;
-import org.eclipse.osee.framework.database.core.IOseeStatement;
+import org.eclipse.osee.jdbc.JdbcStatement;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.OrcsTypes;
import org.eclipse.osee.orcs.core.ds.DataProxy;
@@ -58,7 +58,7 @@ public class DynamicLoadProcessor extends AbstractLoadProcessor<DynamicDataHandl
}
@Override
- protected void onRow(DynamicDataHandler handler, IOseeStatement chStmt, Options options, Object conditions) {
+ protected void onRow(DynamicDataHandler handler, JdbcStatement chStmt, Options options, Object conditions) {
DynamicObjectBuilder builder = getBuilder(handler, conditions);
for (DynamicData data : builder.getDescriptors()) {
processData(chStmt, builder, data);
@@ -72,7 +72,7 @@ public class DynamicLoadProcessor extends AbstractLoadProcessor<DynamicDataHandl
}
}
- private void processData(IOseeStatement chStmt, DynamicObjectBuilder builder, DynamicData data) {
+ private void processData(JdbcStatement chStmt, DynamicObjectBuilder builder, DynamicData data) {
if (data instanceof DynamicObject) {
DynamicObject dynamicObject = (DynamicObject) data;
builder.onDynamicObjectStart(dynamicObject);
@@ -92,7 +92,7 @@ public class DynamicLoadProcessor extends AbstractLoadProcessor<DynamicDataHandl
}
}
- private Object getValue(IOseeStatement chStmt, ObjectField field, String columnName) {
+ private Object getValue(JdbcStatement chStmt, ObjectField field, String columnName) {
Object object = chStmt.getObject(columnName);
switch (field) {
case branch_type:
@@ -121,14 +121,14 @@ public class DynamicLoadProcessor extends AbstractLoadProcessor<DynamicDataHandl
return object;
}
- private void processCompositeField(IOseeStatement chStmt, DynamicObjectBuilder builder, DynamicData data) {
+ private void processCompositeField(JdbcStatement chStmt, DynamicObjectBuilder builder, DynamicData data) {
Collection<String> columnIds = SqlFieldResolver.getColumnUniqueIds(data);
Object value = getProxyData(chStmt, columnIds);
builder.onDynamicField(data, data.getName(), value);
}
- private DataProxy getProxyData(IOseeStatement chStmt, Collection<String> columnIds) {
+ private DataProxy getProxyData(JdbcStatement chStmt, Collection<String> columnIds) {
String typeColumnName = null;
String uriColumnName = null;
String valueColumnName = null;
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/processor/LoadProcessor.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/processor/LoadProcessor.java
index d13afb2462..8ad2f746d9 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/processor/LoadProcessor.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/processor/LoadProcessor.java
@@ -10,8 +10,8 @@
*******************************************************************************/
package org.eclipse.osee.orcs.db.internal.loader.processor;
-import org.eclipse.osee.framework.database.core.IOseeStatement;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.jdbc.JdbcStatement;
import org.eclipse.osee.orcs.core.ds.Options;
import org.eclipse.osee.orcs.core.ds.OrcsDataHandler;
import org.eclipse.osee.orcs.db.internal.loader.data.OrcsDataFactory;
@@ -28,13 +28,13 @@ public abstract class LoadProcessor<D, F extends OrcsDataFactory> extends Abstra
}
@Override
- protected final void onRow(OrcsDataHandler<D> handler, IOseeStatement chStmt, Options options, Object conditions) {
+ protected final void onRow(OrcsDataHandler<D> handler, JdbcStatement chStmt, Options options, Object conditions) {
D data = createData(conditions, factory, chStmt, options);
if (data != null) {
handler.onData(data);
}
}
- protected abstract D createData(Object conditions, F factory, IOseeStatement chStmt, Options options) throws OseeCoreException;
+ protected abstract D createData(Object conditions, F factory, JdbcStatement chStmt, Options options) throws OseeCoreException;
}
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 1f1731765e..ef2c3bbbaa 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
@@ -11,8 +11,8 @@
package org.eclipse.osee.orcs.db.internal.loader.processor;
import org.eclipse.osee.framework.core.enums.ModificationType;
-import org.eclipse.osee.framework.database.core.IOseeStatement;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.jdbc.JdbcStatement;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.core.ds.Options;
import org.eclipse.osee.orcs.core.ds.OptionsUtil;
@@ -33,7 +33,7 @@ public class RelationLoadProcessor extends LoadProcessor<RelationData, RelationO
}
@Override
- protected RelationData createData(Object conditions, RelationObjectFactory factory, IOseeStatement chStmt, Options options) throws OseeCoreException {
+ protected RelationData createData(Object conditions, RelationObjectFactory factory, JdbcStatement chStmt, Options options) throws OseeCoreException {
RelationData toReturn = null;
long branchUuid = chStmt.getLong("branch_id");
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/processor/TransactionLoadProcessor.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/processor/TransactionLoadProcessor.java
index 5317bc6d1d..7f8665e67c 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/processor/TransactionLoadProcessor.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/loader/processor/TransactionLoadProcessor.java
@@ -12,8 +12,8 @@ package org.eclipse.osee.orcs.db.internal.loader.processor;
import java.util.Date;
import org.eclipse.osee.framework.core.enums.TransactionDetailsType;
-import org.eclipse.osee.framework.database.core.IOseeStatement;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.jdbc.JdbcStatement;
import org.eclipse.osee.orcs.core.ds.Options;
import org.eclipse.osee.orcs.core.ds.TxOrcsData;
import org.eclipse.osee.orcs.db.internal.loader.data.TransactionObjectFactory;
@@ -28,7 +28,7 @@ public class TransactionLoadProcessor extends LoadProcessor<TxOrcsData, Transact
}
@Override
- protected TxOrcsData createData(Object conditions, TransactionObjectFactory factory, IOseeStatement chStmt, Options options) throws OseeCoreException {
+ protected TxOrcsData createData(Object conditions, TransactionObjectFactory factory, JdbcStatement chStmt, Options options) throws OseeCoreException {
long branchUuid = chStmt.getLong("branch_id");
int localId = chStmt.getInt("transaction_id");
TransactionDetailsType type = TransactionDetailsType.toEnum(chStmt.getInt("tx_type"));
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/proxy/VarCharDataProxy.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/proxy/VarCharDataProxy.java
index f8374e0145..09a40d2b69 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/proxy/VarCharDataProxy.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/proxy/VarCharDataProxy.java
@@ -10,10 +10,10 @@
*******************************************************************************/
package org.eclipse.osee.orcs.db.internal.proxy;
+import static org.eclipse.osee.jdbc.JdbcConstants.JDBC__MAX_VARCHAR_LENGTH;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import org.eclipse.osee.framework.core.exception.OseeExceptions;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.Conditions;
import org.eclipse.osee.framework.jdk.core.util.Lib;
@@ -77,7 +77,7 @@ public class VarCharDataProxy extends AbstractDataProxy implements CharacterData
}
private void storeValue(String value) throws OseeCoreException {
- if (value != null && value.length() > IOseeDatabaseService.MAX_VARCHAR_LENGTH) {
+ if (value != null && value.length() > JDBC__MAX_VARCHAR_LENGTH) {
ResourceNameResolver resolver = getResolver();
Conditions.checkNotNull(resolver, "ResourceNameResolver", "Unable to determine internal file name");
try {
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/resource/OseeDatastoreSchemaResource.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/resource/OseeDatastoreSchemaResource.java
index 758531ce7e..aaa60b2944 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/resource/OseeDatastoreSchemaResource.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/resource/OseeDatastoreSchemaResource.java
@@ -15,13 +15,14 @@ import java.io.InputStream;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
-import org.eclipse.osee.database.schema.SchemaResource;
import org.eclipse.osee.framework.core.exception.OseeExceptions;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.jdbc.JdbcClientConfig;
+import org.eclipse.osee.jdbc.JdbcSchemaResource;
import org.osgi.framework.Bundle;
import org.osgi.framework.FrameworkUtil;
-public class OseeDatastoreSchemaResource implements SchemaResource {
+public class OseeDatastoreSchemaResource implements JdbcSchemaResource {
private static final String FILE_PATH = "schema/SKYNET.VERSIONING.SCHEMA.xml";
@@ -38,7 +39,7 @@ public class OseeDatastoreSchemaResource implements SchemaResource {
}
@Override
- public boolean isApplicable() {
+ public boolean isApplicable(JdbcClientConfig config) {
return true;
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/Engines.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/Engines.java
index deb8c27f30..4c25c436b6 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/Engines.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/Engines.java
@@ -18,9 +18,9 @@ import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
import org.eclipse.osee.executor.admin.ExecutorAdmin;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.resource.management.IResourceManager;
+import org.eclipse.osee.jdbc.JdbcClient;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.core.ds.BranchData;
import org.eclipse.osee.orcs.core.ds.DataLoaderFactory;
@@ -151,12 +151,12 @@ public final class Engines {
handlerFactory, ObjectQueryType.TX);
}
- public static QueryEngineIndexer newIndexingEngine(Log logger, IOseeDatabaseService dbService, SqlJoinFactory sqlJoinFactory, TaggingEngine taggingEngine, ExecutorAdmin executorAdmin, IResourceManager resourceManager) {
- IndexedResourceLoader resourceLoader = new GammaQueueIndexerDataSourceLoader(logger, dbService, resourceManager);
+ public static QueryEngineIndexer newIndexingEngine(Log logger, JdbcClient jdbcClient, SqlJoinFactory sqlJoinFactory, TaggingEngine taggingEngine, ExecutorAdmin executorAdmin, IResourceManager resourceManager) {
+ IndexedResourceLoader resourceLoader = new GammaQueueIndexerDataSourceLoader(logger, jdbcClient, resourceManager);
IndexerCallableFactory callableFactory =
- new IndexerCallableFactoryImpl(logger, dbService, taggingEngine, resourceLoader);
+ new IndexerCallableFactoryImpl(logger, jdbcClient, taggingEngine, resourceLoader);
IndexingTaskConsumer indexConsumer = new IndexingTaskConsumerImpl(executorAdmin, callableFactory);
- return new QueryEngineIndexerImpl(logger, dbService, sqlJoinFactory, indexConsumer);
+ return new QueryEngineIndexerImpl(logger, jdbcClient, sqlJoinFactory, indexConsumer);
}
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/QueryModule.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/QueryModule.java
index 5e3929da66..c3d7d9cc60 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/QueryModule.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/QueryModule.java
@@ -17,8 +17,8 @@ import static org.eclipse.osee.orcs.db.internal.search.Engines.newQueryEngine;
import static org.eclipse.osee.orcs.db.internal.search.Engines.newTaggingEngine;
import static org.eclipse.osee.orcs.db.internal.search.Engines.newTxQueryEngine;
import org.eclipse.osee.executor.admin.ExecutorAdmin;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
import org.eclipse.osee.framework.resource.management.IResourceManager;
+import org.eclipse.osee.jdbc.JdbcClient;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.core.ds.DataLoaderFactory;
import org.eclipse.osee.orcs.core.ds.QueryEngine;
@@ -38,7 +38,7 @@ public class QueryModule {
private final Log logger;
private final ExecutorAdmin executorAdmin;
- private final IOseeDatabaseService dbService;
+ private final JdbcClient jdbcClient;
private final IdentityLocator idService;
private final SqlProvider sqlProvider;
private final SqlJoinFactory sqlJoinFactory;
@@ -46,11 +46,11 @@ public class QueryModule {
private TaggingEngine taggingEngine;
private QueryEngineIndexer queryIndexer;
- public QueryModule(Log logger, ExecutorAdmin executorAdmin, IOseeDatabaseService dbService, SqlJoinFactory sqlJoinFactory, IdentityLocator idService, SqlProvider sqlProvider) {
+ public QueryModule(Log logger, ExecutorAdmin executorAdmin, JdbcClient jdbcClient, SqlJoinFactory sqlJoinFactory, IdentityLocator idService, SqlProvider sqlProvider) {
super();
this.logger = logger;
this.executorAdmin = executorAdmin;
- this.dbService = dbService;
+ this.jdbcClient = jdbcClient;
this.sqlJoinFactory = sqlJoinFactory;
this.idService = idService;
this.sqlProvider = sqlProvider;
@@ -59,7 +59,7 @@ public class QueryModule {
public void startIndexer(IResourceManager resourceManager) throws Exception {
taggingEngine = newTaggingEngine(logger);
queryIndexer =
- newIndexingEngine(logger, dbService, sqlJoinFactory, taggingEngine, executorAdmin, resourceManager);
+ newIndexingEngine(logger, jdbcClient, sqlJoinFactory, taggingEngine, executorAdmin, resourceManager);
executorAdmin.createFixedPoolExecutor(IndexerConstants.INDEXING_CONSUMER_EXECUTOR_ID, 4);
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/indexer/IndexerCallableFactoryImpl.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/indexer/IndexerCallableFactoryImpl.java
index 8eda86cd8a..a42bcc89ca 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/indexer/IndexerCallableFactoryImpl.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/indexer/IndexerCallableFactoryImpl.java
@@ -11,7 +11,7 @@
package org.eclipse.osee.orcs.db.internal.search.indexer;
import java.util.concurrent.Callable;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
+import org.eclipse.osee.jdbc.JdbcClient;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.OrcsSession;
import org.eclipse.osee.orcs.data.AttributeTypes;
@@ -25,21 +25,21 @@ import org.eclipse.osee.orcs.search.IndexerCollector;
public class IndexerCallableFactoryImpl implements IndexerCallableFactory {
private final Log logger;
- private final IOseeDatabaseService dbService;
+ private final JdbcClient jdbcClient;
private final TaggingEngine taggingEngine;
private final IndexedResourceLoader loader;
- public IndexerCallableFactoryImpl(Log logger, IOseeDatabaseService dbService, TaggingEngine taggingEngine, IndexedResourceLoader loader) {
+ public IndexerCallableFactoryImpl(Log logger, JdbcClient jdbcClient, TaggingEngine taggingEngine, IndexedResourceLoader loader) {
super();
this.logger = logger;
- this.dbService = dbService;
+ this.jdbcClient = jdbcClient;
this.taggingEngine = taggingEngine;
this.loader = loader;
}
@Override
public Callable<?> createIndexerTaskCallable(OrcsSession session, AttributeTypes types, IndexerCollector collector, int queueId) {
- return new IndexingTaskDatabaseTxCallable(logger, session, dbService, loader, taggingEngine, collector, queueId,
+ return new IndexingTaskDatabaseTxCallable(logger, session, jdbcClient, loader, taggingEngine, collector, queueId,
IndexerConstants.INDEXER_CACHE_ALL_ITEMS, IndexerConstants.INDEXER_CACHE_LIMIT, types);
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/indexer/QueryEngineIndexerImpl.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/indexer/QueryEngineIndexerImpl.java
index 988d5ba604..22264044c7 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/indexer/QueryEngineIndexerImpl.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/indexer/QueryEngineIndexerImpl.java
@@ -17,7 +17,7 @@ import java.util.Set;
import java.util.concurrent.Future;
import org.eclipse.osee.executor.admin.CancellableCallable;
import org.eclipse.osee.framework.core.data.IAttributeType;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
+import org.eclipse.osee.jdbc.JdbcClient;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.OrcsSession;
import org.eclipse.osee.orcs.core.ds.HasVersion;
@@ -41,15 +41,15 @@ import org.eclipse.osee.orcs.search.IndexerCollector;
public class QueryEngineIndexerImpl implements QueryEngineIndexer {
private final Log logger;
- private final IOseeDatabaseService dbService;
+ private final JdbcClient jdbcClient;
private final SqlJoinFactory joinFactory;
private final IndexingTaskConsumer consumer;
private final IndexerCollectorNotifier systemCollector;
- public QueryEngineIndexerImpl(Log logger, IOseeDatabaseService dbService, SqlJoinFactory joinFactory, IndexingTaskConsumer indexingConsumer) {
+ public QueryEngineIndexerImpl(Log logger, JdbcClient jdbcClient, SqlJoinFactory joinFactory, IndexingTaskConsumer indexingConsumer) {
this.logger = logger;
- this.dbService = dbService;
+ this.jdbcClient = jdbcClient;
this.joinFactory = joinFactory;
this.consumer = indexingConsumer;
this.systemCollector = new IndexerCollectorNotifier(logger);
@@ -57,39 +57,39 @@ public class QueryEngineIndexerImpl implements QueryEngineIndexer {
@Override
public CancellableCallable<Integer> deleteIndexByQueryId(OrcsSession session, int queueId) {
- return new DeleteTagSetDatabaseTxCallable(logger, session, dbService, queueId);
+ return new DeleteTagSetDatabaseTxCallable(logger, session, jdbcClient, queueId);
}
@Override
public CancellableCallable<Integer> purgeAllIndexes(OrcsSession session) {
- return new PurgeAllTagsDatabaseCallable(logger, session, dbService);
+ return new PurgeAllTagsDatabaseCallable(logger, session, jdbcClient);
}
@Override
public CancellableCallable<IndexerData> getIndexerData(OrcsSession session) {
- return new IndexerDatabaseStatisticsCallable(logger, session, dbService);
+ return new IndexerDatabaseStatisticsCallable(logger, session, jdbcClient);
}
@Override
public CancellableCallable<Integer> indexBranches(OrcsSession session, AttributeTypes types, Collection<? extends IAttributeType> typeToTag, Set<BranchReadable> branches, boolean indexOnlyMissing, IndexerCollector... collector) {
- return new IndexBranchesDatabaseCallable(logger, session, dbService, joinFactory, types, consumer,
+ return new IndexBranchesDatabaseCallable(logger, session, jdbcClient, joinFactory, types, consumer,
merge(collector), typeToTag, branches, indexOnlyMissing);
}
@Override
public CancellableCallable<Integer> indexAllFromQueue(OrcsSession session, AttributeTypes types, IndexerCollector... collector) {
- return new IndexAllInQueueCallable(logger, session, dbService, joinFactory, types, consumer, merge(collector));
+ return new IndexAllInQueueCallable(logger, session, jdbcClient, joinFactory, types, consumer, merge(collector));
}
@Override
public CancellableCallable<List<Future<?>>> indexXmlStream(OrcsSession session, AttributeTypes types, InputStream inputStream, IndexerCollector... collector) {
- return new XmlStreamIndexerDatabaseCallable(logger, session, dbService, joinFactory, types, consumer,
+ return new XmlStreamIndexerDatabaseCallable(logger, session, jdbcClient, joinFactory, types, consumer,
merge(collector), IndexerConstants.INDEXER_CACHE_ALL_ITEMS, IndexerConstants.INDEXER_CACHE_LIMIT, inputStream);
}
@Override
public CancellableCallable<List<Future<?>>> indexResources(OrcsSession session, AttributeTypes types, Iterable<? extends HasVersion> datas, IndexerCollector... collector) {
- return new IndexerDatabaseCallable(logger, session, dbService, joinFactory, types, consumer, merge(collector),
+ return new IndexerDatabaseCallable(logger, session, jdbcClient, joinFactory, types, consumer, merge(collector),
IndexerConstants.INDEXER_CACHE_ALL_ITEMS, IndexerConstants.INDEXER_CACHE_LIMIT, datas);
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/indexer/callable/DeleteTagSetDatabaseTxCallable.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/indexer/callable/DeleteTagSetDatabaseTxCallable.java
index 3ab49f320d..ad5f68c685 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/indexer/callable/DeleteTagSetDatabaseTxCallable.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/indexer/callable/DeleteTagSetDatabaseTxCallable.java
@@ -12,10 +12,10 @@ package org.eclipse.osee.orcs.db.internal.search.indexer.callable;
import java.util.ArrayList;
import java.util.List;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
-import org.eclipse.osee.framework.database.core.IOseeStatement;
-import org.eclipse.osee.framework.database.core.OseeConnection;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.jdbc.JdbcClient;
+import org.eclipse.osee.jdbc.JdbcConnection;
+import org.eclipse.osee.jdbc.JdbcStatement;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.OrcsSession;
import org.eclipse.osee.orcs.db.internal.callable.AbstractDatastoreTxCallable;
@@ -32,15 +32,15 @@ public final class DeleteTagSetDatabaseTxCallable extends AbstractDatastoreTxCal
private final int queryId;
- public DeleteTagSetDatabaseTxCallable(Log logger, OrcsSession session, IOseeDatabaseService dbService, int queryId) {
- super(logger, session, dbService, "Delete Indexer Tags Database Transaction");
+ public DeleteTagSetDatabaseTxCallable(Log logger, OrcsSession session, JdbcClient jdbcClient, int queryId) {
+ super(logger, session, jdbcClient);
this.queryId = queryId;
}
@Override
- protected Integer handleTxWork(OseeConnection connection) throws OseeCoreException {
+ protected Integer handleTxWork(JdbcConnection connection) throws OseeCoreException {
int numberDeleted = 0;
- IOseeStatement chStmt = getDatabaseService().getStatement(connection);
+ JdbcStatement chStmt = getJdbcClient().getStatement(connection);
try {
chStmt.runPreparedQuery(SELECT_GAMMAS_FROM_TX_JOIN, queryId);
List<Object[]> datas = new ArrayList<Object[]>();
@@ -48,7 +48,7 @@ public final class DeleteTagSetDatabaseTxCallable extends AbstractDatastoreTxCal
datas.add(new Object[] {chStmt.getLong("gamma_id")});
}
if (!datas.isEmpty()) {
- numberDeleted = getDatabaseService().runBatchUpdate(connection, DELETE_SEARCH_TAGS, datas);
+ numberDeleted = getJdbcClient().runBatchUpdate(connection, DELETE_SEARCH_TAGS, datas);
}
} finally {
chStmt.close();
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/indexer/callable/IndexerDatabaseStatisticsCallable.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/indexer/callable/IndexerDatabaseStatisticsCallable.java
index 604a33d5d8..c4ab066b50 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/indexer/callable/IndexerDatabaseStatisticsCallable.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/indexer/callable/IndexerDatabaseStatisticsCallable.java
@@ -10,7 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.orcs.db.internal.search.indexer.callable;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
+import org.eclipse.osee.jdbc.JdbcClient;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.OrcsSession;
import org.eclipse.osee.orcs.core.ds.IndexerData;
@@ -26,17 +26,16 @@ public class IndexerDatabaseStatisticsCallable extends AbstractDatastoreCallable
private static final String SELECT_TOTAL_QUERY_IDS_IN_QUEUE =
"select count(DISTINCT query_id) from osee_tag_gamma_queue";
- public IndexerDatabaseStatisticsCallable(Log logger, OrcsSession session, IOseeDatabaseService service) {
- super(logger, session, service);
+ public IndexerDatabaseStatisticsCallable(Log logger, OrcsSession session, JdbcClient jdbcClient) {
+ super(logger, session, jdbcClient);
}
@Override
public IndexerData call() throws Exception {
IndexerData indexerData = new IndexerData();
- indexerData.setTotalItemsInQueue(getDatabaseService().runPreparedQueryFetchObject(-1L,
- SELECT_TOTAL_QUERY_IDS_IN_QUEUE));
- indexerData.setTotalTags(getDatabaseService().runPreparedQueryFetchObject(-1L, SELECT_TOTAL_TAGS));
+ indexerData.setTotalItemsInQueue(getJdbcClient().runPreparedQueryFetchObject(-1L, SELECT_TOTAL_QUERY_IDS_IN_QUEUE));
+ indexerData.setTotalTags(getJdbcClient().runPreparedQueryFetchObject(-1L, SELECT_TOTAL_TAGS));
return indexerData;
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/indexer/callable/PurgeAllTagsDatabaseCallable.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/indexer/callable/PurgeAllTagsDatabaseCallable.java
index 033934f00a..35774a1ab1 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/indexer/callable/PurgeAllTagsDatabaseCallable.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/indexer/callable/PurgeAllTagsDatabaseCallable.java
@@ -13,9 +13,9 @@ package org.eclipse.osee.orcs.db.internal.search.indexer.callable;
import java.sql.DatabaseMetaData;
import java.sql.ResultSet;
import java.sql.SQLException;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
-import org.eclipse.osee.framework.database.core.OseeConnection;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.jdbc.JdbcClient;
+import org.eclipse.osee.jdbc.JdbcConnection;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.OrcsSession;
import org.eclipse.osee.orcs.db.internal.callable.AbstractDatastoreCallable;
@@ -27,8 +27,8 @@ public final class PurgeAllTagsDatabaseCallable extends AbstractDatastoreCallabl
private static final String SEARCH_TAG_TABLE_NAME = "osee_search_tags";
- public PurgeAllTagsDatabaseCallable(Log logger, OrcsSession session, IOseeDatabaseService service) {
- super(logger, session, service);
+ public PurgeAllTagsDatabaseCallable(Log logger, OrcsSession session, JdbcClient jdbcClient) {
+ super(logger, session, jdbcClient);
}
@Override
@@ -37,7 +37,7 @@ public final class PurgeAllTagsDatabaseCallable extends AbstractDatastoreCallabl
String cmd = isTruncateSupported() ? "TRUNCATE TABLE" : "DELETE FROM";
String deleteSql = String.format("%s %s", cmd, SEARCH_TAG_TABLE_NAME);
try {
- return getDatabaseService().runPreparedUpdate(deleteSql);
+ return getJdbcClient().runPreparedUpdate(deleteSql);
} catch (OseeCoreException ex) {
getLogger().info(ex, "Error clearing: %s", deleteSql);
throw ex;
@@ -46,7 +46,7 @@ public final class PurgeAllTagsDatabaseCallable extends AbstractDatastoreCallabl
private boolean isTruncateSupported() throws OseeCoreException {
boolean isTruncateSupported = false;
- OseeConnection connection = getDatabaseService().getConnection();
+ JdbcConnection connection = getJdbcClient().getConnection();
try {
DatabaseMetaData metaData = connection.getMetaData();
ResultSet resultSet = null;
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/indexer/callable/consumer/IndexingTaskDatabaseTxCallable.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/indexer/callable/consumer/IndexingTaskDatabaseTxCallable.java
index e2d0e169e5..cb363bd8ad 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/indexer/callable/consumer/IndexingTaskDatabaseTxCallable.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/indexer/callable/consumer/IndexingTaskDatabaseTxCallable.java
@@ -20,9 +20,9 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import org.eclipse.osee.framework.core.data.IAttributeType;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
-import org.eclipse.osee.framework.database.core.OseeConnection;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.jdbc.JdbcClient;
+import org.eclipse.osee.jdbc.JdbcConnection;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.OrcsSession;
import org.eclipse.osee.orcs.core.ds.IndexedResource;
@@ -58,8 +58,8 @@ public final class IndexingTaskDatabaseTxCallable extends AbstractDatastoreTxCal
private long startTime;
private long waitTime;
- public IndexingTaskDatabaseTxCallable(Log logger, OrcsSession session, IOseeDatabaseService dbService, IndexedResourceLoader loader, TaggingEngine taggingEngine, IndexerCollector collector, int tagQueueQueryId, boolean isCacheAll, int cacheLimit, AttributeTypes attributeTypes) {
- super(logger, session, dbService, "Attribute to Tag Database Transaction");
+ public IndexingTaskDatabaseTxCallable(Log logger, OrcsSession session, JdbcClient jdbcClient, IndexedResourceLoader loader, TaggingEngine taggingEngine, IndexerCollector collector, int tagQueueQueryId, boolean isCacheAll, int cacheLimit, AttributeTypes attributeTypes) {
+ super(logger, session, jdbcClient);
waitStartTime = System.currentTimeMillis();
this.loader = loader;
@@ -86,7 +86,7 @@ public final class IndexingTaskDatabaseTxCallable extends AbstractDatastoreTxCal
}
@Override
- protected Long handleTxWork(OseeConnection connection) throws OseeCoreException {
+ protected Long handleTxWork(JdbcConnection connection) throws OseeCoreException {
getLogger().debug("Tagging: [%s]", getTagQueueQueryId());
long totalTags = -1;
try {
@@ -116,7 +116,7 @@ public final class IndexingTaskDatabaseTxCallable extends AbstractDatastoreTxCal
return attributeTypes.getTaggerId(type);
}
- private long createTags(OseeConnection connection, Collection<IndexedResource> sources) throws OseeCoreException {
+ private long createTags(JdbcConnection connection, Collection<IndexedResource> sources) throws OseeCoreException {
SearchTagCollector tagCollector = new SearchTagCollector();
Set<Long> processed = new HashSet<Long>();
@@ -183,8 +183,8 @@ public final class IndexingTaskDatabaseTxCallable extends AbstractDatastoreTxCal
}
}
- private void removeIndexingTaskFromQueue(OseeConnection connection) throws OseeCoreException {
- getDatabaseService().runPreparedUpdate(connection, JoinItem.TAG_GAMMA_QUEUE.getDeleteSql(), getTagQueueQueryId());
+ private void removeIndexingTaskFromQueue(JdbcConnection connection) throws OseeCoreException {
+ getJdbcClient().runPreparedUpdate(connection, JoinItem.TAG_GAMMA_QUEUE.getDeleteSql(), getTagQueueQueryId());
}
private boolean isStorageAllowed(Map<Long, Collection<Long>> searchTags) {
@@ -200,19 +200,19 @@ public final class IndexingTaskDatabaseTxCallable extends AbstractDatastoreTxCal
return needsStorage;
}
- public int deleteTags(OseeConnection connection, Collection<IndexedResource> sources) throws OseeCoreException {
+ public int deleteTags(JdbcConnection connection, Collection<IndexedResource> sources) throws OseeCoreException {
int numberDeleted = 0;
if (!sources.isEmpty()) {
List<Object[]> datas = new ArrayList<Object[]>();
for (IndexedResource source : sources) {
datas.add(new Object[] {source.getGammaId()});
}
- numberDeleted = getDatabaseService().runBatchUpdate(connection, DELETE_SEARCH_TAGS, datas);
+ numberDeleted = getJdbcClient().runBatchUpdate(connection, DELETE_SEARCH_TAGS, datas);
}
return numberDeleted;
}
- private int storeTags(OseeConnection connection, Map<Long, Collection<Long>> toStore) throws OseeCoreException {
+ private int storeTags(JdbcConnection connection, Map<Long, Collection<Long>> toStore) throws OseeCoreException {
int updated = 0;
if (!toStore.isEmpty()) {
List<Object[]> data = new ArrayList<Object[]>();
@@ -225,7 +225,7 @@ public final class IndexingTaskDatabaseTxCallable extends AbstractDatastoreTxCal
}
toStore.clear();
if (!data.isEmpty()) {
- updated += getDatabaseService().runBatchUpdate(connection, INSERT_SEARCH_TAG, data);
+ updated += getJdbcClient().runBatchUpdate(connection, INSERT_SEARCH_TAG, data);
}
}
return updated;
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/indexer/callable/producer/AbstractIndexerTxDatabaseCallable.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/indexer/callable/producer/AbstractIndexerTxDatabaseCallable.java
index e956403385..197826c306 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/indexer/callable/producer/AbstractIndexerTxDatabaseCallable.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/indexer/callable/producer/AbstractIndexerTxDatabaseCallable.java
@@ -16,9 +16,9 @@ import java.util.LinkedList;
import java.util.List;
import java.util.concurrent.Future;
import org.eclipse.osee.framework.core.exception.OseeExceptions;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
-import org.eclipse.osee.framework.database.core.OseeConnection;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.jdbc.JdbcClient;
+import org.eclipse.osee.jdbc.JdbcConnection;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.OrcsSession;
import org.eclipse.osee.orcs.data.AttributeTypes;
@@ -45,8 +45,8 @@ public abstract class AbstractIndexerTxDatabaseCallable extends AbstractDatastor
private long totalGammas;
private List<Future<?>> futures;
- protected AbstractIndexerTxDatabaseCallable(Log logger, OrcsSession session, IOseeDatabaseService dbService, SqlJoinFactory joinFactory, AttributeTypes types, IndexingTaskConsumer consumer, IndexerCollector collector, boolean isCacheAll, int cacheLimit) {
- super(logger, session, dbService, "Indexing Database Transaction");
+ protected AbstractIndexerTxDatabaseCallable(Log logger, OrcsSession session, JdbcClient jdbcClient, SqlJoinFactory joinFactory, AttributeTypes types, IndexingTaskConsumer consumer, IndexerCollector collector, boolean isCacheAll, int cacheLimit) {
+ super(logger, session, jdbcClient);
this.joinFactory = joinFactory;
this.types = types;
this.consumer = consumer;
@@ -59,7 +59,7 @@ public abstract class AbstractIndexerTxDatabaseCallable extends AbstractDatastor
}
@Override
- protected List<Future<?>> handleTxWork(OseeConnection connection) throws OseeCoreException {
+ protected List<Future<?>> handleTxWork(JdbcConnection connection) throws OseeCoreException {
totalGammas = 0;
try {
convertInput(connection);
@@ -105,7 +105,7 @@ public abstract class AbstractIndexerTxDatabaseCallable extends AbstractDatastor
}
}
- protected void addEntry(OseeConnection connection, long gammaId) throws OseeCoreException {
+ protected void addEntry(JdbcConnection connection, long gammaId) throws OseeCoreException {
if (currentJoinQuery == null) {
currentJoinQuery = joinFactory.createTagQueueJoinQuery();
}
@@ -119,7 +119,7 @@ public abstract class AbstractIndexerTxDatabaseCallable extends AbstractDatastor
return !isCacheAll && currentJoinQuery != null && currentJoinQuery.size() > cacheLimit;
}
- private void storeQueryIds(OseeConnection connection) throws OseeCoreException {
+ private void storeQueryIds(JdbcConnection connection) throws OseeCoreException {
if (currentJoinQuery != null && !currentJoinQuery.isEmpty()) {
currentJoinQuery.store(connection);
queryIds.add(currentJoinQuery.getQueryId());
@@ -128,5 +128,5 @@ public abstract class AbstractIndexerTxDatabaseCallable extends AbstractDatastor
currentJoinQuery = null;
}
- abstract protected void convertInput(OseeConnection connection) throws Exception;
+ abstract protected void convertInput(JdbcConnection connection) throws Exception;
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/indexer/callable/producer/IndexAllInQueueCallable.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/indexer/callable/producer/IndexAllInQueueCallable.java
index 0e9e9a317e..1caee7456e 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/indexer/callable/producer/IndexAllInQueueCallable.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/indexer/callable/producer/IndexAllInQueueCallable.java
@@ -11,7 +11,7 @@
package org.eclipse.osee.orcs.db.internal.search.indexer.callable.producer;
import java.util.Collection;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
+import org.eclipse.osee.jdbc.JdbcClient;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.OrcsSession;
import org.eclipse.osee.orcs.data.AttributeTypes;
@@ -32,7 +32,7 @@ public final class IndexAllInQueueCallable extends AbstractDatastoreCallable<Int
private final AttributeTypes types;
private Collection<Integer> queryIds;
- public IndexAllInQueueCallable(Log logger, OrcsSession session, IOseeDatabaseService service, SqlJoinFactory joinFactory, AttributeTypes types, IndexingTaskConsumer consumer, IndexerCollector collector) {
+ public IndexAllInQueueCallable(Log logger, OrcsSession session, JdbcClient service, SqlJoinFactory joinFactory, AttributeTypes types, IndexingTaskConsumer consumer, IndexerCollector collector) {
super(logger, session, service);
this.types = types;
this.consumer = consumer;
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/indexer/callable/producer/IndexBranchesDatabaseCallable.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/indexer/callable/producer/IndexBranchesDatabaseCallable.java
index b123f097ad..1e3d475f3d 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/indexer/callable/producer/IndexBranchesDatabaseCallable.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/indexer/callable/producer/IndexBranchesDatabaseCallable.java
@@ -14,9 +14,9 @@ import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
import org.eclipse.osee.framework.core.data.IAttributeType;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
-import org.eclipse.osee.framework.database.core.IOseeStatement;
import org.eclipse.osee.framework.jdk.core.type.Triplet;
+import org.eclipse.osee.jdbc.JdbcClient;
+import org.eclipse.osee.jdbc.JdbcStatement;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.OrcsSession;
import org.eclipse.osee.orcs.data.AttributeTypes;
@@ -65,7 +65,7 @@ public final class IndexBranchesDatabaseCallable extends AbstractDatastoreCallab
private final Collection<? extends IAttributeType> typesToTag;
private final boolean tagOnlyMissingGammas;
- public IndexBranchesDatabaseCallable(Log logger, OrcsSession session, IOseeDatabaseService service, SqlJoinFactory joinFactory, AttributeTypes types, IndexingTaskConsumer consumer, IndexerCollector collector, Collection<? extends IAttributeType> typesToTag, Collection<BranchReadable> branches, boolean tagOnlyMissingGammas) {
+ public IndexBranchesDatabaseCallable(Log logger, OrcsSession session, JdbcClient service, SqlJoinFactory joinFactory, AttributeTypes types, IndexingTaskConsumer consumer, IndexerCollector collector, Collection<? extends IAttributeType> typesToTag, Collection<BranchReadable> branches, boolean tagOnlyMissingGammas) {
super(logger, session, service);
this.joinFactory = joinFactory;
this.types = types;
@@ -103,7 +103,7 @@ public final class IndexBranchesDatabaseCallable extends AbstractDatastoreCallab
branchJoin.store();
if (collector != null) {
- int totalAttributes = getDatabaseService().runPreparedQueryFetchObject(-1, countQuery, params);
+ int totalAttributes = getJdbcClient().runPreparedQueryFetchObject(-1, countQuery, params);
collector.onIndexTotalTaskItems(totalAttributes);
}
@@ -123,7 +123,7 @@ public final class IndexBranchesDatabaseCallable extends AbstractDatastoreCallab
}
private void fetchAndProcessGammas(String query, Object... params) throws Exception {
- IOseeStatement chStmt = getDatabaseService().getStatement();
+ JdbcStatement chStmt = getJdbcClient().getStatement();
try {
chStmt.runPreparedQuery(query, params);
TagQueueJoinQuery joinQuery = joinFactory.createTagQueueJoinQuery();
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/indexer/callable/producer/IndexerDatabaseCallable.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/indexer/callable/producer/IndexerDatabaseCallable.java
index 42426ea5ca..a194477a32 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/indexer/callable/producer/IndexerDatabaseCallable.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/indexer/callable/producer/IndexerDatabaseCallable.java
@@ -10,8 +10,8 @@
*******************************************************************************/
package org.eclipse.osee.orcs.db.internal.search.indexer.callable.producer;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
-import org.eclipse.osee.framework.database.core.OseeConnection;
+import org.eclipse.osee.jdbc.JdbcClient;
+import org.eclipse.osee.jdbc.JdbcConnection;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.OrcsSession;
import org.eclipse.osee.orcs.core.ds.HasVersion;
@@ -27,13 +27,13 @@ public class IndexerDatabaseCallable extends AbstractIndexerTxDatabaseCallable {
private final Iterable<? extends HasVersion> datas;
- public IndexerDatabaseCallable(Log logger, OrcsSession session, IOseeDatabaseService dbService, SqlJoinFactory joinFactory, AttributeTypes types, IndexingTaskConsumer consumer, IndexerCollector listener, boolean isCacheAll, int cacheLimit, Iterable<? extends HasVersion> datas) {
- super(logger, session, dbService, joinFactory, types, consumer, listener, isCacheAll, cacheLimit);
+ public IndexerDatabaseCallable(Log logger, OrcsSession session, JdbcClient jdbcClient, SqlJoinFactory joinFactory, AttributeTypes types, IndexingTaskConsumer consumer, IndexerCollector listener, boolean isCacheAll, int cacheLimit, Iterable<? extends HasVersion> datas) {
+ super(logger, session, jdbcClient, joinFactory, types, consumer, listener, isCacheAll, cacheLimit);
this.datas = datas;
}
@Override
- protected void convertInput(final OseeConnection connection) throws Exception {
+ protected void convertInput(final JdbcConnection connection) throws Exception {
for (HasVersion data : datas) {
addEntry(connection, data.getVersion().getGammaId());
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/indexer/callable/producer/XmlStreamIndexerDatabaseCallable.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/indexer/callable/producer/XmlStreamIndexerDatabaseCallable.java
index daddc9da03..3d719fc038 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/indexer/callable/producer/XmlStreamIndexerDatabaseCallable.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/indexer/callable/producer/XmlStreamIndexerDatabaseCallable.java
@@ -11,9 +11,9 @@
package org.eclipse.osee.orcs.db.internal.search.indexer.callable.producer;
import java.io.InputStream;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
-import org.eclipse.osee.framework.database.core.OseeConnection;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.jdbc.JdbcClient;
+import org.eclipse.osee.jdbc.JdbcConnection;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.OrcsSession;
import org.eclipse.osee.orcs.data.AttributeTypes;
@@ -30,14 +30,14 @@ public class XmlStreamIndexerDatabaseCallable extends AbstractIndexerTxDatabaseC
private final IndexerXmlInputStreamParser parser;
private final InputStream inputStream;
- public XmlStreamIndexerDatabaseCallable(Log logger, OrcsSession session, IOseeDatabaseService dbService, SqlJoinFactory joinFactory, AttributeTypes types, IndexingTaskConsumer consumer, IndexerCollector listener, boolean isCacheAll, int cacheLimit, InputStream inputStream) {
- super(logger, session, dbService, joinFactory, types, consumer, listener, isCacheAll, cacheLimit);
+ public XmlStreamIndexerDatabaseCallable(Log logger, OrcsSession session, JdbcClient jdbcClient, SqlJoinFactory joinFactory, AttributeTypes types, IndexingTaskConsumer consumer, IndexerCollector listener, boolean isCacheAll, int cacheLimit, InputStream inputStream) {
+ super(logger, session, jdbcClient, joinFactory, types, consumer, listener, isCacheAll, cacheLimit);
parser = new IndexerXmlInputStreamParser();
this.inputStream = inputStream;
}
@Override
- protected void convertInput(final OseeConnection connection) throws Exception {
+ protected void convertInput(final JdbcConnection connection) throws Exception {
parser.parse(inputStream, new IndexItemIdCollector() {
@Override
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/indexer/data/GammaQueueIndexerDataSourceLoader.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/indexer/data/GammaQueueIndexerDataSourceLoader.java
index 9e140a2dc5..23635475ce 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/indexer/data/GammaQueueIndexerDataSourceLoader.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/indexer/data/GammaQueueIndexerDataSourceLoader.java
@@ -10,10 +10,10 @@
*******************************************************************************/
package org.eclipse.osee.orcs.db.internal.search.indexer.data;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
-import org.eclipse.osee.framework.database.core.IOseeStatement;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.resource.management.IResourceManager;
+import org.eclipse.osee.jdbc.JdbcClient;
+import org.eclipse.osee.jdbc.JdbcStatement;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.core.ds.IndexedResource;
import org.eclipse.osee.orcs.core.ds.OrcsDataHandler;
@@ -28,19 +28,19 @@ public class GammaQueueIndexerDataSourceLoader implements IndexedResourceLoader
"SELECT attr1.gamma_id, attr1.VALUE, attr1.uri, attr1.attr_type_id, attr1.attr_id FROM osee_attribute attr1, osee_tag_gamma_queue tgq1 WHERE attr1.gamma_id = tgq1.gamma_id AND tgq1.query_id = ?";
private final Log logger;
- private final IOseeDatabaseService dbService;
+ private final JdbcClient jdbcClient;
private final IResourceManager resourceManager;
- public GammaQueueIndexerDataSourceLoader(Log logger, IOseeDatabaseService dbService, IResourceManager resourceManager) {
+ public GammaQueueIndexerDataSourceLoader(Log logger, JdbcClient jdbcClient, IResourceManager resourceManager) {
super();
this.logger = logger;
- this.dbService = dbService;
+ this.jdbcClient = jdbcClient;
this.resourceManager = resourceManager;
}
private boolean loadData(OrcsDataHandler<IndexedResource> handler, int tagQueueQueryId) throws OseeCoreException {
boolean loaded = false;
- IOseeStatement chStmt = dbService.getStatement();
+ JdbcStatement chStmt = jdbcClient.getStatement();
try {
chStmt.runPreparedQuery(LOAD_ATTRIBUTE, tagQueueQueryId);
while (chStmt.next()) {
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/util/SecondPassScanner.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/util/SecondPassScanner.java
index b19c09fcc9..d8e11ec7ec 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/util/SecondPassScanner.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/search/util/SecondPassScanner.java
@@ -124,6 +124,8 @@ public final class SecondPassScanner {
buffer.append((char) read);
}
break;
+ default:
+ break;
}
if (buffer.length() == 1) {
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/sql/RelationalConstants.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/sql/RelationalConstants.java
index 9af3bf8d8c..72cb8d2ef8 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/sql/RelationalConstants.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/sql/RelationalConstants.java
@@ -40,6 +40,5 @@ public final class RelationalConstants {
public static final Long DEFAULT_UUID = -1L;
public static final int MIN_FETCH_SIZE = 10;
- public static final int MAX_FETCH_SIZE = 10000;
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/sql/join/AbstractJoinQuery.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/sql/join/AbstractJoinQuery.java
index 0a2b0662c2..0a298db11c 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/sql/join/AbstractJoinQuery.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/sql/join/AbstractJoinQuery.java
@@ -15,8 +15,8 @@ import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
-import org.eclipse.osee.framework.database.core.OseeConnection;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.jdbc.JdbcConnection;
import org.eclipse.osee.orcs.db.internal.sql.join.DatabaseJoinAccessor.JoinItem;
/**
@@ -70,7 +70,7 @@ public abstract class AbstractJoinQuery {
return wasStored;
}
- public void store(OseeConnection connection) throws OseeCoreException {
+ public void store(JdbcConnection connection) throws OseeCoreException {
if (!this.wasStored) {
List<Object[]> data = new ArrayList<Object[]>();
for (IJoinRow joinArray : entries) {
@@ -93,7 +93,7 @@ public abstract class AbstractJoinQuery {
return expiresIn;
}
- public int delete(OseeConnection connection) throws OseeCoreException {
+ public int delete(JdbcConnection connection) throws OseeCoreException {
return joinAccessor.delete(connection, joinItem, getQueryId());
}
@@ -105,7 +105,7 @@ public abstract class AbstractJoinQuery {
return delete(null);
}
- public Collection<Integer> getAllQueryIds(OseeConnection connection) throws OseeCoreException {
+ public Collection<Integer> getAllQueryIds(JdbcConnection connection) throws OseeCoreException {
return joinAccessor.getAllQueryIds(connection, joinItem);
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/sql/join/ArtifactJoinQuery.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/sql/join/ArtifactJoinQuery.java
index 6a20b039ee..842e24d733 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/sql/join/ArtifactJoinQuery.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/sql/join/ArtifactJoinQuery.java
@@ -11,7 +11,7 @@
package org.eclipse.osee.orcs.db.internal.sql.join;
import org.eclipse.osee.framework.core.exception.OseeDataStoreException;
-import org.eclipse.osee.framework.database.core.SQL3DataType;
+import org.eclipse.osee.jdbc.SQL3DataType;
import org.eclipse.osee.orcs.db.internal.sql.join.DatabaseJoinAccessor.JoinItem;
/**
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/sql/join/DatabaseJoinAccessor.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/sql/join/DatabaseJoinAccessor.java
index a4650f71d1..670d7028e8 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/sql/join/DatabaseJoinAccessor.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/sql/join/DatabaseJoinAccessor.java
@@ -13,10 +13,10 @@ package org.eclipse.osee.orcs.db.internal.sql.join;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
-import org.eclipse.osee.framework.database.core.IOseeStatement;
-import org.eclipse.osee.framework.database.core.OseeConnection;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.jdbc.JdbcClient;
+import org.eclipse.osee.jdbc.JdbcConnection;
+import org.eclipse.osee.jdbc.JdbcStatement;
/**
* @author Roberto E. Escobar
@@ -84,35 +84,34 @@ public class DatabaseJoinAccessor implements IJoinAccessor {
}
}
- private final IOseeDatabaseService databaseService;
+ private final JdbcClient jdbcClient;
- public DatabaseJoinAccessor(IOseeDatabaseService databaseService) {
+ public DatabaseJoinAccessor(JdbcClient jdbcClient) {
super();
- this.databaseService = databaseService;
+ this.jdbcClient = jdbcClient;
}
@Override
- public int delete(OseeConnection connection, JoinItem joinItem, int queryId) throws OseeCoreException {
+ public int delete(JdbcConnection connection, JoinItem joinItem, int queryId) throws OseeCoreException {
int updated = 0;
if (queryId != -1) {
- updated = databaseService.runPreparedUpdate(connection, joinItem.getDeleteSql(), queryId);
- databaseService.runPreparedUpdate(connection, DELETE_FROM_JOIN_CLEANUP, queryId);
+ updated = jdbcClient.runPreparedUpdate(connection, joinItem.getDeleteSql(), queryId);
+ jdbcClient.runPreparedUpdate(connection, DELETE_FROM_JOIN_CLEANUP, queryId);
}
return updated;
}
- @SuppressWarnings("unchecked")
@Override
- public void store(OseeConnection connection, JoinItem joinItem, int queryId, List<Object[]> dataList, Long issuedAt, Long expiresIn) throws OseeCoreException {
- databaseService.runPreparedUpdate(connection, INSERT_INTO_JOIN_CLEANUP, queryId, joinItem.getJoinTableName(),
+ public void store(JdbcConnection connection, JoinItem joinItem, int queryId, List<Object[]> dataList, Long issuedAt, Long expiresIn) throws OseeCoreException {
+ jdbcClient.runPreparedUpdate(connection, INSERT_INTO_JOIN_CLEANUP, queryId, joinItem.getJoinTableName(),
issuedAt, expiresIn);
- databaseService.runBatchUpdate(connection, joinItem.getInsertSql(), dataList);
+ jdbcClient.runBatchUpdate(connection, joinItem.getInsertSql(), dataList);
}
@Override
- public Collection<Integer> getAllQueryIds(OseeConnection connection, JoinItem joinItem) throws OseeCoreException {
+ public Collection<Integer> getAllQueryIds(JdbcConnection connection, JoinItem joinItem) throws OseeCoreException {
Collection<Integer> queryIds = new ArrayList<Integer>();
- IOseeStatement chStmt = databaseService.getStatement(connection);
+ JdbcStatement chStmt = jdbcClient.getStatement(connection);
try {
String query = String.format(SELECT_QUERY_IDS, joinItem.getJoinTableName());
chStmt.runPreparedQuery(query);
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/sql/join/IJoinAccessor.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/sql/join/IJoinAccessor.java
index ffd4a9abbe..4cd3885900 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/sql/join/IJoinAccessor.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/sql/join/IJoinAccessor.java
@@ -12,8 +12,8 @@ package org.eclipse.osee.orcs.db.internal.sql.join;
import java.util.Collection;
import java.util.List;
-import org.eclipse.osee.framework.database.core.OseeConnection;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.jdbc.JdbcConnection;
import org.eclipse.osee.orcs.db.internal.sql.join.DatabaseJoinAccessor.JoinItem;
/**
@@ -21,9 +21,9 @@ import org.eclipse.osee.orcs.db.internal.sql.join.DatabaseJoinAccessor.JoinItem;
*/
public interface IJoinAccessor {
- void store(OseeConnection connection, JoinItem joinItem, int queryId, List<Object[]> dataList, Long issuedAt, Long expiresIn) throws OseeCoreException;
+ void store(JdbcConnection connection, JoinItem joinItem, int queryId, List<Object[]> dataList, Long issuedAt, Long expiresIn) throws OseeCoreException;
- int delete(OseeConnection connection, JoinItem joinItem, int queryId) throws OseeCoreException;
+ int delete(JdbcConnection connection, JoinItem joinItem, int queryId) throws OseeCoreException;
- Collection<Integer> getAllQueryIds(OseeConnection connection, JoinItem joinItem) throws OseeCoreException;
+ Collection<Integer> getAllQueryIds(JdbcConnection connection, JoinItem joinItem) throws OseeCoreException;
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/sql/join/JoinCleanerCallable.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/sql/join/JoinCleanerCallable.java
index f309ac02f4..f00591d5fb 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/sql/join/JoinCleanerCallable.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/sql/join/JoinCleanerCallable.java
@@ -14,10 +14,10 @@ import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
-import org.eclipse.osee.database.schema.DatabaseCallable;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
-import org.eclipse.osee.framework.database.IQueryProcessor;
-import org.eclipse.osee.framework.database.core.IOseeStatement;
+import org.eclipse.osee.executor.admin.CancellableCallable;
+import org.eclipse.osee.jdbc.JdbcClient;
+import org.eclipse.osee.jdbc.JdbcProcessor;
+import org.eclipse.osee.jdbc.JdbcStatement;
import org.eclipse.osee.logger.Log;
import com.google.common.base.Supplier;
import com.google.common.collect.ListMultimap;
@@ -30,13 +30,17 @@ import com.google.common.collect.Multimaps;
*
* @author Roberto E. Escobar
*/
-public class JoinCleanerCallable extends DatabaseCallable<Void> {
+public class JoinCleanerCallable extends CancellableCallable<Void> {
private final static String DELETE_JOIN_CLEANUP = "DELETE FROM osee_join_cleanup WHERE query_id = ?";
private final static String SELECT_FROM_JOIN_CLEANUP = "SELECT * from osee_join_cleanup";
- public JoinCleanerCallable(Log logger, IOseeDatabaseService service) {
- super(logger, service);
+ private final Log logger;
+ private final JdbcClient jdbcClient;
+
+ public JoinCleanerCallable(Log logger, JdbcClient jdbcClient) {
+ this.logger = logger;
+ this.jdbcClient = jdbcClient;
}
private boolean isExpired(Long issuedAt, Long lifetime) {
@@ -45,29 +49,33 @@ public class JoinCleanerCallable extends DatabaseCallable<Void> {
@Override
public Void call() throws Exception {
- final ListMultimap<String, Object[]> expiredItems = newListMultimap();
- getDatabaseService().runQuery(new IQueryProcessor() {
+ try {
+ final ListMultimap<String, Object[]> expiredItems = newListMultimap();
+ jdbcClient.runQuery(new JdbcProcessor() {
- @Override
- public void processNext(IOseeStatement chStmt) {
- Long issuedAt = chStmt.getLong("issues_at");
- Long expiresIn = chStmt.getLong("expires_in");
- if (isExpired(issuedAt, expiresIn)) {
- String tableName = chStmt.getString("table_name");
- Integer queryId = chStmt.getInt("query_id");
- expiredItems.put(tableName, new Integer[] {queryId});
+ @Override
+ public void processNext(JdbcStatement chStmt) {
+ Long issuedAt = chStmt.getLong("issues_at");
+ Long expiresIn = chStmt.getLong("expires_in");
+ if (isExpired(issuedAt, expiresIn)) {
+ String tableName = chStmt.getString("table_name");
+ Integer queryId = chStmt.getInt("query_id");
+ expiredItems.put(tableName, new Integer[] {queryId});
+ }
}
- }
- }, SELECT_FROM_JOIN_CLEANUP);
+ }, SELECT_FROM_JOIN_CLEANUP);
- if (!expiredItems.isEmpty()) {
- IOseeDatabaseService dbService = getDatabaseService();
- for (Entry<String, Collection<Object[]>> entry : expiredItems.asMap().entrySet()) {
- String query = String.format("DELETE FROM %s WHERE query_id = ?", entry.getKey());
- List<Object[]> ids = (List<Object[]>) entry.getValue();
- dbService.runBatchUpdate(query, ids);
- dbService.runBatchUpdate(DELETE_JOIN_CLEANUP, ids);
+ if (!expiredItems.isEmpty()) {
+ for (Entry<String, Collection<Object[]>> entry : expiredItems.asMap().entrySet()) {
+ String query = String.format("DELETE FROM %s WHERE query_id = ?", entry.getKey());
+ List<Object[]> ids = (List<Object[]>) entry.getValue();
+ jdbcClient.runBatchUpdate(query, ids);
+ jdbcClient.runBatchUpdate(DELETE_JOIN_CLEANUP, ids);
+ }
}
+ } catch (Exception ex) {
+ logger.error(ex, "Error cleaning join");
+ throw ex;
}
return null;
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/sql/join/SqlJoinFactory.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/sql/join/SqlJoinFactory.java
index 4036f2c74c..c7db1d96a2 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/sql/join/SqlJoinFactory.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/sql/join/SqlJoinFactory.java
@@ -14,8 +14,9 @@ import java.util.Random;
import java.util.concurrent.Callable;
import java.util.concurrent.TimeUnit;
import org.eclipse.osee.executor.admin.ExecutorAdmin;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
import org.eclipse.osee.framework.jdk.core.util.Strings;
+import org.eclipse.osee.jdbc.JdbcClient;
+import org.eclipse.osee.jdbc.JdbcService;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.core.SystemPreferences;
@@ -36,18 +37,19 @@ public class SqlJoinFactory {
private static final String EXPIRATION_SECS__TX_JOIN_QUERY = "tx.join.expiration.secs";
private Log logger;
- private IOseeDatabaseService service;
+ private JdbcService jdbcService;
private SystemPreferences preferences;
private ExecutorAdmin executorAdmin;
private Random random;
+ private IJoinAccessor joinAccessor;
public void setLogger(Log logger) {
this.logger = logger;
}
- public void setDatabaseService(IOseeDatabaseService service) {
- this.service = service;
+ public void setJdbcService(JdbcService jdbcService) {
+ this.jdbcService = jdbcService;
}
public void setSystemPreferences(SystemPreferences preferences) {
@@ -61,7 +63,11 @@ public class SqlJoinFactory {
public void start() throws Exception {
random = new Random();
- Callable<?> callable = new JoinCleanerCallable(logger, service);
+ JdbcClient jdbcClient = jdbcService.getClient();
+
+ joinAccessor = new DatabaseJoinAccessor(jdbcClient);
+
+ Callable<?> callable = new JoinCleanerCallable(logger, jdbcClient);
executorAdmin.scheduleAtFixedRate(JOIN_CLEANER__EXECUTOR_ID, callable, DEFAULT_JOIN_CLEANER__PERIOD_MINUTES,
DEFAULT_JOIN_CLEANER__PERIOD_MINUTES, TimeUnit.MINUTES);
}
@@ -77,8 +83,8 @@ public class SqlJoinFactory {
return random.nextInt();
}
- private IJoinAccessor createAccessor() {
- return new DatabaseJoinAccessor(service);
+ private IJoinAccessor getAccessor() {
+ return joinAccessor;
}
public TransactionJoinQuery createTransactionJoinQuery() {
@@ -87,7 +93,7 @@ public class SqlJoinFactory {
public TransactionJoinQuery createTransactionJoinQuery(Long expiresIn) {
Long actualExpiration = getExpiresIn(expiresIn, EXPIRATION_SECS__TX_JOIN_QUERY);
- return new TransactionJoinQuery(createAccessor(), actualExpiration, getNewQueryId());
+ return new TransactionJoinQuery(getAccessor(), actualExpiration, getNewQueryId());
}
public IdJoinQuery createIdJoinQuery() {
@@ -96,7 +102,7 @@ public class SqlJoinFactory {
public IdJoinQuery createIdJoinQuery(Long expiresIn) {
Long actualExpiration = getExpiresIn(expiresIn, EXPIRATION_SECS__ID_JOIN_QUERY);
- return new IdJoinQuery(createAccessor(), actualExpiration, getNewQueryId());
+ return new IdJoinQuery(getAccessor(), actualExpiration, getNewQueryId());
}
public ArtifactJoinQuery createArtifactJoinQuery() {
@@ -105,7 +111,7 @@ public class SqlJoinFactory {
public ArtifactJoinQuery createArtifactJoinQuery(Long expiresIn) {
Long actualExpiration = getExpiresIn(expiresIn, EXPIRATION_SECS__ARTIFACT_JOIN_QUERY);
- return new ArtifactJoinQuery(createAccessor(), actualExpiration, getNewQueryId(), getMaxArtifactJoinSize());
+ return new ArtifactJoinQuery(getAccessor(), actualExpiration, getNewQueryId(), getMaxArtifactJoinSize());
}
public TagQueueJoinQuery createTagQueueJoinQuery() {
@@ -114,7 +120,7 @@ public class SqlJoinFactory {
public TagQueueJoinQuery createTagQueueJoinQuery(Long expiresIn) {
Long actualExpiration = getExpiresIn(expiresIn, EXPIRATION_SECS__TAG_QUEUE_JOIN_QUERY);
- return new TagQueueJoinQuery(createAccessor(), actualExpiration, getNewQueryId());
+ return new TagQueueJoinQuery(getAccessor(), actualExpiration, getNewQueryId());
}
public ExportImportJoinQuery createExportImportJoinQuery() {
@@ -123,7 +129,7 @@ public class SqlJoinFactory {
public ExportImportJoinQuery createExportImportJoinQuery(Long expiresIn) {
Long actualExpiration = getExpiresIn(expiresIn, EXPIRATION_SECS__EXPORT_IMPORT_JOIN_QUERY);
- return new ExportImportJoinQuery(createAccessor(), actualExpiration, getNewQueryId());
+ return new ExportImportJoinQuery(getAccessor(), actualExpiration, getNewQueryId());
}
public CharJoinQuery createCharJoinQuery() {
@@ -132,7 +138,7 @@ public class SqlJoinFactory {
public CharJoinQuery createCharJoinQuery(Long expiresIn) {
Long actualExpiration = getExpiresIn(expiresIn, EXPIRATION_SECS__CHAR_JOIN_QUERY);
- return new CharJoinQuery(createAccessor(), actualExpiration, getNewQueryId());
+ return new CharJoinQuery(getAccessor(), actualExpiration, getNewQueryId());
}
private Long getExpiresIn(Long actual, String defaultKey) {
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/sql/join/TransactionJoinQuery.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/sql/join/TransactionJoinQuery.java
index f363fb5fdf..f3d87a9190 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/sql/join/TransactionJoinQuery.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/sql/join/TransactionJoinQuery.java
@@ -10,7 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.orcs.db.internal.sql.join;
-import org.eclipse.osee.framework.database.core.SQL3DataType;
+import org.eclipse.osee.jdbc.SQL3DataType;
import org.eclipse.osee.orcs.db.internal.sql.join.DatabaseJoinAccessor.JoinItem;
/**
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/transaction/CommitTransactionDatabaseTxCallable.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/transaction/CommitTransactionDatabaseTxCallable.java
index 1595f4687f..29a7b49d51 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/transaction/CommitTransactionDatabaseTxCallable.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/transaction/CommitTransactionDatabaseTxCallable.java
@@ -14,12 +14,11 @@ import java.util.Date;
import org.eclipse.osee.framework.core.data.IOseeBranch;
import org.eclipse.osee.framework.core.enums.BranchState;
import org.eclipse.osee.framework.core.enums.TransactionDetailsType;
-import org.eclipse.osee.framework.core.exception.OseeDataStoreException;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
-import org.eclipse.osee.framework.database.core.OseeConnection;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.Conditions;
import org.eclipse.osee.framework.jdk.core.util.time.GlobalTime;
+import org.eclipse.osee.jdbc.JdbcClient;
+import org.eclipse.osee.jdbc.JdbcConnection;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.OrcsSession;
import org.eclipse.osee.orcs.core.ds.OrcsChangeSet;
@@ -27,6 +26,7 @@ import org.eclipse.osee.orcs.core.ds.TransactionData;
import org.eclipse.osee.orcs.core.ds.TransactionResult;
import org.eclipse.osee.orcs.data.ArtifactReadable;
import org.eclipse.osee.orcs.data.TransactionReadable;
+import org.eclipse.osee.orcs.db.internal.IdentityManager;
import org.eclipse.osee.orcs.db.internal.callable.AbstractDatastoreTxCallable;
import org.eclipse.osee.orcs.db.internal.loader.data.TransactionDataImpl;
import org.eclipse.osee.orcs.db.internal.sql.RelationalConstants;
@@ -39,23 +39,22 @@ import org.eclipse.osee.orcs.db.internal.sql.RelationalConstants;
public final class CommitTransactionDatabaseTxCallable extends AbstractDatastoreTxCallable<TransactionResult> {
private final TransactionData transactionData;
-
+ private final IdentityManager identityManager;
private final TransactionProcessorProvider provider;
private final TransactionWriter writer;
private static final String UPDATE_BRANCH_STATE =
"UPDATE osee_branch SET branch_state = ? WHERE branch_id = ? and branch_state = ?";
- public CommitTransactionDatabaseTxCallable(Log logger, OrcsSession session, IOseeDatabaseService dbService, TransactionProcessorProvider provider, TransactionWriter writer, TransactionData transactionData) {
- super(logger, session, dbService, String.format("Committing Transaction: [%s] for branch [%s]",
- transactionData.getComment(), transactionData.getBranch()));
+ public CommitTransactionDatabaseTxCallable(Log logger, OrcsSession session, JdbcClient jdbcClient, IdentityManager identityManager, TransactionProcessorProvider provider, TransactionWriter writer, TransactionData transactionData) {
+ super(logger, session, jdbcClient);
+ this.identityManager = identityManager;
this.provider = provider;
-
this.writer = writer;
this.transactionData = transactionData;
}
- private int getNextTransactionId() throws OseeDataStoreException, OseeCoreException {
- return getDatabaseService().getSequence().getNextTransactionId();
+ private int getNextTransactionId() {
+ return identityManager.getNextTransactionId();
}
private void process(TxWritePhaseEnum phase) throws OseeCoreException {
@@ -66,7 +65,7 @@ public final class CommitTransactionDatabaseTxCallable extends AbstractDatastore
}
@Override
- protected TransactionResult handleTxWork(OseeConnection connection) throws OseeCoreException {
+ protected TransactionResult handleTxWork(JdbcConnection connection) throws OseeCoreException {
/////
// TODO:
// 1. Make this whole method a critical region on a per branch basis - can only write to a branch on one thread at time
@@ -87,7 +86,7 @@ public final class CommitTransactionDatabaseTxCallable extends AbstractDatastore
Object[] params =
new Object[] {BranchState.MODIFIED.getValue(), branch.getUuid(), BranchState.CREATED.getValue()};
- getDatabaseService().runPreparedUpdate(connection, UPDATE_BRANCH_STATE, params);
+ getJdbcClient().runPreparedUpdate(connection, UPDATE_BRANCH_STATE, params);
return new TransactionResultImpl(txRecord, changeSet);
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/transaction/TransactionWriter.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/transaction/TransactionWriter.java
index de5f4e9152..2861496c77 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/transaction/TransactionWriter.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/transaction/TransactionWriter.java
@@ -14,10 +14,10 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Map.Entry;
import org.eclipse.osee.framework.core.enums.TxChange;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
-import org.eclipse.osee.framework.database.core.IOseeStatement;
-import org.eclipse.osee.framework.database.core.OseeConnection;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.jdbc.JdbcClient;
+import org.eclipse.osee.jdbc.JdbcConnection;
+import org.eclipse.osee.jdbc.JdbcStatement;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.core.ds.OrcsChangeSet;
import org.eclipse.osee.orcs.data.TransactionReadable;
@@ -89,15 +89,15 @@ public class TransactionWriter {
}
private final Log logger;
- private final IOseeDatabaseService dbService;
+ private final JdbcClient jdbcClient;
private final TxSqlBuilder sqlBuilder;
private List<DaoToSql> binaryStores;
- public TransactionWriter(Log logger, IOseeDatabaseService dbService, TxSqlBuilder sqlBuilder) {
+ public TransactionWriter(Log logger, JdbcClient jdbcClient, TxSqlBuilder sqlBuilder) {
super();
this.logger = logger;
- this.dbService = dbService;
+ this.jdbcClient = jdbcClient;
this.sqlBuilder = sqlBuilder;
}
@@ -115,7 +115,7 @@ public class TransactionWriter {
}
}
- public void write(OseeConnection connection, TransactionReadable tx, OrcsChangeSet txData) throws OseeCoreException {
+ public void write(JdbcConnection connection, TransactionReadable tx, OrcsChangeSet txData) throws OseeCoreException {
sqlBuilder.accept(tx, txData);
try {
binaryStores = sqlBuilder.getBinaryStores();
@@ -135,19 +135,19 @@ public class TransactionWriter {
for (SqlOrderEnum key : SqlOrderEnum.values()) {
List<Object[]> data = sqlBuilder.getInsertData(key);
if (data != null && !data.isEmpty()) {
- dbService.runBatchUpdate(connection, key.getInsertSql(), data);
+ jdbcClient.runBatchUpdate(connection, key.getInsertSql(), data);
}
}
- dbService.runBatchUpdate(connection, UPDATE_TXS_NOT_CURRENT, txNotCurrentData);
+ jdbcClient.runBatchUpdate(connection, UPDATE_TXS_NOT_CURRENT, txNotCurrentData);
} finally {
sqlBuilder.clear();
}
}
- private void fetchTxNotCurrent(OseeConnection connection, long branchUuid, List<Object[]> results, String query, AbstractJoinQuery join) throws OseeCoreException {
+ private void fetchTxNotCurrent(JdbcConnection connection, long branchUuid, List<Object[]> results, String query, AbstractJoinQuery join) throws OseeCoreException {
try {
join.store();
- IOseeStatement chStmt = dbService.getStatement(connection);
+ JdbcStatement chStmt = jdbcClient.getStatement(connection);
try {
chStmt.runPreparedQuery(query, join.getQueryId(), branchUuid);
while (chStmt.next()) {
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/transaction/TxModule.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/transaction/TxModule.java
index fe3710fbd8..a66d3da0bd 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/transaction/TxModule.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/transaction/TxModule.java
@@ -13,7 +13,7 @@ package org.eclipse.osee.orcs.db.internal.transaction;
import java.util.Collection;
import java.util.concurrent.Callable;
import org.eclipse.osee.framework.core.data.ITransaction;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
+import org.eclipse.osee.jdbc.JdbcClient;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.OrcsSession;
import org.eclipse.osee.orcs.core.ds.DataLoaderFactory;
@@ -32,14 +32,14 @@ import org.eclipse.osee.orcs.db.internal.sql.join.SqlJoinFactory;
public class TxModule {
private final Log logger;
- private final IOseeDatabaseService dbService;
+ private final JdbcClient jdbcClient;
private final SqlJoinFactory sqlJoinFactory;
private final IdentityManager idManager;
- public TxModule(Log logger, IOseeDatabaseService dbService, SqlJoinFactory sqlJoinFactory, IdentityManager identityService) {
+ public TxModule(Log logger, JdbcClient jdbcClient, SqlJoinFactory sqlJoinFactory, IdentityManager identityService) {
super();
this.logger = logger;
- this.dbService = dbService;
+ this.jdbcClient = jdbcClient;
this.sqlJoinFactory = sqlJoinFactory;
this.idManager = identityService;
}
@@ -53,13 +53,14 @@ public class TxModule {
@Override
public Callable<TransactionResult> commitTransaction(OrcsSession session, TransactionData data) {
TxSqlBuilderImpl builder = new TxSqlBuilderImpl(sqlJoinFactory, idManager);
- TransactionWriter writer = new TransactionWriter(logger, dbService, builder);
- return new CommitTransactionDatabaseTxCallable(logger, session, dbService, processors, writer, data);
+ TransactionWriter writer = new TransactionWriter(logger, jdbcClient, builder);
+ return new CommitTransactionDatabaseTxCallable(logger, session, jdbcClient, idManager, processors, writer,
+ data);
}
@Override
public Callable<Integer> purgeTransactions(OrcsSession session, Collection<? extends ITransaction> transactionsToPurge) {
- return new PurgeTransactionTxCallable(logger, session, dbService, sqlJoinFactory, transactionsToPurge);
+ return new PurgeTransactionTxCallable(logger, session, jdbcClient, sqlJoinFactory, transactionsToPurge);
}
};
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/types/TypesModule.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/types/TypesModule.java
index e5c6789235..aee8d7b655 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/types/TypesModule.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/types/TypesModule.java
@@ -15,9 +15,9 @@ import java.util.concurrent.Callable;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.data.IAttributeType;
import org.eclipse.osee.framework.core.data.IRelationType;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
import org.eclipse.osee.framework.resource.management.IResource;
import org.eclipse.osee.framework.resource.management.IResourceManager;
+import org.eclipse.osee.jdbc.JdbcClient;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.OrcsSession;
import org.eclipse.osee.orcs.core.ds.OrcsTypesDataStore;
@@ -33,14 +33,14 @@ import org.eclipse.osee.orcs.db.internal.sql.join.SqlJoinFactory;
public class TypesModule {
private final Log logger;
- private final IOseeDatabaseService dbService;
+ private final JdbcClient jdbcClient;
private final SqlJoinFactory joinFactory;
private final IResourceManager resourceManager;
- public TypesModule(Log logger, IOseeDatabaseService dbService, SqlJoinFactory joinFactory, IResourceManager resourceManager) {
+ public TypesModule(Log logger, JdbcClient jdbcClient, SqlJoinFactory joinFactory, IResourceManager resourceManager) {
super();
this.logger = logger;
- this.dbService = dbService;
+ this.jdbcClient = jdbcClient;
this.joinFactory = joinFactory;
this.resourceManager = resourceManager;
}
@@ -50,22 +50,22 @@ public class TypesModule {
@Override
public Callable<IResource> getOrcsTypesLoader(OrcsSession session) {
- return new OrcsTypeLoaderCallable(logger, session, dbService, resourceManager);
+ return new OrcsTypeLoaderCallable(logger, session, jdbcClient, resourceManager);
}
@Override
public Callable<Void> purgeArtifactsByArtifactType(OrcsSession session, Collection<? extends IArtifactType> typesToPurge) {
- return new PurgeArtifactTypeDatabaseTxCallable(logger, session, dbService, typesToPurge);
+ return new PurgeArtifactTypeDatabaseTxCallable(logger, session, jdbcClient, typesToPurge);
}
@Override
public Callable<Void> purgeAttributesByAttributeType(OrcsSession session, Collection<? extends IAttributeType> typesToPurge) {
- return new PurgeAttributeTypeDatabaseTxCallable(logger, session, dbService, joinFactory, typesToPurge);
+ return new PurgeAttributeTypeDatabaseTxCallable(logger, session, jdbcClient, joinFactory, typesToPurge);
}
@Override
public Callable<Void> purgeRelationsByRelationType(OrcsSession session, Collection<? extends IRelationType> typesToPurge) {
- return new PurgeRelationTypeDatabaseTxCallable(logger, session, dbService, typesToPurge);
+ return new PurgeRelationTypeDatabaseTxCallable(logger, session, jdbcClient, typesToPurge);
}
};
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/util/Address.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/util/Address.java
new file mode 100644
index 0000000000..45e19cb344
--- /dev/null
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/util/Address.java
@@ -0,0 +1,139 @@
+/*******************************************************************************
+ * Copyright (c) 2010 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.orcs.db.internal.util;
+
+import org.eclipse.osee.framework.core.enums.ModificationType;
+import org.eclipse.osee.framework.core.enums.TxChange;
+
+/**
+ * @author Ryan D. Brooks
+ */
+public final class Address implements Comparable<Address> {
+ private final long branchUuid;
+ private final int itemId;
+ private final int transactionId;
+ private final long gammaId;
+ private ModificationType modType;
+ private final TxChange txCurrent;
+ private final boolean isBaseline;
+ private TxChange correctedTxCurrent;
+ private boolean purge;
+
+ public Address(boolean isBaseline, long branchUuid, int itemId, int transactionId, long gammaId, ModificationType modType, TxChange txCurrent) {
+ super();
+ this.branchUuid = branchUuid;
+ this.itemId = itemId;
+ this.transactionId = transactionId;
+ this.gammaId = gammaId;
+ this.modType = modType;
+ this.txCurrent = txCurrent;
+ this.isBaseline = isBaseline;
+ }
+
+ public boolean isBaselineTx() {
+ return isBaseline;
+ }
+
+ public boolean isSimilar(Address other) {
+ return other != null && other.itemId == itemId && other.branchUuid == branchUuid;
+ }
+
+ public boolean isSameTransaction(Address other) {
+ return other != null && transactionId == other.transactionId;
+ }
+
+ public boolean hasSameGamma(Address other) {
+ return other != null && gammaId == other.gammaId;
+ }
+
+ public boolean hasSameModType(Address other) {
+ return modType == other.modType;
+ }
+
+ public void ensureCorrectCurrent() {
+ TxChange correctCurrent = TxChange.getCurrent(modType);
+ if (txCurrent != correctCurrent) {
+ correctedTxCurrent = correctCurrent;
+ }
+ }
+
+ public void ensureNotCurrent() {
+ if (txCurrent != TxChange.NOT_CURRENT) {
+ correctedTxCurrent = TxChange.NOT_CURRENT;
+ }
+ }
+
+ public boolean hasIssue() {
+ return purge || correctedTxCurrent != null;
+ }
+
+ public TxChange getCorrectedTxCurrent() {
+ return correctedTxCurrent;
+ }
+
+ public void setCorrectedTxCurrent(TxChange correctedTxCurrent) {
+ this.correctedTxCurrent = correctedTxCurrent;
+ }
+
+ public boolean isPurge() {
+ return purge;
+ }
+
+ public void setPurge(boolean purge) {
+ this.purge = purge;
+ }
+
+ public long getBranchId() {
+ return branchUuid;
+ }
+
+ public int getItemId() {
+ return itemId;
+ }
+
+ public int getTransactionId() {
+ return transactionId;
+ }
+
+ public long getGammaId() {
+ return gammaId;
+ }
+
+ public ModificationType getModType() {
+ return modType;
+ }
+
+ public void setModType(ModificationType modType) {
+ this.modType = modType;
+ }
+
+ public TxChange getTxCurrent() {
+ return txCurrent;
+ }
+
+ public boolean isBaseline() {
+ return isBaseline;
+ }
+
+ @Override
+ public String toString() {
+ return "Address [branchUuid=" + branchUuid + ", gammaId=" + gammaId + ", itemId=" + itemId + ", modType=" + modType + ", transactionId=" + transactionId + ", txCurrent=" + txCurrent + "]";
+ }
+
+ @Override
+ public int compareTo(Address otherAddress) {
+ if (transactionId != otherAddress.transactionId) {
+ return transactionId - otherAddress.transactionId;
+ } else {
+ return (int) (gammaId - otherAddress.gammaId);
+ }
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/util/DynamicSchemaResourceProvider.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/util/DynamicSchemaResourceProvider.java
index ddf3aa5abc..eca80067a9 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/util/DynamicSchemaResourceProvider.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/util/DynamicSchemaResourceProvider.java
@@ -13,19 +13,19 @@ package org.eclipse.osee.orcs.db.internal.util;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
-import org.eclipse.osee.database.schema.SchemaResource;
-import org.eclipse.osee.database.schema.SchemaResourceProvider;
+import org.eclipse.osee.jdbc.JdbcSchemaResource;
import org.eclipse.osee.logger.Log;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.FrameworkUtil;
import org.osgi.framework.InvalidSyntaxException;
import org.osgi.framework.ServiceReference;
+import com.google.common.base.Supplier;
/**
* @author Roberto E. Escobar
*/
-public class DynamicSchemaResourceProvider implements SchemaResourceProvider {
+public class DynamicSchemaResourceProvider implements Supplier<Iterable<JdbcSchemaResource>> {
private final Log logger;
@@ -35,24 +35,23 @@ public class DynamicSchemaResourceProvider implements SchemaResourceProvider {
}
@Override
- public Collection<SchemaResource> getSchemaResources() {
- List<SchemaResource> resources = new ArrayList<SchemaResource>();
+ public Iterable<JdbcSchemaResource> get() {
+ List<JdbcSchemaResource> resources = new ArrayList<JdbcSchemaResource>();
Bundle bundle = FrameworkUtil.getBundle(this.getClass());
BundleContext context = bundle.getBundleContext();
try {
- Collection<ServiceReference<SchemaResource>> references =
- context.getServiceReferences(SchemaResource.class, null);
+ Collection<ServiceReference<JdbcSchemaResource>> references =
+ context.getServiceReferences(JdbcSchemaResource.class, null);
- for (ServiceReference<SchemaResource> ref : references) {
- SchemaResource resource = context.getService(ref);
+ for (ServiceReference<JdbcSchemaResource> ref : references) {
+ JdbcSchemaResource resource = context.getService(ref);
resources.add(resource);
}
} catch (InvalidSyntaxException ex) {
logger.warn(ex.toString(), ex);
}
-
return resources;
}
diff --git a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/util/IdentityManagerImpl.java b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/util/IdentityManagerImpl.java
index 1da47fffd4..ad92228553 100644
--- a/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/util/IdentityManagerImpl.java
+++ b/plugins/org.eclipse.osee.orcs.db/src/org/eclipse/osee/orcs/db/internal/util/IdentityManagerImpl.java
@@ -11,11 +11,10 @@
package org.eclipse.osee.orcs.db.internal.util;
import org.eclipse.osee.framework.core.exception.OseeDataStoreException;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
-import org.eclipse.osee.framework.database.core.IOseeSequence;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.GUID;
import org.eclipse.osee.framework.jdk.core.util.HexUtil;
+import org.eclipse.osee.jdbc.JdbcClient;
import org.eclipse.osee.orcs.db.internal.IdentityManager;
/**
@@ -23,35 +22,36 @@ import org.eclipse.osee.orcs.db.internal.IdentityManager;
*/
public class IdentityManagerImpl implements IdentityManager {
- private final IOseeDatabaseService dbService;
+ private final JdbcClient client;
- public IdentityManagerImpl(IOseeDatabaseService dbService) {
+ public IdentityManagerImpl(JdbcClient client) {
super();
- this.dbService = dbService;
+ this.client = client;
}
- private IOseeSequence getSequence() throws OseeDataStoreException {
- return dbService.getSequence();
+ @Override
+ public int getNextTransactionId() {
+ return (int) client.getNextSequence(TRANSACTION_ID_SEQ);
}
@Override
- public int getNextArtifactId() throws OseeCoreException {
- return getSequence().getNextArtifactId();
+ public int getNextArtifactId() {
+ return (int) client.getNextSequence(ART_ID_SEQ);
}
@Override
- public int getNextAttributeId() throws OseeCoreException {
- return getSequence().getNextAttributeId();
+ public int getNextAttributeId() {
+ return (int) client.getNextSequence(ATTR_ID_SEQ);
}
@Override
- public int getNextRelationId() throws OseeCoreException {
- return getSequence().getNextRelationId();
+ public int getNextRelationId() {
+ return (int) client.getNextSequence(REL_LINK_ID_SEQ);
}
@Override
- public long getNextGammaId() throws OseeCoreException {
- return getSequence().getNextGammaId();
+ public long getNextGammaId() {
+ return (int) client.getNextSequence(GAMMA_ID_SEQ);
}
@Override
@@ -70,7 +70,7 @@ public class IdentityManagerImpl implements IdentityManager {
@Override
public void invalidateIds() throws OseeDataStoreException {
- getSequence().clear();
+ client.invalidateSequences();
}
}
diff --git a/plugins/org.eclipse.osee.orcs.test/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.orcs.test/META-INF/MANIFEST.MF
index af5903244d..7d062ad376 100644
--- a/plugins/org.eclipse.osee.orcs.test/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.orcs.test/META-INF/MANIFEST.MF
@@ -10,7 +10,7 @@ Import-Package: com.google.common.base;version="[11.0.0,15.0.0)",
com.google.common.collect;version="[11.0.0,15.0.0)",
org.eclipse.osee.event,
org.eclipse.osee.framework.core.services,
- org.eclipse.osee.framework.database,
+ org.eclipse.osee.jdbc,
org.eclipse.osee.logger,
org.eclipse.osee.orcs.db.mock,
org.hamcrest.core,
diff --git a/plugins/org.eclipse.osee.orcs.test/pom.xml b/plugins/org.eclipse.osee.orcs.test/pom.xml
index 078fcb35fc..ee248df87e 100644
--- a/plugins/org.eclipse.osee.orcs.test/pom.xml
+++ b/plugins/org.eclipse.osee.orcs.test/pom.xml
@@ -31,11 +31,6 @@
</dependency>
<dependency>
<type>eclipse-plugin</type>
- <artifactId>org.eclipse.osee.database.schema</artifactId>
- <version>0.0.0</version>
- </dependency>
- <dependency>
- <type>eclipse-plugin</type>
<artifactId>org.eclipse.osee.event.osgi</artifactId>
<version>0.0.0</version>
</dependency>
@@ -68,17 +63,7 @@
<type>eclipse-plugin</type>
<artifactId>org.eclipse.osee.framework.core</artifactId>
<version>0.0.0</version>
- </dependency>
- <dependency>
- <type>eclipse-plugin</type>
- <artifactId>org.eclipse.osee.framework.database</artifactId>
- <version>0.0.0</version>
</dependency> -->
- <dependency>
- <type>eclipse-plugin</type>
- <artifactId>org.eclipse.osee.hsqldb</artifactId>
- <version>0.0.0</version>
- </dependency>
<!-- <dependency>
<type>eclipse-plugin</type>
<artifactId>org.eclipse.osee.framework.jdk.core</artifactId>
@@ -183,32 +168,7 @@
<type>eclipse-plugin</type>
<artifactId>org.hsqldb</artifactId>
<version>0.0.0</version>
- </dependency>
-
-
-
- <!-- <dependency> <type>eclipse-plugin</type> <artifactId>org.eclipse.xtext</artifactId>
- <version>0.0.0</version> </dependency> <dependency> <type>eclipse-plugin</type>
- <artifactId>org.eclipse.xtext.util</artifactId> <version>0.0.0</version>
- </dependency> <dependency> <type>eclipse-plugin</type> <artifactId>org.antlr.runtime</artifactId>
- <version>0.0.0</version> </dependency> <dependency> <type>eclipse-plugin</type>
- <artifactId>org.aopalliance</artifactId> <version>0.0.0</version> </dependency>
- <dependency> <type>eclipse-plugin</type> <artifactId>com.google.inject</artifactId>
- <version>0.0.0</version> </dependency> <dependency> <type>eclipse-plugin</type>
- <artifactId>com.google.collect</artifactId> <version>0.0.0</version> </dependency>
- <dependency> <type>eclipse-plugin</type> <artifactId>org.eclipse.emf.common</artifactId>
- <version>0.0.0</version> </dependency> <dependency> <type>eclipse-plugin</type>
- <artifactId>org.eclipse.emf.compare</artifactId> <version>0.0.0</version>
- </dependency> <dependency> <type>eclipse-plugin</type> <artifactId>org.eclipse.emf.compare.diff</artifactId>
- <version>0.0.0</version> </dependency> <dependency> <type>eclipse-plugin</type>
- <artifactId>org.eclipse.emf.compare.match</artifactId> <version>0.0.0</version>
- </dependency> <dependency> <type>eclipse-plugin</type> <artifactId>org.eclipse.emf.ecore</artifactId>
- <version>0.0.0</version> </dependency> <dependency> <type>eclipse-plugin</type>
- <artifactId>org.eclipse.emf.ecore.xmi</artifactId> <version>0.0.0</version>
- </dependency> <dependency> <type>eclipse-plugin</type> <artifactId>org.eclipse.emf.edit</artifactId>
- <version>0.0.0</version> </dependency> -->
-
-
+ </dependency>
</dependencies>
</configuration>
</plugin>
diff --git a/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/OrcsIntegrationRule.java b/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/OrcsIntegrationRule.java
index 1130a91914..57c729e2c9 100644
--- a/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/OrcsIntegrationRule.java
+++ b/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/OrcsIntegrationRule.java
@@ -12,7 +12,6 @@ package org.eclipse.osee.orcs;
import org.eclipse.osee.event.EventService;
import org.eclipse.osee.executor.admin.ExecutorAdmin;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.db.mock.OseeDatabase;
import org.eclipse.osee.orcs.db.mock.OsgiRule;
@@ -30,8 +29,9 @@ public final class OrcsIntegrationRule extends OsgiRule {
// Utility
}
- public static TestRule integrationRule(Object testObject, String dbId) {
- return RuleChain.outerRule(new OseeDatabase(dbId)).around(new OsgiRule(new CheckServices(), testObject));
+ public static TestRule integrationRule(Object testObject) {
+ return RuleChain.outerRule(new OseeDatabase("orcs.jdbc.service")).around(
+ new OsgiRule(new CheckServices(), testObject));
}
public static class CheckServices {
@@ -40,7 +40,6 @@ public final class OrcsIntegrationRule extends OsgiRule {
@OsgiService public EventAdmin eventAdmin;
@OsgiService public EventService eventService;
@OsgiService public ExecutorAdmin executorAdmin;
- @OsgiService public IOseeDatabaseService dbService;
// @formatter:on
}
diff --git a/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsAttributeLoadingTest.java b/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsAttributeLoadingTest.java
index 686551bb1f..a0427e4ee5 100644
--- a/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsAttributeLoadingTest.java
+++ b/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsAttributeLoadingTest.java
@@ -38,7 +38,7 @@ import org.junit.rules.TestRule;
public class OrcsAttributeLoadingTest {
@Rule
- public TestRule osgi = integrationRule(this, "osee.demo.hsql");
+ public TestRule osgi = integrationRule(this);
@OsgiService
private OrcsApi orcsApi;
diff --git a/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsAttributeSearchTest.java b/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsAttributeSearchTest.java
index 37e174155f..eb3dfa785d 100644
--- a/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsAttributeSearchTest.java
+++ b/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsAttributeSearchTest.java
@@ -35,7 +35,7 @@ import org.junit.rules.TestRule;
public class OrcsAttributeSearchTest {
@Rule
- public TestRule osgi = integrationRule(this, "osee.demo.hsql");
+ public TestRule osgi = integrationRule(this);
@OsgiService
private OrcsApi orcsApi;
diff --git a/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsBranchQueryTest.java b/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsBranchQueryTest.java
index 161be18993..300b75c34d 100644
--- a/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsBranchQueryTest.java
+++ b/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsBranchQueryTest.java
@@ -51,7 +51,7 @@ import org.junit.rules.TestRule;
public class OrcsBranchQueryTest {
@Rule
- public TestRule osgi = integrationRule(this, "osee.demo.hsql");
+ public TestRule osgi = integrationRule(this);
@Rule
public TestName testName = new TestName();
diff --git a/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsBranchTest.java b/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsBranchTest.java
index 955ab45189..54307bd379 100644
--- a/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsBranchTest.java
+++ b/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsBranchTest.java
@@ -51,7 +51,7 @@ public class OrcsBranchTest {
private static final String ARTIFACT_NAME = "Joe Smith";
@Rule
- public TestRule osgi = integrationRule(this, "osee.demo.hsql");
+ public TestRule osgi = integrationRule(this);
@OsgiService
private OrcsApi orcsApi;
diff --git a/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsPortingTest.java b/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsPortingTest.java
index a9db836f0f..76e2912844 100644
--- a/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsPortingTest.java
+++ b/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsPortingTest.java
@@ -20,7 +20,7 @@ import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
import org.eclipse.osee.framework.core.enums.CoreBranches;
import org.eclipse.osee.framework.core.enums.SystemUser;
-import org.eclipse.osee.framework.jdk.core.type.OseeStateException;
+import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.type.ResultSet;
import org.eclipse.osee.framework.jdk.core.util.GUID;
import org.eclipse.osee.orcs.ApplicationContext;
@@ -48,7 +48,7 @@ public class OrcsPortingTest {
public ExpectedException thrown = ExpectedException.none();
@Rule
- public TestRule osgi = integrationRule(this, "osee.demo.hsql");
+ public TestRule osgi = integrationRule(this);
@OsgiService
private OrcsApi orcsApi;
@@ -126,7 +126,7 @@ public class OrcsPortingTest {
assertNotNull(copyTxBranch);
// There should only be one Port Branch per associated artifact. Expecting an exception
- thrown.expect(OseeStateException.class);
+ thrown.expect(OseeCoreException.class);
thrown.expectMessage(String.format("Existing port branch creation detected for [%s]", branchString));
createCopyFromTransactionBranch(differentBranchTx, assocArtifactGuid);
fail(); // should never get here due to thrown exception
diff --git a/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsQueryTest.java b/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsQueryTest.java
index 017da9849b..ed2c3d00d0 100644
--- a/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsQueryTest.java
+++ b/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsQueryTest.java
@@ -63,7 +63,7 @@ import com.google.common.collect.Ordering;
public class OrcsQueryTest {
@Rule
- public TestRule osgi = integrationRule(this, "osee.demo.hsql");
+ public TestRule osgi = integrationRule(this);
private final boolean includeMatchLocationTests = false;
diff --git a/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsRelationLoadingTest.java b/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsRelationLoadingTest.java
index a3294db751..b9c4010460 100644
--- a/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsRelationLoadingTest.java
+++ b/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsRelationLoadingTest.java
@@ -39,7 +39,7 @@ import org.junit.rules.TestRule;
public class OrcsRelationLoadingTest {
@Rule
- public TestRule osgi = integrationRule(this, "osee.demo.hsql");
+ public TestRule osgi = integrationRule(this);
@OsgiService
private OrcsApi orcsApi;
diff --git a/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsScriptTest.java b/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsScriptTest.java
index 4580229d6c..980a701fba 100644
--- a/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsScriptTest.java
+++ b/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsScriptTest.java
@@ -36,7 +36,7 @@ import org.junit.runners.Parameterized.Parameters;
public class OrcsScriptTest {
@Rule
- public TestRule osgi = integrationRule(this, "osee.demo.hsql");
+ public TestRule osgi = integrationRule(this);
@OsgiService
private OrcsApi orcsApi;
diff --git a/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsTransactionTest.java b/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsTransactionTest.java
index 496d4014fb..f018464f80 100644
--- a/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsTransactionTest.java
+++ b/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsTransactionTest.java
@@ -75,7 +75,7 @@ public class OrcsTransactionTest {
public ExpectedException thrown = ExpectedException.none();
@Rule
- public TestRule osgi = integrationRule(this, "osee.demo.hsql");
+ public TestRule osgi = integrationRule(this);
@Rule
public TestName testName = new TestName();
diff --git a/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsTxQueryTest.java b/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsTxQueryTest.java
index e5545b289a..c3e7f1765a 100644
--- a/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsTxQueryTest.java
+++ b/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsTxQueryTest.java
@@ -49,7 +49,7 @@ import org.junit.rules.TestRule;
public class OrcsTxQueryTest {
@Rule
- public TestRule osgi = integrationRule(this, "osee.demo.hsql");
+ public TestRule osgi = integrationRule(this);
@Rule
public TestName testName = new TestName();
diff --git a/plugins/org.eclipse.osee.x.server.p2/demo/hsql.zip b/plugins/org.eclipse.osee.x.server.p2/demo/hsql.zip
index 57bdd45d91..770ba64b62 100644
--- a/plugins/org.eclipse.osee.x.server.p2/demo/hsql.zip
+++ b/plugins/org.eclipse.osee.x.server.p2/demo/hsql.zip
Binary files differ

Back to the top