JBoss Enterprise Web Platform 5

Hibernate Annotations Reference Guide

for Use with JBoss Enterprise Web Platform 5

Edition 5.1.1

Red Hat Documentation Group

Legal Notice

Copyright © 2011 Red Hat, Inc.
This document is licensed by Red Hat under the Creative Commons Attribution-ShareAlike 3.0 Unported License. If you distribute this document, or a modified version of it, you must provide attribution to Red Hat, Inc. and provide a link to the original. If the document is modified, all Red Hat trademarks must be removed.
Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law.
Red Hat, Red Hat Enterprise Linux, the Shadowman logo, JBoss, MetaMatrix, Fedora, the Infinity Logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries.
Linux® is the registered trademark of Linus Torvalds in the United States and other countries.
Java® is a registered trademark of Oracle and/or its affiliates.
XFS® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States and/or other countries.
MySQL® is a registered trademark of MySQL AB in the United States, the European Union and other countries.
Node.js® is an official trademark of Joyent. Red Hat Software Collections is not formally related to or endorsed by the official Joyent Node.js open source or commercial project.
The OpenStack® Word Mark and OpenStack Logo are either registered trademarks/service marks or trademarks/service marks of the OpenStack Foundation, in the United States and other countries and are used with the OpenStack Foundation's permission. We are not affiliated with, endorsed or sponsored by the OpenStack Foundation, or the OpenStack community.
All other trademarks are the property of their respective owners.
June, 2011

Abstract

The Hibernate Annotations Reference Guide for JBoss Enterprise Web Platform 5 and its patch releases.
Preface
1. Document Conventions
1.1. Typographic Conventions
1.2. Pull-quote Conventions
1.3. Notes and Warnings
2. Getting Help and Giving Feedback
2.1. Do You Need Help?
2.2. Give us Feedback
1. Introduction
2. Setting up an annotations project
2.1. Requirements
2.2. Configuration
2.3. Properties
2.4. Logging
3. Entity Beans
3.1. Intro
3.2. Mapping with EJB3/JPA Annotations
3.2.1. Declaring an entity bean
3.2.2. Mapping simple properties
3.2.3. Mapping identifier properties
3.2.4. Mapping inheritance
3.2.5. Mapping entity bean associations/relationships
3.2.6. Mapping composite primary and foreign keys
3.2.7. Mapping secondary tables
3.3. Mapping Queries
3.3.Mapping JPAQL/HQL queries. Mapping JPAQL/HQL queries
3.3.2. Mapping native queries
3.4. Hibernate Annotation Extensions
3.4.1. Entity
3.4.Identifier. Identifier
3.4.3. Property
3.4.4. Inheritance
3.4.5. Single Association related annotations
3.4.6. Collection related annotations
3.4.7. Cascade
3.4.8. Cache
3.4.9. Filters
3.4.10. Queries
3.4.11. Custom SQL for CRUD operations
3.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
5. Additional modules
5.1. Hibernate Validator
5.1.1. Description
5.1.2. Integration with Hibernate Annotations
5.2. Hibernate Search
5.2.1. Description
5.2.2. Integration with Hibernate Annotations
A. Revision History