Hibernate Annotations

Reference Guide

3.2.1.GA


Table of Contents

Preface
1. Setting up an annotations project
1.1. Requirements
1.2. Configuration
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.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.4. Inheritance
2.4.5. Single Association related annotations
2.4.5.Lazy options and fetching modes. Lazy options and fetching modes
2.4.6. Collection related annotations
2.4.6.1. Enhance collection settings
2.4.6.2. Extra collection types
2.4.7. Cache
2.4.8. Filters
2.4.9. Queries
2.4.10. Custom SQL for CRUD operations
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. Hibernate Validator
4.1. Constraints
4.1.1. What is a constraint?
4.1.2. Built in constraints
4.1.3. Error messages
4.1.4. Writing your own constraints
4.1.5. Annotating your domain model
4.2. Using the Validator framework
4.2.1. Database schema-level validation
4.2.2. Hibernate event-based validation
4.2.3. Application-level validation
4.2.4. Validation informations
5. Hibernate Search: Apache Lucene Integration
5.1. Architecture
5.2. Configuration
5.2.1. Directory configuration
5.2.2. Enabling automatic indexing
5.3. Mapping entities to the index structure
5.4. Property/Field Bridge
5.4.1. Built-in bridges
5.4.2. Custom Bridge
5.4.2.1. StringBridge
5.4.2.2. FieldBridge
5.5. Querying
5.6. Indexing