db4o_8.0对象数据库官方文档翻译_学习笔记一
官網軟件下載可能過慢,以下為我的分享:
db4o-8.0-java.zip (包含db4o的API及jar包,以及OME插件等):?http://pan.baidu.com/s/1gdBx13X
Eclipse分享(適合OME插件的Eclipse版本):http://pan.baidu.com/s/1kTEDgf9
Welcome
db4o?is?the?native?Java,?.NET?and?Mono?open?source?object?database.
db4o是本地的Java,.NET和Mono的開源對象數據庫.
This?tutorial?was?written?to?get?you?started?with?db4o?as?quickly?as?possible.?Before?you?start,?please?make?sure?that?you?have?downloaded?the?latest?db4o?distribution?from?the?db4objects?website.
寫這份指南是為了讓你能夠對db4o盡快上手。在開始之前,請首先確保你已經從db4objects的網站上下載了最新的db4o發行包。
developer.db4o.com
You?are?invited?to?join?the?db4o?community?in?the?public?db4o?forums?to?ask?for?help?at?any?time.
你被邀請加入db4o社區的公共論壇,在那里可以隨時請求幫助。
?
Links
In?order?to?access?free?developer?resources?you?may?want?to?register?on?db4o?developer?website.
Feel?free?register?to?the?forums?http://www.db4o.com/Users/register.aspx.
為了可以訪問免費的開發者資源,你可能需要在db4o開發者網站上要注冊一個賬號,論壇的注冊網址為:http://www.db4o.com/Users/register.aspx
?
And?here?are?some?further?links?on?developer.db4o.com?that?you?may?find?useful:
下面是一些?developer.db4o.com?上的一些可能對你比較有用的鏈接:
All?Downloads
SVN?Repository
Community?Projects
?
Download?Contents(下載內容)
The?db4o?Java?distribution?comes?as?one?zip?file,?db4o-8.0-java.zip.?When?you?unzip?this?file,?you?get?the?following?directory?structure:
db4o的Java發布版本是以一個zip文件(db4o-8.0-java.zip)的形式進行發布的。解壓縮這個文件后,你將獲得下面的目錄結構:
?
Please?take?a?look?at?all?the?supplied?documentation?formats?to?choose?the?one?that?works?best?for?you:
.請看一下所有的文檔格式,選擇一個最適合你的:
db4o-8.0/doc/api/index.html
The?API?documentation?for?db4o?is?supplied?as?JavaDocs?HTML?files.?While?you?read?through?this?tutorial?it?may?be?helpful?to?look?into?the?API?documentation?occasionally.
db4o的API文檔以JavaDocs的HTML文件格式提供。當你閱讀這份指南的時候,偶爾翻閱一下這個API文檔是很有幫助的。
?
db4o-8.0/doc/reference/index.html
The?reference?documentation?is?a?complete?compilation?for?experienced?db4o?users.
參考文檔是對有經驗的db4o用戶來說是一個完整的編輯物。
?
db4o-8.0/doc/tutorial/index.html
This?is?the?interactive?HTML?tutorial.?Examples?can?be?run?"live"?against?a?db4o?database?from?within?the?browser.?In?order?to?use?the?interactive?functionality?a?Java?JRE?1.3?or?above?needs?to?be?installed?and?integrated?into?the?browser.?Java?security?settings?have?to?allow?applets?to?be?run.?If?you?have?problems?using?the?interactive?functionality,?please?refer?to?Tutorial?Troubleshooting.
這是交互式的HTML的指南。示例可以依靠一個db4o數據庫在瀏覽器上實時運行。為了使用交互功能:你需要安裝一個1.3或更新版本的JRE并把它集成到瀏覽器里。Java的安全設置必須允許運行applet,如果你在使用交互功能的時候遇到了問題,請參考指南的Tutorial?Troubleshooting?部分。
?
db4o-8.0/doc/tutorial/db4o-8.0-tutorial.pdf
The?PDF?version?of?the?tutorial?allows?best?fulltext?search?capabilities.
這份PDF版本的指南很好的支持全文檢索功能。
1.?First?Glance?(開始前的了解)
Before?diving?straight?into?the?first?source?code?samples?let's?get?you?familiar?with?some?basics.
在進入第一個示例代碼之前,讓我們先了解一些必要的基礎知識。
1.1.?The?db4o?engine?(db4o引擎)
The?db4o?object?database?engine?consists?of?one?single?core?jar?file.?In?addition?you?may?want?to?use?client/server?library?or?optional?components.?You?may?also?get?it?all?in?a?single?jar?"db4o-all":
do4o對象數據庫引擎由一個Jar文件組成。另外你可能想要使用客戶機/服務器庫或可選組件,其實你都可以在一個jar包(?db4o-all)中得到你想要的。
?
db4o-8.0-core-java1.1.jar
will?run?with?most?Java?JDKs?that?supply?JDK?1.1.x?functionality?such?as?reflection?and?Exception?handling.?That?includes?many?IBM?J9?configurations,?Symbian?and?Savaje.
運行在大部分支持JDK1.1特性(如反射及異常處理)的java?JDK,其中包括了一些IBM?J9?configurations,Symbian?和?Savaje。
?
db4o-8.0-core-java1.2.jar
is?built?for?all?Java?JDKs?between?1.2?and?1.4.
用于1.2?至1.4?版本的Java?JDK。
db4o-8.0-core-java5.jar
is?built?for?Java?JDK?5?and?JDK?6
用于1.5?至1.6?版本的Java?JDK。
?
If?you?intend?to?use?client/server?version?of?db4o?you?will?additionally?need?client/server?library
如果你想要使用客戶端/服務器版本的db4o,你可能需要額外的一些客戶端/服務器的包
matching?your?JDK?version(對應你的jdk版本):
db4o-8.0-cs-java1.1.jar
db4o-8.0-cs-java1.2.jar
db4o-8.0-cs-java5.jar
Some?advanced?functionality?such?as?cluster?support,?platform-specific?IO?adapters,
statistic?tools?etc?can?be?added?by?including?db4o?optional?library:
一些高級的功能,例如集群支持,特定于平臺的IO適配器,統計工具等也可以通過添加db4o可選包支持。
db4o-8.0-optional-java1.1.jar
db4o-8.0-optional-java1.2.jar
db4o-8.0-optional-java5.jar
You?can?also?get?all?of?the?above?in?a?single?jar:
你也可以通過一個jar包,獲得以上所有的功能支持。
?
db4o-8.0-all-java1.1.jar
db4o-8.0-all-java1.2.jar
db4o-8.0-all-java5.jar
?
1.2.?Installation(安裝)
If?you?add?one?of?the?above?db4o-*.jar?files?to?your?CLASSPATH?db4o?is?installed.?For?beginners?it?is?recommended?to?use?"db4o-all"?library?to?avoid?confusion?with?the?location?of?certain?classes.?In?case?you?work?with?an?integrated?development?environment?like?Eclipse?you?would?copy?the?db4o-*.jar?to?the?/lib/?folder?under?your?project?and?add?db4o?to?your?project?as?a?library.
只要把上面的?db4o-*.jar中的某個添加到CLASSPATH中,就算完成了db4o的安裝。初學者建議使用“db4o-all”庫,以避免對于某些類的位置混淆。假如你使用像Eclipse這樣的IDE,那么就應該把?db4o-*.jar復制到項目文件夾中的lib目錄下,并把db4o作為一個代碼庫加到你的項目當中。
1.3.?Object?Manager?Enterprise?installation(OME)
Object?Manager?Enterprise?(OME)?is?an?object?browser?for?db4o?databases.?OME?installation?can?be?found?in?/ome?folder?of?the?distribution.?The?zip?file?in?this?folder?contains?the?Eclipse?plugin?version?of?OME.
OME是db4o數據庫的一個對象瀏覽器,它的安裝可以在/ome文件夾下的介紹中找到,這個文件夾下的zip壓縮文件包含了Eclipse的OME插件版本。
To?install?the?plugin,?you?need?to?have?a?version?of?Eclipse?>=?3.3?installed.?Unzip?the?file?to?a?folder?of?your?choice.?Then?open?Eclipse,?select?'Help'?->?'Software?Updates...'?->?'Available?Software'?from?the?menu.?Choose?'Add?Site...'?->?'Local...'?and?select?the?unzipped?folder.?Follow?the?Eclipse?Update?Manager?instructions?for?the?OME?feature?from?here?on.
?
插件的安裝,你壓根安裝一個版本在3.3以上的Eclipse,然后把文件解壓到你指定的目錄,打開?Eclipse,在菜單欄選擇'Help'?->?'Software?Updates...'?->?'Available?Software'?,選擇'Add?Site...'?->?'Local...'?,然后選擇解壓的文件,在這里遵循Eclispe對于OME特性的更新管理指令。
The?actual?menu?structure?may?vary?over?Eclipse?versions.?(The?above?applies?to?Eclipse?3.4?Ganymede.)?When?in?doubt,?please?refer?to?the?Eclipse?documentation?on?Software?Updates.
?
Alternatively,?you?can?install?the?plugin?manually?by?simply?copying?the?contents?of?the?'plugins'?and?'features'?folders?from?the?unzipped?folder?to?the?corresponding?subfolders?in?the?root?folder?of?your?Eclipse?installation.
實際的菜單結構在Eclipse版本可能會有所不同。(以上適用于Eclipse?3.4?Ganymede)。如果有疑問,請參閱Eclipse文檔軟件更新。
?
1.4.?API?Overview(API預覽)
Do?not?forget?the?API?documentation?while?reading?through?this?tutorial.?It?provides?an?organized?view?of?the?API,?looking?from?a?java?package?perspective?and?you?may?find?related?functionality?to?the?theme?you?are?currently?reading?up?on.
For?starters,?the?java?packages?com.db4o?and?com.db4o.query?are?all?that?you?need?to?worry?about.
請在閱讀本指南的時候,不要忘記API文檔。它從Java包(package)的角度出發提供了有組織的API視圖,你可以在閱讀本指南的同時使用它方便地找到與主題相關的功能。
首先,com.db4o、com.db4o.query是我們所需要關心的。
?
com.db4o
The?com.db4o?java?package?contains?almost?all?of?the?functionality?you?will?commonly?need?when?using?db4o.?Two?objects?of?note?are?com.db4o.Db4oEmbedded,?and?the?com.db4o.ObjectContainer?interface.
com.db4o包含了幾乎所有通常所需要用到的功能。其中有兩個值得留意的接口:com.db4o.Db4o和com.db4o.ObjectContainer。
?
The?com.db4o.Db4o?factory?is?your?starting?point.?Static?methods?in?this?class?allow?you?to?open?a?database?file?and?create?an?initial?configuration.?For?client/server?environment?you?will?need?to?use?com.db4o.cs.Db4oClientServer?factory?class?to?start?a?server,?or?connect?to?an?existing?server,?but?this?will?be?discussed?later?,?start?a?server,?or?connect?to?an?existing?server.?The?most?important?interface,?and?the?one?that?you?will?be?using?99%?of?the?time?is?com.db4o.ObjectContainer:?This?is?your?db4o?database.
而com.db4o.Db4o工廠類是我們進行開發的起始點,該類的靜態方法提供了打開數據庫文件、創建初始化的配置的功能。對于客戶端/服務器的環境,你可能需要用com.db4o.cs.Db4oClientServer工廠類來啟動服務或者連接到已有的服務器的功能,這將會稍后討論。com.db4o.ObjectContainer是一個99%的時間都會用到的、最重要的接口:在開發過程中,它就是你的db4o數據庫。
?
-?An?ObjectContainer?can?either?be?a?database?in?single-user?mode?or?a?client?connection?to?a?db4o?server.
-?Every?ObjectContainer?owns?one?transaction.?All?work?is?transactional.?When?you?open?an?ObjectContainer,?you?are?in?a?transaction,?when?you?commit()?or?rollback(),?the?next?transaction?is?started?immediately.
-?Every?ObjectContainer?maintains?it's?own?references?to?stored?and?instantiated?objects.?In?doing?so,?it?manages?object?identities,?and?is?able?to?achieve?a?high?level?of?performance.
-?ObjectContainers?are?intended?to?be?kept?open?as?long?as?you?work?against?them.?When?you?close?an?ObjectContainer,?all?database?references?to?objects?in?RAM?will?be?discarded.?
-?ObjectContainer可以作為單用戶模式的數據庫,也可以作為db4o服務器的客戶端連接。
-?每個ObjectContainer持有一個事務,所有的操作都是事務相關的。?當你打開一個ObjectContainer時?,事務已經開始了,當你commit()或者rollback(),它將會馬上啟動下一個事務。
-?每個ObjectContainer會自己管理那些被其存儲并實例化的對象的引用。而做這些工作的同時,它還管理這對象的唯一標識,這樣是它能夠達到很高的性能。
-?在使用ObjectContainer的過程中,只要你還在使用它,它就會一直保持打開狀態。而當你關閉這個ObjectContainers時,所有保存在內存中的對象引用都將被丟棄掉。
?
com.db4o.ext
In?case?you?wonder?why?you?only?see?very?few?methods?in?an?ObjectContainer,?here?is?why:?The?db4o?interface?is?supplied?in?two?steps?in?two?java?packages,?com.db4o?and?com.db4o.ext?for?the?following?reasons:
也許你會問為什么ObjectContainer里面只有那么少的方法,原因是將db4o接口被分別放置在com.db4o和com.db4o.ext這兩個包中,這么做是為了:
?
-?It's?easier?to?get?started,?because?the?important?methods?are?emphasized.
-?It?will?be?easier?for?other?products?to?copy?the?basic?db4o?interface.
-?It?is?an?example?of?how?a?lightweight?version?of?db4o?could?look.
-?便于快速開始,因為重要的方法都在ObjectContainer中被強調了。
-?其他產品更容易復制db4o的基本接口。
-?很好地展現了一個db4o的輕量級版本。
?
Every?com.db4o.ObjectContainer?object?is?also?an?com.db4o.ext.ExtObjectContainer.?You?can?cast?it?to?ExtObjectContainer?or?you?can?use?the?method?to?get?to?the?advanced?features.
每個com.db4o.ObjectContainer對象同時也是一個com.db4o.ext.ExtObjectContainer對象。你可以把它轉換成ExtObjectContainer,或者可以使用方法來獲得更高級的特性。
?
com.db4o.config
The?com.db4o.config?java?package?contains?types?and?classes?necessary?to?configure?db4o.?The?objects?and?interfaces?within?are?discussed?in?the?Configuration?section.
com.db4o.config包里面包含了配置db4o所需的類型和類,我們將在配置章節中討論它的對象和接口。
?
com.db4o.query
The?com.db4o.query?java?package?contains?the?Predicate?class?to?construct?Native?Queries.?The?Native?Query?interface?is?the?primary?db4o?querying?interface?and?should?be?preferred?over?the?Soda?Query?API.
com.db4o.query包中包含了用來構造原生查詢的Predicate類。Native?Query接口是db4o最主要的查詢接口,并且它應該比Soda查詢API更常用。
?
db4o_8.0對象數據庫官方文檔翻譯_學習筆記二:
http://blog.csdn.net/oceans521/article/details/43194621總結
以上是生活随笔為你收集整理的db4o_8.0对象数据库官方文档翻译_学习笔记一的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 家用计算机的发展历史,计算机发展简史
- 下一篇: vb 修改sql数据库服务器,vb连接服