NHibernate 文档 1.0.0.0

NHibernate

感谢所有的贡献者!

Status: Beta. Generated on 2005-10-10 16:13:02Z.

This product is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This product is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this product; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".

For more information, go to this website.


目录

前言
1. 体系结构
总览
2. ISessionFactory配置
可编程配置方式
获取ISessionFactory
用户自己提供ADO.NET连接
NHibernate提供ADO.NET连接
可选配置属性
SQL Dialects SQL 方言
外连接抓取(Outer Join Fetching)
自定义CacheProvider
查询语句替换
Logging
3. 持久化类(Persistent Classes)
POCO简单示例
为一个持久化字段声明getters和setters访问器 (可选)
实现一个默认的构造函数
提供一个标识(identifier)属性(可选)
建议使用不是sealed的类(可选)
实现继承
实现Equals()GetHashCode()
持久化生命周期 (Lifecycle)中的回调( Callbacks)
合法性检查(Validatable)回调
用属性(Attributes)代替XML
I. NHibernate 映射
4.O/R Mapping基础
映射声明(Mapping declaration)
Schema
hibernate-mapping
class
id
联合ID(composite-id)
识别器(discriminator)
版本(version)(可选)
时间戳(timestamp)(可选)
property
多对一(Many-to-one)
一对一(One-to-one)
组件(Component)
子类(subclass)
连接的子类(Joined-subclass)
map, set, list, bag
引用(import)
NHibernate的类型
实体(Entities)和值(values)
基本值类型
自定义值类型
映射到任意(Any)类型
SQL中引号包围的标识符
映射文件的模块化(Modular mapping files)
5. 集合类(Collections)映射
持久化集合类(Persistent Collections)
映射集合(Mapping a Collection)
值集合和多对多关联(Collections of Values and Many-To-Many Associations)
一对多关联(One-To-Many Associations)
延迟初始化(延迟加载)(Lazy Initialization)
集合排序(Sorted Collections)
使用 <idbag>
双向关联(Bidirectional Associations)
三重关联(Ternary Associations)
异类关联(Heterogeneous Associations)
集合例子
6. 关联映射
简介
单向关联
多对一(many to one)
一对一(one to one)
一对多(one to many)
使用表连接的单向关联
一对多(one to many)
多对一(many to one)
一对一(one to one)
多对多(many to many)
双向关联
一对多(one to many) / 多对一(many to one)
一对一(one to one)
使用表连接的双向关联
一对多(one to many) / 多对一(many to one)
一对一(one to one)
多对多(many to many)
7. 示例: Parent/Child
关于collections
双向的一对多关系(Bidirectional one-to-many)
级联生命周期(Cascading lifecycle)
级联更新(Using cascading update())
结论
II. NHibernateContrib 文档
前言
8. NHibernate缓存(NHibernate.Caches
如何使用?
9. 使用 AttributesNHibernate.Mapping.Attributes
如何使用?
提示
已知的问题和TODOs
开发者须知
10. NHibernate.Tool.hbm2net
11. Nullables
如何使用?
12. 第12章 更多的信息和支持
A. GNU Lesser General Public License
B. GNU Free Documentation License

表目录

2.1. NHibernate ADO.NET 属性
2.2. NHibernate 配置属性
2.3. NHibernate SQL 方言 (hibernate.dialect)
4.1. 访问策略(Access Strategy)
4.2. 命名策略(Naming Strategy)
4.3. System.ValueType 映射类型
4.4. System.Object 映射类型
4.5. Large Object 映射类型