关于formula one插入问题

towater 2003-12-25 04:41:44
我现在遇到一个问题
就是在formula one模板中定义一个字符@zt
定义变量formu为中文字符形,如formu = '粤'
然后在程序窗口中通过事件执行ole_1.object.textRC[ r00,c00 ] = formu
执行以上语句后在控件ole_1中显示出来的只是乱码,即插入后只是一堆乱字符,不是原来我要插入的'粤'字.

请各位大哥帮忙想想这是怎么一回事,怎样才能解决.
...全文
26 13 打赏 收藏 转发到动态 举报
写回复
用AI写文章
13 条回复
切换为时间正序
请发表友善的回复…
发表回复
towater 2003-12-31
  • 打赏
  • 举报
回复
楼上几位大哥,谢谢你们的这些天的帮助,现在我已经解决了,现在我把解决的方法告诉大家:
只要把我用的win2000-server在控制面板中的区域选项改换成中国(中文),系统语言设置改换成中文(简体)即可解决.
zhangdatou 2003-12-29
  • 打赏
  • 举报
回复
帮你顶~~~~在网上查一下最新的版本
towater 2003-12-29
  • 打赏
  • 举报
回复
哪位大哥会啊,请帮帮我!
towater 2003-12-26
  • 打赏
  • 举报
回复
上一条漏了一点,就是出现乱码的是中文字符,不论是取出来还是赋进去,都是乱码,是怎么一回事.请各位大哥想想!谢谢!
towater 2003-12-26
  • 打赏
  • 举报
回复
'反方向的钟'大哥,我已经按你的方法试了一下,不论是取出来的值,还有赋进去的值还是乱码,是不是有关于pb8内码与formula one内码,还是我的系统内码的问题(我的系统是win2000-server,pb8,sql7),还是有什么地方的设置没有设置好.
jeff_107 2003-12-26
  • 打赏
  • 举报
回复
没用过,帮你up
myclife 2003-12-26
  • 打赏
  • 举报
回复
ole_1.object.Row = 行号
ole_1.object.Col = 列号
ole_sheet.object.Text = 值 //取值反之
towater 2003-12-26
  • 打赏
  • 举报
回复
我又发现了一个问题:
就是我用pb8执行ole_1.object.textRC[ r00,c00 ] = formu插入中文字符时出现乱码,而且用formu = ole_1.object.textRC[ R00, C00 ]读取模板中的中文字符出来,取出来的字符也是乱码.这是怎么一回事呢?请各位大哥帮我想一想,有什么解决的方法.
towater 2003-12-26
  • 打赏
  • 举报
回复
是f16.1.0 build 13
myclife 2003-12-26
  • 打赏
  • 举报
回复
To: towater(泉)

那个用法是没有问题的,你检查一下你的f1版本。
zhangdatou 2003-12-26
  • 打赏
  • 举报
回复
我正在学习使用,这个问题比较困难
towater 2003-12-25
  • 打赏
  • 举报
回复
松鼠大哥,是将定义中的@zt变换成中文,如@证头这样吗?
bunnysky 2003-12-25
  • 打赏
  • 举报
