hibernate 官方入门教程第一部分 - 第一个 Hibernate 程序首先我们将创建一个简单的控制台(console-based)Hibernate 程序
我们使用内置数据库(in-memory database) (HSQL DB),所以我们不必安装任何数据库服务器
让我们假设我们希望有一个小程序可以保存我们希望关注的事件(Event)和这些事件的信息
(译者注:在本教程的后面部分,我们将直接使用 Event 而不是它的中文翻译“事件”,以免混淆
)我们做的第一件事是建立我们的开发目录,并把所有需要用到的 Java 库文件放进去
从Hibernate 网站的下载页面下载 Hibernate 分发版本
解压缩包并把/lib 下面的所有库文件放到我们新的开发目录下面的/lib 目录下面
看起来就像这样:
+lib antlr
jarcglib-full
jarasm
jarasm-attrs
jarscommons-collections
jarcommons-logging
jar ehcache
jar hibernate3
jar jta
jar dom4j
jar log4j
jarThis is the minimum set of required libraries (note that we also copied hibernate3
jar, the mainarchive) for Hibernate
See the README
txt file in the lib/ directory of the Hibernate distributionfor more information about required and optional third-party libraries
(Actually, Log4j is notr