Hibernate Annotations

Reference Guide

3.1 beta 8


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 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.1. Mapping EJBQL/HQL queries
2.3.2. Mapping native queries
2.4. Hibernate Annotation Extensions
2.4.1. Entity
2.4.2. 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.4. Inheritance
2.4.5. Association related annotations
2.4.6. Collection related annotations
2.4.6.1. Parameter annotations
2.4.6.2. Extra collection types
2.4.7. Cache
2.4.8. Filters
2.4.9. Queries
3. Hibernate Validator
3.1. Constraints
3.1.1. What is a constraint?
3.1.2. Built in constraints
3.1.3. Error messages
3.1.4. Writing your own constraints
3.1.5. Annotating your domain model
3.2. Using the Validator framework
3.2.1. Database schema-level validation
3.2.2. Hibernate event-based validation
3.2.3. Application-level validation
3.2.4. Validation informations
4. Hibernate Lucene Integration
4.1. Using Lucene to index your entities
4.1.1. Annotating your domain model
4.1.2. Enabling automatic indexing
A. Compliance and limitations