回复
你把你要插入字符的单元格的字符设成中文字符。
1. 在Tomcat中快速上手 1.1. 开始Hibernate之旅 1.2. 第一个持久化类 1.3. 映射cat 1.4. 与Cat同乐 1.5. 结语 2. 架构(Architecture) 2.1. 概况(Overview) 2.2. 实例状态 2.3. JMX整合 2.4. 对JCA的支持 3. 配置 3.1. 可编程的配置方式 3.2. 获得SessionFactory 3.3. JDBC连接 3.4. 可选的配置属性 3.4.1. SQL方言 3.4.2. 外连接抓取(Outer Join Fetching) 3.4.3. 二进制流 (Binary Streams) 3.4.4. 二级缓存与查询缓存 3.4.5. 查询语言中的替换 3.4.6. Hibernate的统计(statistics)机制 3.5. 日志 3.6. 实现NamingStrategy 3.7. XML配置文件 3.8. J2EE应用程序服务器的集成 3.8.1. 事务策略配置 3.8.2. JNDI绑定的SessionFactory 3.8.3. JTA和Session的自动绑定 3.8.4. JMX部署 4. 持久化类(Persistent Classes) 4.1. 一个简单的POJO例子 4.1.1. 为持久化字段声明访问器(accessors)和是否可变的标志(mutators) 4.1.2. 实现一个默认的(即无参数的)构造方法(constructor) 4.1.3. 提供一个标识属性(identifier property)(可选) 4.1.4. 使用非final的类 (可选) 4.2. 实现继承(Inheritance) 4.3. 实现equals()和hashCode() 4.4. 动态模型(Dynamic models) 5. 对象/关系数据库映射基础(Basic O/R Mapping) 5.1. 映射定义(Mapping declaration) 5.1.1. Doctype 5.1.2. hibernate-mapping 5.1.3. class 5.1.4. id 5.1.4.1. Generator 5.1.4.2. 高/低位算法(Hi/Lo Algorithm) 5.1.4.3. UUID算法(UUID Algorithm ) 5.1.4.4. 标识字段和序列(Identity columns and Sequences) 5.1.4.5. 程序分配的标识符(Assigned Identifiers) 5.1.4.6. 触发器实现的主键生成器(Primary keys assigned by triggers) 5.1.5. composite-id 5.1.6. 鉴别器(discriminator) 5.1.7. 版本(version)(可选) 5.1.8. timestamp (optional) 5.1.9. property 5.1.10. 多对一(many-to-one) 5.1.11. 一对一 5.1.12. 组件(component), 动态组件(dynamic-component) 5.1.13. properties 5.1.14. 子类(subclass) 5.1.15. 连接的子类(joined-subclass) 5.1.16. 联合子类(union-subclass) 5.1.17. 连接(join) 5.1.18. 键(key) 5.1.19. 字段和规则元素(column and formula elements) 5.1.20. 引用(import) 5.1.21. any 5.2. Hibernate 的类型 5.2.1. 实体(Entities)和值(values) 5.2.2. 基本值类型 5.2.3. 自定义值类型 5.3. SQL中引号包围的标识符 5.4. 其他元数据(Metadata) 5.4.1. 使用 XDoclet 标记 5.4.2. 使用 JDK 5.0 的注解(Annotation) 6. 集合类(Collections)映射 6.1. 持久化集合类(Persistent collections) 6.2. 集合映射( Collection mappings ) 6.2.1. 集合外键(Collection foreign keys) 6.2.2. 集合元素(Collection elements) 6.2.3. 索引集合类(Indexed collections) 6.2.4. 值集合于多对多关联(Collections of values and many-to-many associations) 6.2.5. 一对多关联(One-to-many Associations) 6.3. 高级集合映射(Advanced collection mappings) 6.3.1. 有序集合(Sorted collections) 6.3.2. 双向关联(Bidirectional associations) 6.3.3. 三重关联(Ternary associations) 6.3.4. 使用 6.4. 集合例子(Collection example) 7. 关联关系映射 7.1. 介绍 7.2. 单向关联(Unidirectional associations) 7.2.1. 多对一(many to one) 7.2.2. 一对一(one to one) 7.2.3. 一对多(one to many) 7.3. 使用连接表的单向关联(Unidirectional associations with join tables) 7.3.1. 一对多(one to many) 7.3.2. 多对一(many to one) 7.3.3. 一对一(one to one) 7.3.4. 多对多(many to many) 7.4. 双向关联(Bidirectional associations) 7.4.1. 一对多(one to many) / 多对一(many to one) 7.4.2. 一对一(one to one) 7.5. 使用连接表的双向关联(Bidirectional associations with join tables) 7.5.1. 一对多(one to many) /多对一( many to one) 7.5.2. 一对一(one to one) 7.5.3. 多对多(many to many) 8. 组件(Component)映射 8.1. 依赖对象(Dependent objects) 8.2. 在集合中出现的依赖对象 8.3. 组件作为Map的索引(Components as Map indices ) 8.4. 组件作为联合标识符(Components as composite identifiers) 8.5. 动态组件 (Dynamic components) 9. 继承映射(Inheritance Mappings) 9.1. 三种策略 9.1.1. 每个类分层结构一张表(Table per class hierarchy) 9.1.2. 每个子类一张表(Table per subclass) 9.1.3. 每个子类一张表(Table per subclass),使用辨别标志(Discriminator) 9.1.4. 混合使用“每个类分层结构一张表”和“每个子类一张表” 9.1.5. 每个具体类一张表(Table per concrete class) 9.1.6. Table per concrete class, using implicit polymorphism 9.1.7. 隐式多态和其他继承映射混合使用 9.2. 限制 10. 与对象共事 10.1. Hibernate对象状态(object states) 10.2. 使对象持久化 10.3. 装载对象 10.4. 查询 10.4.1. 执行查询 10.4.1.1. 迭代式获取结果(Iterating results) 10.4.1.2. 返回元组(tuples)的查询 10.4.1.3. 标量(Scalar)结果 10.4.1.4. 绑定参数 10.4.1.5. 分页 10.4.1.6. 可滚动遍历(Scrollable iteration) 10.4.1.7. 外置命名查询(Externalizing named queries) 10.4.2. 过滤集合 10.4.3. 条件查询(Criteria queries) 10.4.4. 使用原生SQL的查询 10.5. 修改持久对象 10.6. 修改脱管(Detached)对象 10.7. 自动状态检测 10.8. 删除持久对象 10.9. 在两个不同数据库间复制对象 10.10. Session刷出(flush) 10.11. 传播性持久化(transitive persistence) 10.12. 使用元数据 11. 事务和并发 11.1. Session和事务范围(transaction scopes) 11.1.1. 操作单元(Unit of work) 11.1.2. 应用程序事务(Application transactions) 11.1.3. 关注对象标识(Considering object identity) 11.1.4. 常见问题 11.2. 数据库事务声明 11.2.1. 非托管环境 11.2.2. 使用JTA 11.2.3. 异常处理 11.3. 乐观并发控制(Optimistic concurrency control) 11.3.1. 应用程序级别的版本检查(Application version checking) 11.3.2. 长生命周期session和自动版本化 11.3.3. 脱管对象(deatched object)和自动版本化 11.3.4. 定制自动版本化行为 11.4. 悲观锁定(Pessimistic Locking) 12. 拦截器与事件(Interceptors and events) 12.1. 拦截器(Interceptors) 12.2. 事件系统(Event system) 12.3. Hibernate的声明式安全机制 13. 批量处理(Batch processing) 13.1. 批量插入(Batch inserts) 13.2. 批量更新(Batch updates) 13.3. 大批量更新/删除(Bulk update/delete) 14. HQL: Hibernate查询语言 14.1. 大小写敏感性问题 14.2. from子句 14.3. 关联(Association)与连接(Join) 14.4. select子句 14.5. 聚集函数 14.6. 多态查询 14.7. where子句 14.8. 表达式 14.9. order by子句 14.10. group by子句 14.11. 子查询 14.12. HQL示例 14.13. 批量的UPDATE & DELETE语句 14.14. 小技巧 & 小窍门 15. 条件查询(Criteria Queries) 15.1. 创建一个Criteria 实例 15.2. 限制结果集内容 15.3. 结果集排序 15.4. 关联 15.5. 动态关联抓取 15.6. 查询示例 15.7. 投影(Projections)、聚合(aggregation)和分组(grouping) 15.8. 离线(detached)查询和子查询 16. Native SQL查询 16.1. 创建一个基于SQL的Query 16.2. 别名和属性引用 16.3. 命名SQL查询 16.3.1. 使用return-property来明确地指定字段/别名 16.3.2. 使用存储过程来查询 16.3.2.1. 使用存储过程的规则和限制 16.4. 定制SQL用来create,update和delete 16.5. 定制装载SQL 17. 过滤数据 17.1. Hibernate 过滤器(filters) 18. XML映射 18.1. 用XML数据进行工作 18.1.1. 指定同时映射XML和类 18.1.2. 只定义XML映射 18.2. XML映射元数据 18.3. 操作XML数据 19. 提升性能 19.1. 抓取策略(Fetching strategies) 19.1.1. 调整抓取策略(Tuning fetch strategies) 19.1.2. 单端关联代理(Single-ended association proxies) 19.1.3. 实例化集合和代理(Initializing collections and proxies) 19.1.4. 使用批量抓取(Using batch fetching) 19.1.5. 使用子查询抓取(Using subselect fetching) 19.1.6. 使用延迟属性抓取(Using lazy property fetching) 19.2. 二级缓存(The Second Level Cache) 19.2.1. 缓存映射(Cache mappings) 19.2.2. 策略:只读缓存(Strategy: read only) 19.2.3. 策略:读/写缓存(Strategy: read/write) 19.2.4. 策略:非严格读/写缓存(Strategy: nonstrict read/write) 19.2.5. 策略:事务缓存(transactional) 19.3. 管理缓存(Managing the caches) 19.4. 查询缓存(The Query Cache) 19.5. 理解集合性能(Understanding Collection performance) 19.5.1. 分类(Taxonomy) 19.5.2. Lists, maps 和sets用于更新效率最高 19.5.3. Bag和list是反向集合类中效率最高的 19.5.4. 一次性删除(One shot delete) 19.6. 监测性能(Monitoring performance) 19.6.1. 监测SessionFactory 19.6.2. 数据记录(Metrics) 20. 工具箱指南 20.1. Schema自动生成(Automatic schema generation) 20.1.1. 对schema定制化(Customizing the schema) 20.1.2. 运行该工具 20.1.3. 属性(Properties) 20.1.4. 使用Ant(Using Ant) 20.1.5. 对schema的增量更新(Incremental schema updates) 20.1.6. 用Ant来增量更新schema(Using Ant for incremental schema updates) 21. 示例:父子关系(Parent Child Relationships) 21.1. 关于collections 21.2. 双向的一对多关系(Bidirectional one-to-many) 21.3. 级联生命周期(Cascading lifecycle) 21.4. 级联与未保存值(Cascades and unsaved-value) 21.5. 结论 22. 示例:Weblog 应用程序 22.1. 持久化类 22.2. Hibernate 映射 22.3. Hibernate 代码 23. 示例:复杂映射实例 23.1. Employer(雇主)/Employee(雇员) 23.2. Author(作家)/Work(作品) 23.3. Customer(客户)/Order(订单)/Product(产品) 23.4. 杂例 23.4.1. "Typed" one-to-one association 23.4.2. Composite key example 23.4.3. Content based discrimination 23.4.4. Associations on alternate keys 24. 最佳实践(Best Practices)
前言 1. 翻译说明 2. 版权声明 1. 在Tomcat中快速上手 1.1. 开始Hibernate之旅 1.2. 第一个持久化类 1.3. 映射cat 1.4. 与Cat同乐 1.5. 结语 2. 架构(Architecture) 2.1. 概况(Overview) 2.2. 实例状态 2.3. JMX整合 2.4. 对JCA的支持 3. 配置 3.1. 可编程的配置方式 3.2. 获得SessionFactory 3.3. JDBC连接 3.4. 可选的配置属性 3.4.1. SQL方言 3.4.2. 外连接抓取(Outer Join Fetching) 3.4.3. 二进制流 (Binary Streams) 3.4.4. 二级缓存与查询缓存 3.4.5. 查询语言中的替换 3.4.6. Hibernate的统计(statistics)机制 3.5. 日志 3.6. 实现NamingStrategy 3.7. XML配置文件 3.8. J2EE应用程序服务器的集成 3.8.1. 事务策略配置 3.8.2. JNDI绑定的SessionFactory 3.8.3. JTA和Session的自动绑定 3.8.4. JMX部署 4. 持久化类(Persistent Classes) 4.1. 一个简单的POJO例子 4.1.1. 为持久化字段声明访问器(accessors)和是否可变的标志(mutators) 4.1.2. 实现一个默认的(即无参数的)构造方法(constructor) 4.1.3. 提供一个标识属性(identifier property)(可选) 4.1.4. 使用非final的类 (可选) 4.2. 实现继承(Inheritance) 4.3. 实现equals()和hashCode() 4.4. 动态模型(Dynamic models) 5. 对象/关系数据库映射基础(Basic O/R Mapping) 5.1. 映射定义(Mapping declaration) 5.1.1. Doctype 5.1.2. hibernate-mapping 5.1.3. class 5.1.4. id 5.1.4.1. Generator 5.1.4.2. 高/低位算法(Hi/Lo Algorithm) 5.1.4.3. UUID算法(UUID Algorithm ) 5.1.4.4. 标识字段和序列(Identity columns and Sequences) 5.1.4.5. 程序分配的标识符(Assigned Identifiers) 5.1.4.6. 触发器实现的主键生成器(Primary keys assigned by triggers) 5.1.5. composite-id 5.1.6. 鉴别器(discriminator) 5.1.7. 版本(version)(可选) 5.1.8. timestamp (optional) 5.1.9. property 5.1.10. 多对一(many-to-one) 5.1.11. 一对一 5.1.12. 组件(component), 动态组件(dynamic-component) 5.1.13. properties 5.1.14. 子类(subclass) 5.1.15. 连接的子类(joined-subclass) 5.1.16. 联合子类(union-subclass) 5.1.17. 连接(join) 5.1.18. 键(key) 5.1.19. 字段和规则元素(column and formula elements) 5.1.20. 引用(import) 5.1.21. any 5.2. Hibernate 的类型 5.2.1. 实体(Entities)和值(values) 5.2.2. 基本值类型 5.2.3. 自定义值类型 5.3. SQL中引号包围的标识符 5.4. 其他元数据(Metadata) 5.4.1. 使用 XDoclet 标记 5.4.2. 使用 JDK 5.0 的注解(Annotation) 6. 集合类(Collections)映射 6.1. 持久化集合类(Persistent collections) 6.2. 集合映射( Collection mappings ) 6.2.1. 集合外键(Collection foreign keys) 6.2.2. 集合元素(Collection elements) 6.2.3. 索引集合类(Indexed collections) 6.2.4. 值集合于多对多关联(Collections of values and many-to-many associations) 6.2.5. 一对多关联(One-to-many Associations) 6.3. 高级集合映射(Advanced collection mappings) 6.3.1. 有序集合(Sorted collections) 6.3.2. 双向关联(Bidirectional associations) 6.3.3. 三重关联(Ternary associations) 6.3.4. 使用 6.4. 集合例子(Collection example) 7. 关联关系映射 7.1. 介绍 7.2. 单向关联(Unidirectional associations) 7.2.1. 多对一(many to one) 7.2.2. 一对一(one to one) 7.2.3. 一对多(one to many) 7.3. 使用连接表的单向关联(Unidirectional associations with join tables) 7.3.1. 一对多(one to many) 7.3.2. 多对一(many to one) 7.3.3. 一对一(one to one) 7.3.4. 多对多(many to many) 7.4. 双向关联(Bidirectional associations) 7.4.1. 一对多(one to many) / 多对一(many to one) 7.4.2. 一对一(one to one) 7.5. 使用连接表的双向关联(Bidirectional associations with join tables) 7.5.1. 一对多(one to many) /多对一( many to one) 7.5.2. 一对一(one to one) 7.5.3. 多对多(many to many) 8. 组件(Component)映射 8.1. 依赖对象(Dependent objects) 8.2. 在集合中出现的依赖对象 8.3. 组件作为Map的索引(Components as Map indices ) 8.4. 组件作为联合标识符(Components as composite identifiers) 8.5. 动态组件 (Dynamic components) 9. 继承映射(Inheritance Mappings) 9.1. 三种策略 9.1.1. 每个类分层结构一张表(Table per class hierarchy) 9.1.2. 每个子类一张表(Table per subclass) 9.1.3. 每个子类一张表(Table per subclass),使用辨别标志(Discriminator) 9.1.4. 混合使用“每个类分层结构一张表”和“每个子类一张表” 9.1.5. 每个具体类一张表(Table per concrete class) 9.1.6. Table per concrete class, using implicit polymorphism 9.1.7. 隐式多态和其他继承映射混合使用 9.2. 限制 10. 与对象共事 10.1. Hibernate对象状态(object states) 10.2. 使对象持久化 10.3. 装载对象 10.4. 查询 10.4.1. 执行查询 10.4.1.1. 迭代式获取结果(Iterating results) 10.4.1.2. 返回元组(tuples)的查询 10.4.1.3. 标量(Scalar)结果 10.4.1.4. 绑定参数 10.4.1.5. 分页 10.4.1.6. 可滚动遍历(Scrollable iteration) 10.4.1.7. 外置命名查询(Externalizing named queries) 10.4.2. 过滤集合 10.4.3. 条件查询(Criteria queries) 10.4.4. 使用原生SQL的查询 10.5. 修改持久对象 10.6. 修改脱管(Detached)对象 10.7. 自动状态检测 10.8. 删除持久对象 10.9. 在两个不同数据库间复制对象 10.10. Session刷出(flush) 10.11. 传播性持久化(transitive persistence) 10.12. 使用元数据 11. 事务和并发 11.1. Session和事务范围(transaction scopes) 11.1.1. 操作单元(Unit of work) 11.1.2. 应用程序事务(Application transactions) 11.1.3. 关注对象标识(Considering object identity) 11.1.4. 常见问题 11.2. 数据库事务声明 11.2.1. 非托管环境 11.2.2. 使用JTA 11.2.3. 异常处理 11.3. 乐观并发控制(Optimistic concurrency control) 11.3.1. 应用程序级别的版本检查(Application version checking) 11.3.2. 长生命周期session和自动版本化 11.3.3. 脱管对象(deatched object)和自动版本化 11.3.4. 定制自动版本化行为 11.4. 悲观锁定(Pessimistic Locking) 12. 拦截器与事件(Interceptors and events) 12.1. 拦截器(Interceptors) 12.2. 事件系统(Event system) 12.3. Hibernate的声明式安全机制 13. 批量处理(Batch processing) 13.1. 批量插入(Batch inserts) 13.2. 批量更新(Batch updates) 13.3. 大批量更新/删除(Bulk update/delete) 14. HQL: Hibernate查询语言 14.1. 大小写敏感性问题 14.2. from子句 14.3. 关联(Association)与连接(Join) 14.4. select子句 14.5. 聚集函数 14.6. 多态查询 14.7. where子句 14.8. 表达式 14.9. order by子句 14.10. group by子句 14.11. 子查询 14.12. HQL示例 14.13. 批量的UPDATE & DELETE语句 14.14. 小技巧 & 小窍门 15. 条件查询(Criteria Queries) 15.1. 创建一个Criteria 实例 15.2. 限制结果集内容 15.3. 结果集排序 15.4. 关联 15.5. 动态关联抓取 15.6. 查询示例 15.7. 投影(Projections)、聚合(aggregation)和分组(grouping) 15.8. 离线(detached)查询和子查询 16. Native SQL查询 16.1. 创建一个基于SQL的Query 16.2. 别名和属性引用 16.3. 命名SQL查询 16.3.1. 使用return-property来明确地指定字段/别名 16.3.2. 使用存储过程来查询 16.3.2.1. 使用存储过程的规则和限制 16.4. 定制SQL用来create,update和delete 16.5. 定制装载SQL 17. 过滤数据 17.1. Hibernate 过滤器(filters) 18. XML映射 18.1. 用XML数据进行工作 18.1.1. 指定同时映射XML和类 18.1.2. 只定义XML映射 18.2. XML映射元数据 18.3. 操作XML数据 19. 提升性能 19.1. 抓取策略(Fetching strategies) 19.1.1. 调整抓取策略(Tuning fetch strategies) 19.1.2. 单端关联代理(Single-ended association proxies) 19.1.3. 实例化集合和代理(Initializing collections and proxies) 19.1.4. 使用批量抓取(Using batch fetching) 19.1.5. 使用子查询抓取(Using subselect fetching) 19.1.6. 使用延迟属性抓取(Using lazy property fetching) 19.2. 二级缓存(The Second Level Cache) 19.2.1. 缓存映射(Cache mappings) 19.2.2. 策略:只读缓存(Strategy: read only) 19.2.3. 策略:读/写缓存(Strategy: read/write) 19.2.4. 策略:非严格读/写缓存(Strategy: nonstrict read/write) 19.2.5. 策略:事务缓存(transactional) 19.3. 管理缓存(Managing the caches) 19.4. 查询缓存(The Query Cache) 19.5. 理解集合性能(Understanding Collection performance) 19.5.1. 分类(Taxonomy) 19.5.2. Lists, maps 和sets用于更新效率最高 19.5.3. Bag和list是反向集合类中效率最高的 19.5.4. 一次性删除(One shot delete) 19.6. 监测性能(Monitoring performance) 19.6.1. 监测SessionFactory 19.6.2. 数据记录(Metrics) 20. 工具箱指南 20.1. Schema自动生成(Automatic schema generation) 20.1.1. 对schema定制化(Customizing the schema) 20.1.2. 运行该工具 20.1.3. 属性(Properties) 20.1.4. 使用Ant(Using Ant) 20.1.5. 对schema的增量更新(Incremental schema updates) 20.1.6. 用Ant来增量更新schema(Using Ant for incremental schema updates) 21. 示例:父子关系(Parent Child Relationships) 21.1. 关于collections 21.2. 双向的一对多关系(Bidirectional one-to-many) 21.3. 级联生命周期(Cascading lifecycle) 21.4. 级联与未保存值(Cascades and unsaved-value) 21.5. 结论 22. 示例:Weblog 应用程序 22.1. 持久化类 22.2. Hibernate 映射 22.3. Hibernate 代码 23. 示例:复杂映射实例 23.1. Employer(雇主)/Employee(雇员) 23.2. Author(作家)/Work(作品) 23.3. Customer(客户)/Order(订单)/Product(产品) 23.4. 杂例 23.4.1. "Typed" one-to-one association 23.4.2. Composite key example 23.4.3. Content based discrimination 23.4.4. Associations on alternate keys 24. 最佳实践(Best Practices)
目录 前言 1. 翻译说明 2. 版权声明 1. 在Tomcat中快速上手 1.1. 开始Hibernate之旅 1.2. 第一个持久化类 1.3. 映射cat 1.4. 与Cat同乐 1.5. 结语 2. Hibernate入门 2.1. 前言 2.2. 第一部分 - 第一个Hibernate程序 2.2.1. 第一个class 2.2.2. 映射文件 2.2.3. Hibernate配置 2.2.4. 用Ant编译 2.2.5. 安装和帮助 2.2.6. 加载并存储对象 2.3. 第二部分 - 关联映射 2.3.1. 映射Person类 2.3.2. 一个单向的Set-based关联 2.3.3. 使关联工作 2.3.4. 值类型的集合 2.3.5. 双向关联 2.3.6. 使双向关联工作 2.4. 总结 3. 体系结构(Architecture) 3.1. 概况(Overview) 3.2. 实例状态 3.3. JMX整合 3.4. 对JCA的支持 4. 配置 4.1. 可编程的配置方式 4.2. 获得SessionFactory 4.3. JDBC连接 4.4. 可选的配置属性 4.4.1. SQL方言 4.4.2. 外连接抓取(Outer Join Fetching) 4.4.3. 二进制流 (Binary Streams) 4.4.4. 二级缓存与查询缓存 4.4.5. 查询语言中的替换 4.4.6. Hibernate的统计(statistics)机制 4.5. 日志 4.6. 实现NamingStrategy 4.7. XML配置文件 4.8. J2EE应用程序服务器的集成 4.8.1. 事务策略配置 4.8.2. JNDI绑定的SessionFactory 4.8.3. JTA和Session的自动绑定 4.8.4. JMX部署 5. 持久化类(Persistent Classes) 5.1. 一个简单的POJO例子 5.1.1. 为持久化字段声明访问器(accessors)和是否可变的标志(mutators) 5.1.2. 实现一个默认的(即无参数的)构造方法(constructor) 5.1.3. 提供一个标识属性(identifier property)(可选) 5.1.4. 使用非final的类 (可选) 5.2. 实现继承(Inheritance) 5.3. 实现equals()和hashCode() 5.4. 动态模型(Dynamic models) 6. 对象/关系数据库映射基础(Basic O/R Mapping) 6.1. 映射定义(Mapping declaration) 6.1.1. Doctype 6.1.2. hibernate-mapping 6.1.3. class 6.1.4. id 6.1.4.1. Generator 6.1.4.2. 高/低位算法(Hi/Lo Algorithm) 6.1.4.3. UUID算法(UUID Algorithm ) 6.1.4.4. 标识字段和序列(Identity columns and Sequences) 6.1.4.5. 程序分配的标识符(Assigned Identifiers) 6.1.4.6. 触发器实现的主键生成器(Primary keys assigned by triggers) 6.1.5. composite-id 6.1.6. 鉴别器(discriminator) 6.1.7. 版本(version)(可选) 6.1.8. timestamp (optional) 6.1.9. property 6.1.10. 多对一(many-to-one) 6.1.11. 一对一 6.1.12. 组件(component), 动态组件(dynamic-component) 6.1.13. properties 6.1.14. 子类(subclass) 6.1.15. 连接的子类(joined-subclass) 6.1.16. 联合子类(union-subclass) 6.1.17. 连接(join) 6.1.18. 键(key) 6.1.19. 字段和规则元素(column and formula elements) 6.1.20. 引用(import) 6.1.21. any 6.2. Hibernate 的类型 6.2.1. 实体(Entities)和值(values) 6.2.2. 基本值类型 6.2.3. 自定义值类型 6.3. SQL中引号包围的标识符 6.4. 其他元数据(Metadata) 6.4.1. 使用 XDoclet 标记 6.4.2. 使用 JDK 5.0 的注解(Annotation) 7. 集合类(Collections)映射 7.1. 持久化集合类(Persistent collections) 7.2. 集合映射( Collection mappings ) 7.2.1. 集合外键(Collection foreign keys) 7.2.2. 集合元素(Collection elements) 7.2.3. 索引集合类(Indexed collections) 7.2.4. 值集合于多对多关联(Collections of values and many-to-many associations) 7.2.5. 一对多关联(One-to-many Associations) 7.3. 高级集合映射(Advanced collection mappings) 7.3.1. 有序集合(Sorted collections) 7.3.2. 双向关联(Bidirectional associations) 7.3.3. 三重关联(Ternary associations) 7.3.4. 使用 7.4. 集合例子(Collection example) 8. 关联关系映射 8.1. 介绍 8.2. 单向关联(Unidirectional associations) 8.2.1. 多对一(many to one) 8.2.2. 一对一(one to one) 8.2.3. 一对多(one to many) 8.3. 使用连接表的单向关联(Unidirectional associations with join tables) 8.3.1. 一对多(one to many) 8.3.2. 多对一(many to one) 8.3.3. 一对一(one to one) 8.3.4. 多对多(many to many) 8.4. 双向关联(Bidirectional associations) 8.4.1. 一对多(one to many) / 多对一(many to one) 8.4.2. 一对一(one to one) 8.5. 使用连接表的双向关联(Bidirectional associations with join tables) 8.5.1. 一对多(one to many) /多对一( many to one) 8.5.2. 一对一(one to one) 8.5.3. 多对多(many to many) 9. 组件(Component)映射 9.1. 依赖对象(Dependent objects) 9.2. 在集合中出现的依赖对象 9.3. 组件作为Map的索引(Components as Map indices ) 9.4. 组件作为联合标识符(Components as composite identifiers) 9.5. 动态组件 (Dynamic components) 10. 继承映射(Inheritance Mappings) 10.1. 三种策略 10.1.1. 每个类分层结构一张表(Table per class hierarchy) 10.1.2. 每个子类一张表(Table per subclass) 10.1.3. 每个子类一张表(Table per subclass),使用辨别标志(Discriminator) 10.1.4. 混合使用“每个类分层结构一张表”和“每个子类一张表” 10.1.5. 每个具体类一张表(Table per concrete class) 10.1.6. Table per concrete class, using implicit polymorphism 10.1.7. 隐式多态和其他继承映射混合使用 10.2. 限制 11. 与对象共事 11.1. Hibernate对象状态(object states) 11.2. 使对象持久化 11.3. 装载对象 11.4. 查询 11.4.1. 执行查询 11.4.1.1. 迭代式获取结果(Iterating results) 11.4.1.2. 返回元组(tuples)的查询 11.4.1.3. 标量(Scalar)结果 11.4.1.4. 绑定参数 11.4.1.5. 分页 11.4.1.6. 可滚动遍历(Scrollable iteration) 11.4.1.7. 外置命名查询(Externalizing named queries) 11.4.2. 过滤集合 11.4.3. 条件查询(Criteria queries) 11.4.4. 使用原生SQL的查询 11.5. 修改持久对象 11.6. 修改脱管(Detached)对象 11.7. 自动状态检测 11.8. 删除持久对象 11.9. 在两个不同数据库间复制对象 11.10. Session刷出(flush) 11.11. 传播性持久化(transitive persistence) 11.12. 使用元数据 12. 事务和并发 12.1. Session和事务范围(transaction scopes) 12.1.1. 操作单元(Unit of work) 12.1.2. 应用程序事务(Application transactions) 12.1.3. 关注对象标识(Considering object identity) 12.1.4. 常见问题 12.2. 数据库事务声明 12.2.1. 非托管环境 12.2.2. 使用JTA 12.2.3. 异常处理 12.3. 乐观并发控制(Optimistic concurrency control) 12.3.1. 应用程序级别的版本检查(Application version checking) 12.3.2. 长生命周期session和自动版本化 12.3.3. 脱管对象(deatched object)和自动版本化 12.3.4. 定制自动版本化行为 12.4. 悲观锁定(Pessimistic Locking) 13. 拦截器与事件(Interceptors and events) 13.1. 拦截器(Interceptors) 13.2. 事件系统(Event system) 13.3. Hibernate的声明式安全机制 14. 批量处理(Batch processing) 14.1. 批量插入(Batch inserts) 14.2. 批量更新(Batch updates) 14.3. 大批量更新/删除(Bulk update/delete) 15. HQL: Hibernate查询语言 15.1. 大小写敏感性问题 15.2. from子句 15.3. 关联(Association)与连接(Join) 15.4. select子句 15.5. 聚集函数 15.6. 多态查询 15.7. where子句 15.8. 表达式 15.9. order by子句 15.10. group by子句 15.11. 子查询 15.12. HQL示例 15.13. 批量的UPDATE & DELETE语句 15.14. 小技巧 & 小窍门 16. 条件查询(Criteria Queries) 16.1. 创建一个Criteria 实例 16.2. 限制结果集内容 16.3. 结果集排序 16.4. 关联 16.5. 动态关联抓取 16.6. 查询示例 16.7. 投影(Projections)、聚合(aggregation)和分组(grouping) 16.8. 离线(detached)查询和子查询 17. Native SQL查询 17.1. 创建一个基于SQL的Query 17.2. 别名和属性引用 17.3. 命名SQL查询 17.3.1. 使用return-property来明确地指定字段/别名 17.3.2. 使用存储过程来查询 17.3.2.1. 使用存储过程的规则和限制 17.4. 定制SQL用来create,update和delete 17.5. 定制装载SQL 18. 过滤数据 18.1. Hibernate 过滤器(filters) 19. XML映射 19.1. 用XML数据进行工作 19.1.1. 指定同时映射XML和类 19.1.2. 只定义XML映射 19.2. XML映射元数据 19.3. 操作XML数据 20. 提升性能 20.1. 抓取策略(Fetching strategies) 20.1.1. 操作延迟加载的关联 20.1.2. 调整抓取策略(Tuning fetch strategies) 20.1.3. 单端关联代理(Single-ended association proxies) 20.1.4. 实例化集合和代理(Initializing collections and proxies) 20.1.5. 使用批量抓取(Using batch fetching) 20.1.6. 使用子查询抓取(Using subselect fetching) 20.1.7. 使用延迟属性抓取(Using lazy property fetching) 20.2. 二级缓存(The Second Level Cache) 20.2.1. 缓存映射(Cache mappings) 20.2.2. 策略:只读缓存(Strategy: read only) 20.2.3. 策略:读/写缓存(Strategy: read/write) 20.2.4. 策略:非严格读/写缓存(Strategy: nonstrict read/write) 20.2.5. 策略:事务缓存(transactional) 20.3. 管理缓存(Managing the caches) 20.4. 查询缓存(The Query Cache) 20.5. 理解集合性能(Understanding Collection performance) 20.5.1. 分类(Taxonomy) 20.5.2. Lists, maps 和sets用于更新效率最高 20.5.3. Bag和list是反向集合类中效率最高的 20.5.4. 一次性删除(One shot delete) 20.6. 监测性能(Monitoring performance) 20.6.1. 监测SessionFactory 20.6.2. 数据记录(Metrics) 21. 工具箱指南 21.1. Schema自动生成(Automatic schema generation) 21.1.1. 对schema定制化(Customizing the schema) 21.1.2. 运行该工具 21.1.3. 属性(Properties) 21.1.4. 使用Ant(Using Ant) 21.1.5. 对schema的增量更新(Incremental schema updates) 21.1.6. 用Ant来增量更新schema(Using Ant for incremental schema updates) 22. 示例:父子关系(Parent Child Relationships) 22.1. 关于collections需要注意的一点 22.2. 双向的一对多关系(Bidirectional one-to-many) 22.3. 级联生命周期(Cascading lifecycle) 22.4. 级联与未保存值(Cascades and unsaved-value) 22.5. 结论 23. 示例:Weblog 应用程序 23.1. 持久化类 23.2. Hibernate 映射 23.3. Hibernate 代码 24. 示例:复杂映射实例 24.1. Employer(雇主)/Employee(雇员) 24.2. Author(作家)/Work(作品) 24.3. Customer(客户)/Order(订单)/Product(产品) 24.4. 杂例 24.4.1. "Typed" one-to-one association 24.4.2. Composite key example 24.4.3. Content based discrimination 24.4.4. Associations on alternate keys 25. 最佳实践(Best Practices)
符合Java习惯的关系数据库持久化 目录 前言 1. 翻译说明 2. 版权声明 1. 在Tomcat中快速上手 1.1. 开始Hibernate之旅 1.2. 第一个持久化类 1.3. 映射cat 1.4. 与Cat同乐 1.5. 结语 2. Hibernate入门 2.1. 前言 2.2. 第一部分 - 第一个Hibernate程序 2.2.1. 第一个class 2.2.2. 映射文件 2.2.3. Hibernate配置 2.2.4. 用Ant编译 2.2.5. 安装和帮助 2.2.6. 加载并存储对象 2.3. 第二部分 - 关联映射 2.3.1. 映射Person类 2.3.2. 一个单向的Set-based关联 2.3.3. 使关联工作 2.3.4. 值类型的集合 2.3.5. 双向关联 2.3.6. 使双向关联工作 2.4. 总结 3. 体系结构(Architecture) 3.1. 概况(Overview) 3.2. 实例状态 3.3. JMX整合 3.4. 对JCA的支持 4. 配置 4.1. 可编程的配置方式 4.2. 获得SessionFactory 4.3. JDBC连接 4.4. 可选的配置属性 4.4.1. SQL方言 4.4.2. 外连接抓取(Outer Join Fetching) 4.4.3. 二进制流 (Binary Streams) 4.4.4. 二级缓存与查询缓存 4.4.5. 查询语言中的替换 4.4.6. Hibernate的统计(statistics)机制 4.5. 日志 4.6. 实现NamingStrategy 4.7. XML配置文件 4.8. J2EE应用程序服务器的集成 4.8.1. 事务策略配置 4.8.2. JNDI绑定的SessionFactory 4.8.3. JTA和Session的自动绑定 4.8.4. JMX部署 5. 持久化类(Persistent Classes) 5.1. 一个简单的POJO例子 5.1.1. 为持久化字段声明访问器(accessors)和是否可变的标志(mutators) 5.1.2. 实现一个默认的(即无参数的)构造方法(constructor) 5.1.3. 提供一个标识属性(identifier property)(可选) 5.1.4. 使用非final的类 (可选) 5.2. 实现继承(Inheritance) 5.3. 实现equals()和hashCode() 5.4. 动态模型(Dynamic models) 6. 对象/关系数据库映射基础(Basic O/R Mapping) 6.1. 映射定义(Mapping declaration) 6.1.1. Doctype 6.1.2. hibernate-mapping 6.1.3. class 6.1.4. id 6.1.4.1. Generator 6.1.4.2. 高/低位算法(Hi/Lo Algorithm) 6.1.4.3. UUID算法(UUID Algorithm ) 6.1.4.4. 标识字段和序列(Identity columns and Sequences) 6.1.4.5. 程序分配的标识符(Assigned Identifiers) 6.1.4.6. 触发器实现的主键生成器(Primary keys assigned by triggers) 6.1.5. composite-id 6.1.6. 鉴别器(discriminator) 6.1.7. 版本(version)(可选) 6.1.8. timestamp (optional) 6.1.9. property 6.1.10. 多对一(many-to-one) 6.1.11. 一对一 6.1.12. 组件(component), 动态组件(dynamic-component) 6.1.13. properties 6.1.14. 子类(subclass) 6.1.15. 连接的子类(joined-subclass) 6.1.16. 联合子类(union-subclass) 6.1.17. 连接(join) 6.1.18. 键(key) 6.1.19. 字段和规则元素(column and formula elements) 6.1.20. 引用(import) 6.1.21. any 6.2. Hibernate 的类型 6.2.1. 实体(Entities)和值(values) 6.2.2. 基本值类型 6.2.3. 自定义值类型 6.3. SQL中引号包围的标识符 6.4. 其他元数据(Metadata) 6.4.1. 使用 XDoclet 标记 6.4.2. 使用 JDK 5.0 的注解(Annotation) 7. 集合类(Collections)映射 7.1. 持久化集合类(Persistent collections) 7.2. 集合映射( Collection mappings ) 7.2.1. 集合外键(Collection foreign keys) 7.2.2. 集合元素(Collection elements) 7.2.3. 索引集合类(Indexed collections) 7.2.4. 值集合于多对多关联(Collections of values and many-to-many associations) 7.2.5. 一对多关联(One-to-many Associations) 7.3. 高级集合映射(Advanced collection mappings) 7.3.1. 有序集合(Sorted collections) 7.3.2. 双向关联(Bidirectional associations) 7.3.3. 三重关联(Ternary associations) 7.3.4. 使用 7.4. 集合例子(Collection example) 8. 关联关系映射 8.1. 介绍 8.2. 单向关联(Unidirectional associations) 8.2.1. 多对一(many to one) 8.2.2. 一对一(one to one) 8.2.3. 一对多(one to many) 8.3. 使用连接表的单向关联(Unidirectional associations with join tables) 8.3.1. 一对多(one to many) 8.3.2. 多对一(many to one) 8.3.3. 一对一(one to one) 8.3.4. 多对多(many to many) 8.4. 双向关联(Bidirectional associations) 8.4.1. 一对多(one to many) / 多对一(many to one) 8.4.2. 一对一(one to one) 8.5. 使用连接表的双向关联(Bidirectional associations with join tables) 8.5.1. 一对多(one to many) /多对一( many to one) 8.5.2. 一对一(one to one) 8.5.3. 多对多(many to many) 9. 组件(Component)映射 9.1. 依赖对象(Dependent objects) 9.2. 在集合中出现的依赖对象 9.3. 组件作为Map的索引(Components as Map indices ) 9.4. 组件作为联合标识符(Components as composite identifiers) 9.5. 动态组件 (Dynamic components) 10. 继承映射(Inheritance Mappings) 10.1. 三种策略 10.1.1. 每个类分层结构一张表(Table per class hierarchy) 10.1.2. 每个子类一张表(Table per subclass) 10.1.3. 每个子类一张表(Table per subclass),使用辨别标志(Discriminator) 10.1.4. 混合使用“每个类分层结构一张表”和“每个子类一张表” 10.1.5. 每个具体类一张表(Table per concrete class) 10.1.6. Table per concrete class, using implicit polymorphism 10.1.7. 隐式多态和其他继承映射混合使用 10.2. 限制 11. 与对象共事 11.1. Hibernate对象状态(object states) 11.2. 使对象持久化 11.3. 装载对象 11.4. 查询 11.4.1. 执行查询 11.4.1.1. 迭代式获取结果(Iterating results) 11.4.1.2. 返回元组(tuples)的查询 11.4.1.3. 标量(Scalar)结果 11.4.1.4. 绑定参数 11.4.1.5. 分页 11.4.1.6. 可滚动遍历(Scrollable iteration) 11.4.1.7. 外置命名查询(Externalizing named queries) 11.4.2. 过滤集合 11.4.3. 条件查询(Criteria queries) 11.4.4. 使用原生SQL的查询 11.5. 修改持久对象 11.6. 修改脱管(Detached)对象 11.7. 自动状态检测 11.8. 删除持久对象 11.9. 在两个不同数据库间复制对象 11.10. Session刷出(flush) 11.11. 传播性持久化(transitive persistence) 11.12. 使用元数据 12. 事务和并发 12.1. Session和事务范围(transaction scopes) 12.1.1. 操作单元(Unit of work) 12.1.2. 应用程序事务(Application transactions) 12.1.3. 关注对象标识(Considering object identity) 12.1.4. 常见问题 12.2. 数据库事务声明 12.2.1. 非托管环境 12.2.2. 使用JTA 12.2.3. 异常处理 12.3. 乐观并发控制(Optimistic concurrency control) 12.3.1. 应用程序级别的版本检查(Application version checking) 12.3.2. 长生命周期session和自动版本化 12.3.3. 脱管对象(deatched object)和自动版本化 12.3.4. 定制自动版本化行为 12.4. 悲观锁定(Pessimistic Locking) 13. 拦截器与事件(Interceptors and events) 13.1. 拦截器(Interceptors) 13.2. 事件系统(Event system) 13.3. Hibernate的声明式安全机制 14. 批量处理(Batch processing) 14.1. 批量插入(Batch inserts) 14.2. 批量更新(Batch updates) 14.3. 大批量更新/删除(Bulk update/delete) 15. HQL: Hibernate查询语言 15.1. 大小写敏感性问题 15.2. from子句 15.3. 关联(Association)与连接(Join) 15.4. select子句 15.5. 聚集函数 15.6. 多态查询 15.7. where子句 15.8. 表达式 15.9. order by子句 15.10. group by子句 15.11. 子查询 15.12. HQL示例 15.13. 批量的UPDATE & DELETE语句 15.14. 小技巧 & 小窍门 16. 条件查询(Criteria Queries) 16.1. 创建一个Criteria 实例 16.2. 限制结果集内容 16.3. 结果集排序 16.4. 关联 16.5. 动态关联抓取 16.6. 查询示例 16.7. 投影(Projections)、聚合(aggregation)和分组(grouping) 16.8. 离线(detached)查询和子查询 17. Native SQL查询 17.1. 创建一个基于SQL的Query 17.2. 别名和属性引用 17.3. 命名SQL查询 17.3.1. 使用return-property来明确地指定字段/别名 17.3.2. 使用存储过程来查询 17.3.2.1. 使用存储过程的规则和限制 17.4. 定制SQL用来create,update和delete 17.5. 定制装载SQL 18. 过滤数据 18.1. Hibernate 过滤器(filters) 19. XML映射 19.1. 用XML数据进行工作 19.1.1. 指定同时映射XML和类 19.1.2. 只定义XML映射 19.2. XML映射元数据 19.3. 操作XML数据 20. 提升性能 20.1. 抓取策略(Fetching strategies) 20.1.1. 操作延迟加载的关联 20.1.2. 调整抓取策略(Tuning fetch strategies) 20.1.3. 单端关联代理(Single-ended association proxies) 20.1.4. 实例化集合和代理(Initializing collections and proxies) 20.1.5. 使用批量抓取(Using batch fetching) 20.1.6. 使用子查询抓取(Using subselect fetching) 20.1.7. 使用延迟属性抓取(Using lazy property fetching) 20.2. 二级缓存(The Second Level Cache) 20.2.1. 缓存映射(Cache mappings) 20.2.2. 策略:只读缓存(Strategy: read only) 20.2.3. 策略:读/写缓存(Strategy: read/write) 20.2.4. 策略:非严格读/写缓存(Strategy: nonstrict read/write) 20.2.5. 策略:事务缓存(transactional) 20.3. 管理缓存(Managing the caches) 20.4. 查询缓存(The Query Cache) 20.5. 理解集合性能(Understanding Collection performance) 20.5.1. 分类(Taxonomy) 20.5.2. Lists, maps 和sets用于更新效率最高 20.5.3. Bag和list是反向集合类中效率最高的 20.5.4. 一次性删除(One shot delete) 20.6. 监测性能(Monitoring performance) 20.6.1. 监测SessionFactory 20.6.2. 数据记录(Metrics) 21. 工具箱指南 21.1. Schema自动生成(Automatic schema generation) 21.1.1. 对schema定制化(Customizing the schema) 21.1.2. 运行该工具 21.1.3. 属性(Properties) 21.1.4. 使用Ant(Using Ant) 21.1.5. 对schema的增量更新(Incremental schema updates) 21.1.6. 用Ant来增量更新schema(Using Ant for incremental schema updates) 22. 示例:父子关系(Parent Child Relationships) 22.1. 关于collections需要注意的一点 22.2. 双向的一对多关系(Bidirectional one-to-many) 22.3. 级联生命周期(Cascading lifecycle) 22.4. 级联与未保存值(Cascades and unsaved-value) 22.5. 结论 23. 示例:Weblog 应用程序 23.1. 持久化类 23.2. Hibernate 映射 23.3. Hibernate 代码 24. 示例:复杂映射实例 24.1. Employer(雇主)/Employee(雇员) 24.2. Author(作家)/Work(作品) 24.3. Customer(客户)/Order(订单)/Product(产品) 24.4. 杂例 24.4.1. \"Typed\" one-to-one association 24.4.2. Composite key example 24.4.3. Content based discrimination 24.4.4. Associations on alternate keys 25. 最佳实践(Best Practices)
Hibernate参考文档 目录 前言 1. 翻译说明 2. 版权声明 1. 在Tomcat中快速上手 1.1. 开始Hibernate之旅 1.2. 第一个持久化类 1.3. 映射cat 1.4. 与Cat同乐 1.5. 结语 2. Hibernate入门 2.1. 前言 2.2. 第一部分 - 第一个Hibernate程序 2.2.1. 第一个class 2.2.2. 映射文件 2.2.3. Hibernate配置 2.2.4. 用Ant编译 2.2.5. 安装和帮助 2.2.6. 加载并存储对象 2.3. 第二部分 - 关联映射 2.3.1. 映射Person类 2.3.2. 一个单向的Set-based关联 2.3.3. 使关联工作 2.3.4. 值类型的集合 2.3.5. 双向关联 2.3.6. 使双向关联工作 2.4. 总结 3. 体系结构(Architecture) 3.1. 概况(Overview) 3.2. 实例状态 3.3. JMX整合 3.4. 对JCA的支持 4. 配置 4.1. 可编程的配置方式 4.2. 获得SessionFactory 4.3. JDBC连接 4.4. 可选的配置属性 4.4.1. SQL方言 4.4.2. 外连接抓取(Outer Join Fetching) 4.4.3. 二进制流 (Binary Streams) 4.4.4. 二级缓存与查询缓存 4.4.5. 查询语言中的替换 4.4.6. Hibernate的统计(statistics)机制 4.5. 日志 4.6. 实现NamingStrategy 4.7. XML配置文件 4.8. J2EE应用程序服务器的集成 4.8.1. 事务策略配置 4.8.2. JNDI绑定的SessionFactory 4.8.3. JTA和Session的自动绑定 4.8.4. JMX部署 5. 持久化类(Persistent Classes) 5.1. 一个简单的POJO例子 5.1.1. 为持久化字段声明访问器(accessors)和是否可变的标志(mutators) 5.1.2. 实现一个默认的(即无参数的)构造方法(constructor) 5.1.3. 提供一个标识属性(identifier property)(可选) 5.1.4. 使用非final的类 (可选) 5.2. 实现继承(Inheritance) 5.3. 实现equals()和hashCode() 5.4. 动态模型(Dynamic models) 6. 对象/关系数据库映射基础(Basic O/R Mapping) 6.1. 映射定义(Mapping declaration) 6.1.1. Doctype 6.1.2. hibernate-mapping 6.1.3. class 6.1.4. id 6.1.4.1. Generator 6.1.4.2. 高/低位算法(Hi/Lo Algorithm) 6.1.4.3. UUID算法(UUID Algorithm ) 6.1.4.4. 标识字段和序列(Identity columns and Sequences) 6.1.4.5. 程序分配的标识符(Assigned Identifiers) 6.1.4.6. 触发器实现的主键生成器(Primary keys assigned by triggers) 6.1.5. composite-id 6.1.6. 鉴别器(discriminator) 6.1.7. 版本(version)(可选) 6.1.8. timestamp (optional) 6.1.9. property 6.1.10. 多对一(many-to-one) 6.1.11. 一对一 6.1.12. 组件(component), 动态组件(dynamic-component) 6.1.13. properties 6.1.14. 子类(subclass) 6.1.15. 连接的子类(joined-subclass) 6.1.16. 联合子类(union-subclass) 6.1.17. 连接(join) 6.1.18. 键(key) 6.1.19. 字段和规则元素(column and formula elements) 6.1.20. 引用(import) 6.1.21. any 6.2. Hibernate 的类型 6.2.1. 实体(Entities)和值(values) 6.2.2. 基本值类型 6.2.3. 自定义值类型 6.3. SQL中引号包围的标识符 6.4. 其他元数据(Metadata) 6.4.1. 使用 XDoclet 标记 6.4.2. 使用 JDK 5.0 的注解(Annotation) 7. 集合类(Collections)映射 7.1. 持久化集合类(Persistent collections) 7.2. 集合映射( Collection mappings ) 7.2.1. 集合外键(Collection foreign keys) 7.2.2. 集合元素(Collection elements) 7.2.3. 索引集合类(Indexed collections) 7.2.4. 值集合于多对多关联(Collections of values and many-to-many associations) 7.2.5. 一对多关联(One-to-many Associations) 7.3. 高级集合映射(Advanced collection mappings) 7.3.1. 有序集合(Sorted collections) 7.3.2. 双向关联(Bidirectional associations) 7.3.3. 三重关联(Ternary associations) 7.3.4. 使用 7.4. 集合例子(Collection example) 8. 关联关系映射 8.1. 介绍 8.2. 单向关联(Unidirectional associations) 8.2.1. 多对一(many to one) 8.2.2. 一对一(one to one) 8.2.3. 一对多(one to many) 8.3. 使用连接表的单向关联(Unidirectional associations with join tables) 8.3.1. 一对多(one to many) 8.3.2. 多对一(many to one) 8.3.3. 一对一(one to one) 8.3.4. 多对多(many to many) 8.4. 双向关联(Bidirectional associations) 8.4.1. 一对多(one to many) / 多对一(many to one) 8.4.2. 一对一(one to one) 8.5. 使用连接表的双向关联(Bidirectional associations with join tables) 8.5.1. 一对多(one to many) /多对一( many to one) 8.5.2. 一对一(one to one) 8.5.3. 多对多(many to many) 9. 组件(Component)映射 9.1. 依赖对象(Dependent objects) 9.2. 在集合中出现的依赖对象 9.3. 组件作为Map的索引(Components as Map indices ) 9.4. 组件作为联合标识符(Components as composite identifiers) 9.5. 动态组件 (Dynamic components) 10. 继承映射(Inheritance Mappings) 10.1. 三种策略 10.1.1. 每个类分层结构一张表(Table per class hierarchy) 10.1.2. 每个子类一张表(Table per subclass) 10.1.3. 每个子类一张表(Table per subclass),使用辨别标志(Discriminator) 10.1.4. 混合使用“每个类分层结构一张表”和“每个子类一张表” 10.1.5. 每个具体类一张表(Table per concrete class) 10.1.6. Table per concrete class, using implicit polymorphism 10.1.7. 隐式多态和其他继承映射混合使用 10.2. 限制 11. 与对象共事 11.1. Hibernate对象状态(object states) 11.2. 使对象持久化 11.3. 装载对象 11.4. 查询 11.4.1. 执行查询 11.4.1.1. 迭代式获取结果(Iterating results) 11.4.1.2. 返回元组(tuples)的查询 11.4.1.3. 标量(Scalar)结果 11.4.1.4. 绑定参数 11.4.1.5. 分页 11.4.1.6. 可滚动遍历(Scrollable iteration) 11.4.1.7. 外置命名查询(Externalizing named queries) 11.4.2. 过滤集合 11.4.3. 条件查询(Criteria queries) 11.4.4. 使用原生SQL的查询 11.5. 修改持久对象 11.6. 修改脱管(Detached)对象 11.7. 自动状态检测 11.8. 删除持久对象 11.9. 在两个不同数据库间复制对象 11.10. Session刷出(flush) 11.11. 传播性持久化(transitive persistence) 11.12. 使用元数据 12. 事务和并发 12.1. Session和事务范围(transaction scopes) 12.1.1. 操作单元(Unit of work) 12.1.2. 应用程序事务(Application transactions) 12.1.3. 关注对象标识(Considering object identity) 12.1.4. 常见问题 12.2. 数据库事务声明 12.2.1. 非托管环境 12.2.2. 使用JTA 12.2.3. 异常处理 12.3. 乐观并发控制(Optimistic concurrency control) 12.3.1. 应用程序级别的版本检查(Application version checking) 12.3.2. 长生命周期session和自动版本化 12.3.3. 脱管对象(deatched object)和自动版本化 12.3.4. 定制自动版本化行为 12.4. 悲观锁定(Pessimistic Locking) 13. 拦截器与事件(Interceptors and events) 13.1. 拦截器(Interceptors) 13.2. 事件系统(Event system) 13.3. Hibernate的声明式安全机制 14. 批量处理(Batch processing) 14.1. 批量插入(Batch inserts) 14.2. 批量更新(Batch updates) 14.3. 大批量更新/删除(Bulk update/delete) 15. HQL: Hibernate查询语言 15.1. 大小写敏感性问题 15.2. from子句 15.3. 关联(Association)与连接(Join) 15.4. select子句 15.5. 聚集函数 15.6. 多态查询 15.7. where子句 15.8. 表达式 15.9. order by子句 15.10. group by子句 15.11. 子查询 15.12. HQL示例 15.13. 批量的UPDATE & DELETE语句 15.14. 小技巧 & 小窍门 16. 条件查询(Criteria Queries) 16.1. 创建一个Criteria 实例 16.2. 限制结果集内容 16.3. 结果集排序 16.4. 关联 16.5. 动态关联抓取 16.6. 查询示例 16.7. 投影(Projections)、聚合(aggregation)和分组(grouping) 16.8. 离线(detached)查询和子查询 17. Native SQL查询 17.1. 创建一个基于SQL的Query 17.2. 别名和属性引用 17.3. 命名SQL查询 17.3.1. 使用return-property来明确地指定字段/别名 17.3.2. 使用存储过程来查询 17.3.2.1. 使用存储过程的规则和限制 17.4. 定制SQL用来create,update和delete 17.5. 定制装载SQL 18. 过滤数据 18.1. Hibernate 过滤器(filters) 19. XML映射 19.1. 用XML数据进行工作 19.1.1. 指定同时映射XML和类 19.1.2. 只定义XML映射 19.2. XML映射元数据 19.3. 操作XML数据 20. 提升性能 20.1. 抓取策略(Fetching strategies) 20.1.1. 操作延迟加载的关联 20.1.2. 调整抓取策略(Tuning fetch strategies) 20.1.3. 单端关联代理(Single-ended association proxies) 20.1.4. 实例化集合和代理(Initializing collections and proxies) 20.1.5. 使用批量抓取(Using batch fetching) 20.1.6. 使用子查询抓取(Using subselect fetching) 20.1.7. 使用延迟属性抓取(Using lazy property fetching) 20.2. 二级缓存(The Second Level Cache) 20.2.1. 缓存映射(Cache mappings) 20.2.2. 策略:只读缓存(Strategy: read only) 20.2.3. 策略:读/写缓存(Strategy: read/write) 20.2.4. 策略:非严格读/写缓存(Strategy: nonstrict read/write) 20.2.5. 策略:事务缓存(transactional) 20.3. 管理缓存(Managing the caches) 20.4. 查询缓存(The Query Cache) 20.5. 理解集合性能(Understanding Collection performance) 20.5.1. 分类(Taxonomy) 20.5.2. Lists, maps 和sets用于更新效率最高 20.5.3. Bag和list是反向集合类中效率最高的 20.5.4. 一次性删除(One shot delete) 20.6. 监测性能(Monitoring performance) 20.6.1. 监测SessionFactory 20.6.2. 数据记录(Metrics) 21. 工具箱指南 21.1. Schema自动生成(Automatic schema generation) 21.1.1. 对schema定制化(Customizing the schema) 21.1.2. 运行该工具 21.1.3. 属性(Properties) 21.1.4. 使用Ant(Using Ant) 21.1.5. 对schema的增量更新(Incremental schema updates) 21.1.6. 用Ant来增量更新schema(Using Ant for incremental schema updates) 22. 示例:父子关系(Parent Child Relationships) 22.1. 关于collections需要注意的一点 22.2. 双向的一对多关系(Bidirectional one-to-many) 22.3. 级联生命周期(Cascading lifecycle) 22.4. 级联与未保存值(Cascades and unsaved-value) 22.5. 结论 23. 示例:Weblog 应用程序 23.1. 持久化类 23.2. Hibernate 映射 23.3. Hibernate 代码 24. 示例:复杂映射实例 24.1. Employer(雇主)/Employee(雇员) 24.2. Author(作家)/Work(作品) 24.3. Customer(客户)/Order(订单)/Product(产品) 24.4. 杂例 24.4.1. "Typed" one-to-one association 24.4.2. Composite key example 24.4.3. Content based discrimination 24.4.4. Associations on alternate keys 25. 最佳实践(Best Practices)

604

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder 控件与界面
社区管理员
  • 控件与界面社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