Hibernate Annotations

Reference Guide


Table of Contents

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 Defining the table Versioning for optimistic locking
2.2.2. Mapping simple properties Declaring basic property mappings Declaring column attributes Embedded objects (aka components) Non-annotated property defaults
2.2.. Mapping identifier properties
2.2.4. Mapping inheritance Table per class Single table per class hierarchy Joined subclasses Inherit properties from superclasses
2.2.5. Mapping entity bean associations/relationships One-to-one Many-to-one Collections Transitive persistence with cascading 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 Access type Formula Type Index @Parent Generated properties @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 Enhance collection settings 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 StringBridge FieldBridge
5.5. Querying
5.6. Indexing