HIBERNATE - Relational Persistence for Idiomatic Java

Hibernate2 Reference Documentation

2.1


Table of Contents

Preface
1. Quickstart with Tomcat
1.1. Getting started with Hibernate
1.2. First persistent class
1.3. Mapping the cat
1.4. Playing with cats
1.5. Finally
2. Architecture
2.1. Overview
2.2. Persistent Object Identity
2.3. JMX Integration
2.4. JCA Support
3. SessionFactory Configuration
3.1. Programmatic Configuration
3.2. Obtaining a SessionFactory
3.3. User provided JDBC connection
3.4. Hibernate provided JDBC connection
3.5. Other properties
3.5.1. SQL Dialects
3.5.2. Outer Join Fetching
3.5.3. Binary Streams
3.5.4. SQL Logging to Console
3.5.5. Custom ConnectionProvider
3.5.6. Common connection properties
3.5.7. Custom CacheProvider
3.5.8. Transaction Strategy
3.5.9. JNDI-bound SessionFactory
3.5.10. Query Language Substitution
3.6. XML Configuration File
3.7. Logging
4. Persistent Classes
4.1. Simple Example
4.1.1. Declare accessors and mutators for persistent fields
4.1.2. Implement a default constructor
4.1.3. Provide an identifier property (optional)
4.1.4. Prefer non-final classes (optional)
4.2. Inheritance
4.3. Persistent Lifecycle Callbacks
4.4. Validatable
4.5. XDoclet Example
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 Algorithm
5.1.4.4. Identity Columns and Sequences
5.1.4.5. Assigned Identifiers
5.1.5. composite-id
5.1.6. discriminator
5.1.7. version (optional)
5.1.8. timestamp (optional)
5.1.9. property
5.1.10. many-to-one
5.1.11. one-to-one
5.1.12. component, dynamic-component
5.1.13. subclass
5.1.14. joined-subclass
5.1.15. map, set, list, bag
5.1.16. import
5.2. Hibernate Types
5.2.1. Entities and values
5.2.2. Basic value types
5.2.3. Persistent enum types
5.2.4. Custom value types
5.2.5. Any type mappings
5.3. SQL quoted identifiers
5.4. Customizing the DDL
5.5. Modular mapping files
6. Collections
6.1. Persistent Collections
6.2. Mapping a Collection
6.3. Collections of Values and Many To Many Associations
6.4. One To Many Associations
6.5. Lazy Initialization
6.6. Sorted Collections
6.7. Other Ways To Sort a Collection
6.8. Garbage Collection
6.9. Bidirectional Associations
6.10. Ternary Associations
6.11. Heterogeneous Associations
6.12. Collection Example
6.13. <idbag>
7. Components
7.1. As Dependent Objects
7.2. In Collections
7.3. As a Map Index
7.4. As Composite Identifiers
7.5. Dynamic components
8. Manipulating Persistent Data
8.1. Creating a persistent object
8.2. Loading an object
8.3. Querying
8.3.1. Scalar queries
8.3.2. The Query interface
8.3.3. Scrollable iteration
8.3.4. Filtering collections
8.3.5. Criteria queries
8.3.6. Queries in native SQL
8.4. Updating objects saved or loaded in the current session
8.5. Updating objects saved or loaded in a previous session
8.6. Reassociating objects saved or loaded in a previous session
8.7. Deleting persistent objects
8.8. Graphs of objects
8.8.1. Lifecycle objects
8.8.2. Persistence by Reachability
8.9. Flushing
8.10. Ending a Session
8.10.1. Flushing the session
8.10.2. Committing the transaction
8.10.3. Closing the session
8.10.4. Exception handling
8.11. Interceptors
8.12. Metadata API
9. Parent/Child Relationships
9.1. A note about collections
9.2. Bidirectional one to many
9.3. Cascades
9.4. Using cascading update()
9.5. Conclusion
10. Hibernate Query Language
10.1. Case Sensitivity
10.2. The from clause
10.3. Associations and joins
10.4. The select clause
10.5. Aggregate functions
10.6. polymorphism
10.7. The where clause
10.8. Expressions
10.9. The order by clause
10.10. The group by clause
10.11. Subqueries
10.12. Examples
10.13. Tips & Tricks
11. A Worked Example
11.1. Persistent Classes
11.2. Hibernate Mappings
11.3. Hibernate Code
12. Improving Performance
12.1. Proxies for Lazy Initialization
12.2. The Second Level Cache
12.2.1. Mapping
12.2.2. read only
12.2.3. read / write
12.2.4. nonstrict read / write
12.2.5. transactional
12.3. Managing the Session Cache
12.4. The Query Cache
13. Understanding Collection Performance
13.1. Taxonomy
13.2. Lists, maps and sets are the most efficient collections to update
13.3. Bags and lists are the most efficient inverse collections
13.4. One shot delete
14. Criteria Queries
14.1. Creating a Criteria instance
14.2. Narrowing the result set
14.3. Ordering the results
14.4. Associations
14.5. Dynamic association fetching
14.6. Example queries
15. SQL Queries
15.1. Creating a SQL based Query
15.2. Alias and property references
15.3. Named SQL queries
16. Inheritance Mappings
16.1. The Three Strategies
16.2. Limitations
17. Transactions And Concurrency
17.1. Configurations, Sessions and Factories
17.2. Threads and connections
17.3. Optimistic Locking / Versioning
17.3.1. Long session with automatic versioning
17.3.2. Many sessions with automatic versioning
17.3.3. Application version checking
17.4. Session disconnection
17.5. Pessimistic Locking
18. Mapping Examples
18.1. Employer/Employee
18.2. Author/Work
18.3. Customer/Order/Product
19. Toolset Guide
19.1. Schema Generation
19.1.1. Customizing the schema
19.1.2. Running the tool
19.1.3. Properties
19.1.4. Using Ant
19.1.5. Incremental schema updates
19.1.6. Using Ant for incremental schema updates
19.2. Code Generation
19.2.1. The config file (optional)
19.2.2. The meta attribute
19.2.3. Basic finder generator
19.2.4. Velocity based renderer/generator
19.3. Mapping File Generation
19.3.1. Running the tool
20. Best Practices