熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> Java編程 >> Java核心技術 >> 正文

基於Geodatabase數據模型的版本機制

2022-06-13   來源: Java核心技術 

  一版本是什麼?(What is Version?)

  版本(version)是ArcGIS軟件在多用戶關系數據庫基礎上依托ArcSDE服務而提供的長事務處理工具在個人geodatabase中無法實現版本功能

  Versioning allows multiple users to edit spatial and tabular data simultaneously in a long transaction environment Users can directly modify the database without having to extract data or lock features in advance The object model provides functionality to create and administer versions register and unregister classes as versioned detect differences between versions and reconcile and post versions    一版本是什麼?(What is Version?)

  版本(version)是ArcGIS軟件在多用戶關系數據庫基礎上依托ArcSDE服務而提供的長事務處理工具在個人geodatabase中無法實現版本功能

  Versioning allows multiple users to edit spatial and tabular data simultaneously in a long transaction environment Users can directly modify the database without having to extract data or lock features in advance The object model provides functionality to create and administer versions register and unregister classes as versioned detect differences between versions and reconcile and post versions

  Geodatabase數據模型提供的版本化機制允許多用戶在長事務處理環境中同時編輯空間和屬性數據用戶無須預先數據復制和鎖定要素就可以直接編輯這一數據模型提供了諸如以下的功能創建和管理版本注冊和不注冊要素類檢測各個版本之間的差異協調及提交版本

  二怎樣來理解版本?(How to Understand Version?)

  版本是命了名字的geodatabase狀態你可以使用版本來模擬工程設計建造工作以及geodatabase的一個快照還有任何類型的涉及正在進展的what if 問題研究的流程

  版本跨越整個geodatabase並且擁有屬性在ArcCatalog中你可以指定哪些對象在geodatabase中是版本化的你可以選擇性的指定哪些數據要素集要素類還有表注冊成為版本通過設置權限你可以控制其它用戶對你的數據的版本是否可見

  同一個geodatabase中允許多個版本的存在

  版本之間的本質區別在於行為狀態而不是方案版本創建之後便呈現給你所有編輯工作的無中斷視圖其中行的狀態反應了所有的對象添加刪除以及修改操作這些狀態的變化都被保存在它的歸檔文件中

  每個版本geodatabase都有一個默認的(default)版本默認版本實際是geodatabase本身

  三版本與版本之間的關系

  默認版本是所有版本的起始版本(ancestor)除了默認版本每個版本只能擁有一個父版本在確保該版本的所有子版本被刪除後該版本可以被刪除

  版本中的編輯變化可被協調並提交給另外一個版本(這涉及到geodatabase復制將另外專門討論)

  用戶可以連接任意一個授權於他的版本

  四AE提供的類圖與接口

  

  VersionedWorkspace類及其接口

  A VersionedWorkspace is a Workspace that supports multiuser editing and multiple representations of features classes and tables in a relational database system VersionedWorkspaces support the IVersionedWorkspace interface

  VersionedWorkspace類是Workspace類的一個子類在關系數據庫系統中它允許多用戶編輯以及要素類及數據表多樣化的表達它向用戶提供了IVersionedWorkspace接口

  A list of all versions to which the user has permissions can be retrieved using the Versions property The versions returned are either owned by the connected user or have public access

  通過IVersionedWorkspace接口提供的Versions的屬性用戶可以得到授予他們訪問權限的VersionedWorkspace中的所有版本

  通過Versions屬性得到的對象是一個枚舉型變量——EnumVersionInfo

  通過IVersionedWorkspace接口提供的FindVersion方法用戶可以通過版本名稱進行查找而得到該版本

  The IVersion interface is used to manage the properties of a version as well as create new versions Creating a new version requires an existing version to be the parent of the new version When the new version is created the parent and child versions are identical

  IVersion接口向用戶提供了創建及管理版本屬性的功能創建一個新版本要求一個已經存在的版本作為其父版本當新版本被創建時版本之間的關系(父與子)也就被確立了

  下面是更新版本屬性的C#代碼示例

  //假設你已經得到dataset的引用 IVersion version = (IVersion)datasetWorkspace; IVersionInfo versionInfo = versionVersionInfo; if(versionInfoIsOwner) {    versionAccess = esriVersionAccessesriVersionAccessPublic; }

  DataSet類與IVersionedObject and IVersionedObject接口

  通過IVersionedOjbect或IVersionedObject接口提供的RegisterAsVersioned方法用戶可以注冊或不注冊要素數據集或要素類為版本如果注冊為版本則將在數據庫中創建兩個額外的表以記錄版本的行為狀態發生的變化

  Table類與IVersionedTableIConflictClass接口:

  在進行協調操作之前一般需要通過IVersionedTabled接口提供的Differences方法來檢測源版本與目標版本之間存在的沖突

  經過協調(Reconcile)處理後IConflictClass接口提供了得到沖突選擇集的機制通過其提供的DeleteUpdateUpdateDeleteUpdateUpdates屬性用戶可以得到相應的SelectionSet

  


From:http://tw.wingwit.com/Article/program/Java/hx/201311/26202.html
  • 上一篇文章:

  • 下一篇文章:
  • 推薦文章
    Copyright © 2005-2022 電腦知識網 Computer Knowledge   All rights reserved.