Hibernate Annotations

Reference Guide

3.4.0.GA


Table of Contents

Preface
1. Setting up an annotations project
1.1. Requirements
1.2. Configuration
1.3. Properties
1.4. Logging
2. Entity Beans
2.1. Intro
2.2. Mapping with EJB3/JPA Annotations
2.2.1. Declaring an entity bean
2.2.1.1. Defining the table
2.2.1.2. Versioning for optimistic locking
2.2.2. Mapping simple properties
2.2.2.1. Declaring basic property mappings
2.2.2.2. Declaring column attributes
2.2.2.3. Embedded objects (aka components)
2.2.2.4. Non-annotated property defaults
2.2.. Mapping identifier properties
2.2.4. Mapping inheritance
2.2.4.1. Table per class
2.2.4.2. Single table per class hierarchy
2.2.4.3. Joined subclasses
2.2.4.4. Inherit properties from superclasses
2.2.5. Mapping entity bean associations/relationships
2.2.5.1. One-to-one
2.2.5.2. Many-to-one
2.2.5.3. Collections
2.2.5.4. Transitive persistence with cascading
2.2.5.5. Association fetching
2.2.6. Mapping composite primary and foreign keys
2.2.7. Mapping secondary tables
2.3. Mapping Queries
2.3.Mapping JPAQL/HQL queries. Mapping JPAQL/HQL queries
2.3.2. Mapping native queries
2.4. Hibernate Annotation Extensions
2.4.1. Entity
2.4.Identifier. Identifier
2.4.Identifier.1. Generators
2.4.Identifier.2. @NaturalId
2.4.3. Property
2.4.3.1. Access type
2.4.3.2. Formula
2.4.3.3. Type
2.4.3.4. Index
2.4.3.5. @Parent
2.4.3.6. Generated properties
2.4.3.7. @Target
2.4.3.8. Optimistic lock
2.4.4. Inheritance
2.4.5. Single Association related annotations
2.4.5.1. Lazy options and fetching modes
2.4.5.2. @Any
2.4.6. Collection related annotations
2.4.6.1. Enhance collection settings
2.4.6.2. Extra collection types
2.4.7. Cascade
2.4.8. Cache
2.4.9. Filters
2.4.10. Queries
2.4.11. Custom SQL for CRUD operations
2.4.12. Tuplizer
Overriding metadata through XML. Overriding metadata through XML
Overriding metadata through XML.1. Principles
Overriding metadata through XML.1.1. Global level metadata
Overriding metadata through XML.1.2. Entity level metadata
Overriding metadata through XML.1.3. Property level metadata
Overriding metadata through XML.1.4. Association level metadata
4. Additional modules
4.1. Hibernate Validator
4.1.1. Description
4.1.2. Integration with Hibernate Annotations
4.2. Hibernate Search
4.2.1. Description
4.2.2. Integration with Hibernate Annotations