db4o_8.0对象数据库官方文档翻译_学习笔记一[通俗易懂]

db4o_8.0对象数据库官方文档翻译_学习笔记一[通俗易懂]Welcomedb4o 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

大家好,又见面了,我是你们的朋友全栈君。

官网软件下载可能过慢,以下为我的分享:

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.NETMono的开源对象数据.

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:

db4oJava发布版本是以一个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.

db4oAPI文档以JavaDocsHTML文件格式提供。当你阅读这份指南的时候,偶尔翻阅一下这个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.

OMEdb4o数据库的一个对象浏览器,它的安装可以在/ome文件夹下的介绍中找到,这个文件夹下的zip压缩文件包含了EclipseOME插件版本。

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.db4ocom.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.Db4ocom.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.db4ocom.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

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/162606.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • mysql查询语句菜鸟教程_数据库的查询语句大全

    mysql查询语句菜鸟教程_数据库的查询语句大全常规查询查询所有字段:select*from表名;查询指定字段:select列1,列2,…from表名;使用as给字段起别名:select字段as名字….from表名;查询某个表的某个字段:select表名.字段….from表名;可以通过as给表起别名:select别名.字段….from表名as别名;消除重复行:…

    2025年10月5日
    2
  • Python 函数 | map 函数详解

    Python 函数 | map 函数详解博友们 你们好 很高兴能在这里和大家分享技术文章 我是 AmoXiang 是一名在职企业员工 Amo 来源于上家公司的英文名 本意是爱 作为刚入行几年互联网行业的小白 博主写博客一方面是为了记录自己的学习过程以及所犯的错误 更多的是希望能够帮助到很多处于起步阶段的萌新 让他们少走弯路 在编写文章时 参考了大量书籍及一些互联网大佬的资源 并结合了自己的工作经验 博主本着科学 严谨的态度 力求精益求精 但疏漏之处在所难免 敬请广大博友批评指正 博客主页 https blog csdn net xw16

    2025年12月3日
    4
  • php本地环境搭建教程,用 phpstudy 搭建本地 php 环境及安装 wordpress 教程「建议收藏」

    php本地环境搭建教程,用 phpstudy 搭建本地 php 环境及安装 wordpress 教程「建议收藏」很多时候我们仅仅为了测试一个项目或者临时搭建网站,用不着去vps服务器上添加,在本地搭建php环境就够了。这样就需要一个能够在windows系统中搭建本地php环境的软件包,这类软件包蛮多的,目前用的比较多的比如phpstudy,今天魏艾斯博客来介绍用phpstudy搭建本地php环境及本地安装wordpress教程。一、phpstudy下载安装。老魏建议从官方网站下…

    2022年6月16日
    44
  • java项目介绍_java项目介绍及创建[通俗易懂]

    java项目介绍_java项目介绍及创建[通俗易懂]大家配好环境,安装好编译器(eclipse)后,应该建立第一个项目“Helloword”一、在建立项目之前,来介绍一下项目的结构。1、class(类)项目中的最小单位,一个类中存放着相应的方法和量。2、package(包):存放类的空间。为了更好地组织类,Java提供了包机制。包是类的容器,用于分隔类名空间。如果没有指定包名,所有的示例都属于一个默认的无名包。3、folder(文件夹):存放包…

    2022年7月7日
    35
  • HYSBZ 2243 染色 (树链拆分)

    HYSBZ 2243 染色 (树链拆分)

    2022年1月3日
    37
  • 反射型XSS、存储型XSS及DOM型XSS到底有什么区别?????「建议收藏」

    反射型XSS、存储型XSS及DOM型XSS到底有什么区别?????「建议收藏」被攻击者是单一解析地方不同存储时间不同允许点的不同

    2022年5月3日
    51

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号