Author: stliu
Date: 2009-12-22 01:50:19 -0500 (Tue, 22 Dec 2009)
New Revision: 18313
Added:
annotations/branches/v3_4_0_GA_CP/src/main/docbook/de-DE/
annotations/branches/v3_4_0_GA_CP/src/main/docbook/de-DE/Author_Group.po
annotations/branches/v3_4_0_GA_CP/src/main/docbook/de-DE/Book_Info.po
annotations/branches/v3_4_0_GA_CP/src/main/docbook/de-DE/Feedback.po
annotations/branches/v3_4_0_GA_CP/src/main/docbook/de-DE/Hibernate_Annotations_Reference_Guide.po
annotations/branches/v3_4_0_GA_CP/src/main/docbook/de-DE/Preface.po
annotations/branches/v3_4_0_GA_CP/src/main/docbook/de-DE/Revision_History.po
annotations/branches/v3_4_0_GA_CP/src/main/docbook/de-DE/additionalmodules.po
annotations/branches/v3_4_0_GA_CP/src/main/docbook/de-DE/entity.po
annotations/branches/v3_4_0_GA_CP/src/main/docbook/de-DE/setup.po
annotations/branches/v3_4_0_GA_CP/src/main/docbook/de-DE/xml-overriding.po
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/Author_Group.xml
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/Book_Info.xml
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/Feedback.xml
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/Hibernate_Annotations_Reference_Guide.ent
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/Hibernate_Annotations_Reference_Guide.xml
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/Preface.xml
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/Revision_History.xml
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/A320.java
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/Address.java
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/AmericaCupClass.java
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/AnnotatedClassesandPackages.java
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/BaseEntity.java
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/Basic_Annotation.java
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/Boat.java
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/Country.java
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/Ferry.java
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/Flight.java
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/Flight_a.java
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/Flight_c.java
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/FlyingObject.java
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/Footballer.java
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/FootballerPk.java
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/HibernateUtil.java
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/Lob_Ex.java
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/Order.java
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/Override_Attributes.java
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/Person.java
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/Plane.java
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/Plane_a.java
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/Sequence_Generator.java
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/Store.java
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/Table_Generator.java
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/TvMagazin.java
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/cache_concurrency_strategy.java
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/column_properties.java
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/hibernate.cfg.xml_sample
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/hibernate.cfg.xmlt
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/override_metadata_1.xml_sample
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/override_metadata_1.xmlt
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/override_metadata_2.xml_sample
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/override_metadata_2.xmlt
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/sequence_generator.xml_sample
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/table_generator.xml_sample
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/fallback_content/
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/fallback_content/Conventions.xml
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/fallback_content/Feedback.xml
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/fallback_content/Legal_Notice.xml
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/images/
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/images/hibernate_logo_a.png
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/images/hibernate_logo_a_small.png
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/modules/
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/modules/additionalmodules.xml
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/modules/entity.xml
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/modules/setup.xml
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/modules/xml-overriding.xml
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/pom.xml
annotations/branches/v3_4_0_GA_CP/src/main/docbook/es-ES/
annotations/branches/v3_4_0_GA_CP/src/main/docbook/es-ES/Author_Group.po
annotations/branches/v3_4_0_GA_CP/src/main/docbook/es-ES/Book_Info.po
annotations/branches/v3_4_0_GA_CP/src/main/docbook/es-ES/Feedback.po
annotations/branches/v3_4_0_GA_CP/src/main/docbook/es-ES/Hibernate_Annotations_Reference_Guide.po
annotations/branches/v3_4_0_GA_CP/src/main/docbook/es-ES/Preface.po
annotations/branches/v3_4_0_GA_CP/src/main/docbook/es-ES/Revision_History.po
annotations/branches/v3_4_0_GA_CP/src/main/docbook/es-ES/additionalmodules.po
annotations/branches/v3_4_0_GA_CP/src/main/docbook/es-ES/entity.po
annotations/branches/v3_4_0_GA_CP/src/main/docbook/es-ES/setup.po
annotations/branches/v3_4_0_GA_CP/src/main/docbook/es-ES/xml-overriding.po
annotations/branches/v3_4_0_GA_CP/src/main/docbook/fr-FR/
annotations/branches/v3_4_0_GA_CP/src/main/docbook/fr-FR/Author_Group.po
annotations/branches/v3_4_0_GA_CP/src/main/docbook/fr-FR/Book_Info.po
annotations/branches/v3_4_0_GA_CP/src/main/docbook/fr-FR/Feedback.po
annotations/branches/v3_4_0_GA_CP/src/main/docbook/fr-FR/Hibernate_Annotations_Reference_Guide.po
annotations/branches/v3_4_0_GA_CP/src/main/docbook/fr-FR/Preface.po
annotations/branches/v3_4_0_GA_CP/src/main/docbook/fr-FR/Revision_History.po
annotations/branches/v3_4_0_GA_CP/src/main/docbook/fr-FR/additionalmodules.po
annotations/branches/v3_4_0_GA_CP/src/main/docbook/fr-FR/entity.po
annotations/branches/v3_4_0_GA_CP/src/main/docbook/fr-FR/setup.po
annotations/branches/v3_4_0_GA_CP/src/main/docbook/fr-FR/xml-overriding.po
annotations/branches/v3_4_0_GA_CP/src/main/docbook/ja-JP/
annotations/branches/v3_4_0_GA_CP/src/main/docbook/ja-JP/Author_Group.po
annotations/branches/v3_4_0_GA_CP/src/main/docbook/ja-JP/Book_Info.po
annotations/branches/v3_4_0_GA_CP/src/main/docbook/ja-JP/Feedback.po
annotations/branches/v3_4_0_GA_CP/src/main/docbook/ja-JP/Hibernate_Annotations_Reference_Guide.po
annotations/branches/v3_4_0_GA_CP/src/main/docbook/ja-JP/Preface.po
annotations/branches/v3_4_0_GA_CP/src/main/docbook/ja-JP/Revision_History.po
annotations/branches/v3_4_0_GA_CP/src/main/docbook/ja-JP/additionalmodules.po
annotations/branches/v3_4_0_GA_CP/src/main/docbook/ja-JP/entity.po
annotations/branches/v3_4_0_GA_CP/src/main/docbook/ja-JP/setup.po
annotations/branches/v3_4_0_GA_CP/src/main/docbook/ja-JP/xml-overriding.po
annotations/branches/v3_4_0_GA_CP/src/main/docbook/pt-BR/
annotations/branches/v3_4_0_GA_CP/src/main/docbook/pt-BR/Author_Group.po
annotations/branches/v3_4_0_GA_CP/src/main/docbook/pt-BR/Book_Info.po
annotations/branches/v3_4_0_GA_CP/src/main/docbook/pt-BR/Feedback.po
annotations/branches/v3_4_0_GA_CP/src/main/docbook/pt-BR/Hibernate_Annotations_Reference_Guide.po
annotations/branches/v3_4_0_GA_CP/src/main/docbook/pt-BR/Preface.po
annotations/branches/v3_4_0_GA_CP/src/main/docbook/pt-BR/Revision_History.po
annotations/branches/v3_4_0_GA_CP/src/main/docbook/pt-BR/additionalmodules.po
annotations/branches/v3_4_0_GA_CP/src/main/docbook/pt-BR/entity.po
annotations/branches/v3_4_0_GA_CP/src/main/docbook/pt-BR/setup.po
annotations/branches/v3_4_0_GA_CP/src/main/docbook/pt-BR/xml-overriding.po
annotations/branches/v3_4_0_GA_CP/src/main/docbook/publican.cfg
annotations/branches/v3_4_0_GA_CP/src/main/docbook/zh-CN/
annotations/branches/v3_4_0_GA_CP/src/main/docbook/zh-CN/Author_Group.po
annotations/branches/v3_4_0_GA_CP/src/main/docbook/zh-CN/Book_Info.po
annotations/branches/v3_4_0_GA_CP/src/main/docbook/zh-CN/Feedback.po
annotations/branches/v3_4_0_GA_CP/src/main/docbook/zh-CN/Hibernate_Annotations_Reference_Guide.po
annotations/branches/v3_4_0_GA_CP/src/main/docbook/zh-CN/Preface.po
annotations/branches/v3_4_0_GA_CP/src/main/docbook/zh-CN/Revision_History.po
annotations/branches/v3_4_0_GA_CP/src/main/docbook/zh-CN/additionalmodules.po
annotations/branches/v3_4_0_GA_CP/src/main/docbook/zh-CN/entity.po
annotations/branches/v3_4_0_GA_CP/src/main/docbook/zh-CN/setup.po
annotations/branches/v3_4_0_GA_CP/src/main/docbook/zh-CN/xml-overriding.po
Removed:
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en/
annotations/branches/v3_4_0_GA_CP/src/main/docbook/fr/
annotations/branches/v3_4_0_GA_CP/src/main/docbook/zh_cn/
Modified:
annotations/branches/v3_4_0_GA_CP/pom.xml
Log:
JBPAPP-3297 HHH-4729 Import work done by Red Hat translation team
Modified: annotations/branches/v3_4_0_GA_CP/pom.xml
===================================================================
--- annotations/branches/v3_4_0_GA_CP/pom.xml 2009-12-22 06:12:34 UTC (rev 18312)
+++ annotations/branches/v3_4_0_GA_CP/pom.xml 2009-12-22 06:50:19 UTC (rev 18313)
@@ -301,11 +301,18 @@
</dependency>
</dependencies>
<configuration>
- <sourceDocumentName>master.xml</sourceDocumentName>
+ <sourceDocumentName>Hibernate_Annotations_Reference_Guide.xml</sourceDocumentName>
<sourceDirectory>${basedir}/src/main/docbook</sourceDirectory>
- <masterTranslation>en</masterTranslation>
+ <masterTranslation>en-US</masterTranslation>
+ <translations>
+ <translation>es-ES</translation>
+ <translation>fr-FR</translation>
+ <translation>ja-JP</translation>
+ <translation>pt-BR</translation>
+ <translation>zh-CN</translation>
+ </translations>
<imageResource>
- <directory>${basedir}/src/main/docbook/en/images</directory>
+ <directory>${basedir}/src/main/docbook/en-US/images</directory>
</imageResource>
<formats>
<format>
@@ -342,6 +349,7 @@
<goals>
<goal>resources</goal>
<goal>generate</goal>
+ <!-- <goal>translate</goal> -->
</goals>
</execution>
</executions>
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/de-DE/Author_Group.po
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/de-DE/Author_Group.po
(rev 0)
+++ annotations/branches/v3_4_0_GA_CP/src/main/docbook/de-DE/Author_Group.po 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,5 @@
+#. Tag: author
+#: Author_Group.xml:6
+#, no-c-format
+msgid "<firstname>Red Hat Documentation Group</firstname>
<surname></surname>"
+msgstr ""
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/de-DE/Book_Info.po
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/de-DE/Book_Info.po
(rev 0)
+++ annotations/branches/v3_4_0_GA_CP/src/main/docbook/de-DE/Book_Info.po 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,25 @@
+#. Tag: title
+#: Book_Info.xml:6
+#, no-c-format
+msgid "Hibernate Annotations Reference Guide"
+msgstr ""
+
+#. Tag: subtitle
+#: Book_Info.xml:7
+#, no-c-format
+msgid "for Use with JBoss Enterprise Application Platform 5.0"
+msgstr ""
+
+#. Tag: para
+#: Book_Info.xml:14
+#, no-c-format
+msgid ""
+"The JBoss Enterprise Application Platform Edition of the Hibernate "
+"Annotations Reference Guide"
+msgstr ""
+
+#. Tag: holder
+#: Book_Info.xml:25
+#, no-c-format
+msgid "&HOLDER;"
+msgstr ""
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/de-DE/Feedback.po
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/de-DE/Feedback.po
(rev 0)
+++ annotations/branches/v3_4_0_GA_CP/src/main/docbook/de-DE/Feedback.po 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,19 @@
+#. Tag: title
+#: Feedback.xml:6
+#, no-c-format
+msgid "Feedback"
+msgstr ""
+
+#. Tag: para
+#: Feedback.xml:7
+#, no-c-format
+msgid ""
+"If you spot a typo in this guide, or if you have thought of a way to make "
+"this manual better, we would love to hear from you! Submit a report in "
+"<ulink
url=\"http://jira.jboss.com/jira/browse/JBPAPP\">JIRA</ul... against
"
+"the Product: JBoss Enterprise Application Platform, Version: "
+"<replaceable><version></replaceable>, Component:
<emphasis>Doc</"
+"emphasis>. If you have a suggestion for improving the documentation, try to
"
+"be as specific as possible. If you have found an error, include the section "
+"number and some of the surrounding text so we can find it easily."
+msgstr ""
Added:
annotations/branches/v3_4_0_GA_CP/src/main/docbook/de-DE/Hibernate_Annotations_Reference_Guide.po
===================================================================
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/de-DE/Preface.po
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/de-DE/Preface.po
(rev 0)
+++ annotations/branches/v3_4_0_GA_CP/src/main/docbook/de-DE/Preface.po 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,45 @@
+#. Tag: title
+#: Preface.xml:2
+#, no-c-format
+msgid "Preface"
+msgstr ""
+
+#. Tag: para
+#: Preface.xml:4
+#, no-c-format
+msgid ""
+"Hibernate, like all other object/relational mapping tools, requires metadata
"
+"that governs the transformation of data from one representation to the "
+"other. In Hibernate 2.x mapping metadata is most of the time declared in XML
"
+"text files. Alternatively XDoclet can be used utilizing Javadoc source code "
+"annotations together with a compile time preprocessor."
+msgstr ""
+
+#. Tag: para
+#: Preface.xml:11
+#, no-c-format
+msgid ""
+"The same kind of annotation support is now available in the standard JDK, "
+"although more powerful and with better tools support. IntelliJ IDEA and "
+"Eclipse for example, support auto-completion and syntax highlighting of JDK "
+"5.0 annotations which are compiled into the bytecode and read at runtime "
+"using reflection. No external XML files are needed."
+msgstr ""
+
+#. Tag: para
+#: Preface.xml:17
+#, no-c-format
+msgid ""
+"The EJB3 specification recognizes the interest and the success of the "
+"transparent object/relational mapping paradigm. It standardizes the basic "
+"APIs and the metadata needed for any object/relational persistence "
+"mechanism. <emphasis>Hibernate EntityManager</emphasis> implements the
"
+"programming interfaces and lifecycle rules as defined by the EJB3 "
+"persistence specification and together with <emphasis>Hibernate
Annotations</"
+"emphasis> offers a complete (and standalone) EJB3 persistence solution on
"
+"top of the mature Hibernate core. You may use a combination of all three "
+"together, annotations without EJB3 programming interfaces and lifecycle, or "
+"even pure native Hibernate, depending on the business and technical needs of
"
+"your project. At all times you cann fall back to Hibernate native APIs, or "
+"if required, even to native JDBC and SQL."
+msgstr ""
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/de-DE/Revision_History.po
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/de-DE/Revision_History.po
(rev 0)
+++
annotations/branches/v3_4_0_GA_CP/src/main/docbook/de-DE/Revision_History.po 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,19 @@
+#. Tag: title
+#: Revision_History.xml:6
+#, no-c-format
+msgid "Revision History"
+msgstr ""
+
+#. Tag: author
+#: Revision_History.xml:12
+#, no-c-format
+msgid ""
+"<firstname>Laura</firstname> <surname>Bailey</surname>
<email>lbailey(a)redhat."
+"com</email>"
+msgstr ""
+
+#. Tag: member
+#: Revision_History.xml:19
+#, no-c-format
+msgid "Initial draft."
+msgstr ""
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/de-DE/additionalmodules.po
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/de-DE/additionalmodules.po
(rev 0)
+++
annotations/branches/v3_4_0_GA_CP/src/main/docbook/de-DE/additionalmodules.po 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,178 @@
+#. Tag: title
+#: additionalmodules.xml:28
+#, no-c-format
+msgid "Additional modules"
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:30
+#, no-c-format
+msgid ""
+"Hibernate Annotations mainly focus on persistence metadata. The project also
"
+"have a nice integration with two Hibernate modules."
+msgstr ""
+
+#. Tag: title
+#: additionalmodules.xml:34
+#, no-c-format
+msgid "Hibernate Validator"
+msgstr ""
+
+#. Tag: title
+#: additionalmodules.xml:37 additionalmodules.xml:117
+#, no-c-format
+msgid "Description"
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:39
+#, no-c-format
+msgid ""
+"Annotations are a very convenient and elegant way to specify invariant "
+"constraints for a domain model. You can, for example, express that a "
+"property should never be null, that the account balance should be strictly "
+"positive, etc. These domain model constraints are declared in the bean "
+"itself by annotating its properties. A validator can then read them and "
+"check for constraint violations. The validation mechanism can be executed in
"
+"different layers in your application without having to duplicate any of "
+"these rules (presentation layer, data access layer). Following the DRY "
+"principle, Hibernate Validator has been designed for that purpose."
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:50
+#, no-c-format
+msgid ""
+"Hibernate Validator works at two levels. First, it is able to check in-"
+"memory instances of a class for constraint violations. Second, it can apply "
+"the constraints to the Hibernate metamodel and incorporate them into the "
+"generated database schema."
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:55
+#, no-c-format
+msgid ""
+"Each constraint annotation is associated to a validator implementation "
+"responsible for checking the constraint on the entity instance. A validator "
+"can also (optionally) apply the constraint to the Hibernate metamodel, "
+"allowing Hibernate to generate DDL that expresses the constraint. With the "
+"appropriate event listener, you can execute the checking operation on "
+"inserts and updates done by Hibernate. Hibernate Validator is not limited to
"
+"use with Hibernate. You can easily use it anywhere in your application."
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:64
+#, no-c-format
+msgid ""
+"When checking instances at runtime, Hibernate Validator returns information "
+"about constraint violations in an array of
<classname>InvalidValue</"
+"classname> s. Among other information, the
<classname>InvalidValue</"
+"classname> contains an error description message that can embed the "
+"parameter values bundle with the annotation (eg. length limit), and message "
+"strings that may be externalized to a
<classname>ResourceBundle</classname> ."
+msgstr ""
+
+#. Tag: title
+#: additionalmodules.xml:74 additionalmodules.xml:132
+#, no-c-format
+msgid "Integration with Hibernate Annotations"
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:76
+#, no-c-format
+msgid ""
+"If Hibernate Validator (<filename>hibernate-validator.jar</filename>)
is "
+"available in the classpath, Hibernate Annotations will integrate in two
ways:"
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:82
+#, no-c-format
+msgid ""
+"Constraints will be applied to the Data Definition Language. In other words,
"
+"the database schema will reflect the constraints (provided that you use the "
+"hbm2ddl tool)."
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:88
+#, no-c-format
+msgid ""
+"Before an entity change is applied to the database (insert or update), the "
+"entity is validated. Validation errors, if any, will be carried over through
"
+"an <classname>InvalidStateException</classname>."
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:95
+#, no-c-format
+msgid ""
+"For entities free of validation rules, the runtime performance cost is null."
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:98
+#, no-c-format
+msgid ""
+"To disable constraint propagation to DDL, set up <literal>hibernate."
+"validator.apply_to_ddl</literal> to false in the configuration file. Such a
"
+"need is very uncommon and not recommended."
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:103
+#, no-c-format
+msgid ""
+"To disable pre-entity change validation, set up
<literal>hibernate.validator."
+"autoregister_listeners</literal> to false in the configuration file. Such a
"
+"need is very uncommon and not recommended."
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:108
+#, no-c-format
+msgid ""
+"Check the Hibernate Validator reference documentation for more information."
+msgstr ""
+
+#. Tag: title
+#: additionalmodules.xml:114
+#, no-c-format
+msgid "Hibernate Search"
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:119
+#, no-c-format
+msgid ""
+"Full text search engines like <productname>Apache Lucene</productname>
are a "
+"very powerful technology to bring free text/efficient queries to "
+"applications. If suffers several mismatches when dealing with a object "
+"domain model (keeping the index up to date, mismatch between the index "
+"structure and the domain model, querying mismatch...) Hibernate Search "
+"indexes your domain model thanks to a few annotations, takes care of the "
+"database / index synchronization and brings you back regular managed objects
"
+"from free text queries. Hibernate Search is using <ulink
url=\"http://lucene."
+"apache.org\">Apache Lucene</ulink> under the cover."
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:134
+#, no-c-format
+msgid ""
+"Hibernate Search integrates with Hibernate Annotations transparently "
+"provided that hibernate-search.jar is present in the classpath. If you do "
+"not wish to automatically register Hibernate Search event listeners, you can
"
+"set <literal>hibernate.search.autoregister_listeners</literal> to
false. "
+"Such a need is very uncommon and not recommended."
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:141
+#, no-c-format
+msgid ""
+"Check the Hibernate Search reference documentation for more information."
+msgstr ""
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/de-DE/entity.po
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/de-DE/entity.po
(rev 0)
+++ annotations/branches/v3_4_0_GA_CP/src/main/docbook/de-DE/entity.po 2009-12-22 06:50:19
UTC (rev 18313)
@@ -0,0 +1,5481 @@
+#. Tag: title
+#: entity.xml:28
+#, no-c-format
+msgid "Entity Beans"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:31
+#, no-c-format
+msgid "Intro"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:33
+#, no-c-format
+msgid ""
+"This section covers EJB 3.0 (aka Java Persistence) entity annotations and "
+"Hibernate-specific extensions."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:38
+#, no-c-format
+msgid "Mapping with EJB3/JPA Annotations"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:40
+#, no-c-format
+msgid ""
+"EJB3 entities are plain POJOs. Actually they represent the exact same "
+"concept as the Hibernate persistent entities. Their mappings are defined "
+"through JDK 5.0 annotations (an XML descriptor syntax for overriding is "
+"defined in the EJB3 specification). Annotations can be split in two "
+"categories, the logical mapping annotations (allowing you to describe the "
+"object model, the class associations, etc.) and the physical mapping "
+"annotations (describing the physical schema, tables, columns, indexes, etc).
"
+"We will mix annotations from both categories in the following code examples."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:50
+#, no-c-format
+msgid ""
+"EJB3 annotations are in the <literal>javax.persistence.*</literal>
package. "
+"Most JDK 5 compliant IDE (like Eclipse, IntelliJ IDEA and Netbeans) can "
+"autocomplete annotation interfaces and attributes for you (even without a "
+"specific \"EJB3\" module, since EJB3 annotations are plain JDK 5 "
+"annotations)."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:56
+#, no-c-format
+msgid ""
+"For more and runnable concrete examples read the JBoss EJB 3.0 tutorial or "
+"review the Hibernate Annotations test suite. Most of the unit tests have "
+"been designed to represent a concrete example and be a inspiration source."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:62
+#, no-c-format
+msgid "Declaring an entity bean"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:64
+#, no-c-format
+msgid ""
+"Every bound persistent POJO class is an entity bean and is declared using "
+"the <literal>@Entity</literal> annotation (at the class level):"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:68
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Flight implements Serializable {\n"
+" Long id;\n"
+"\n"
+" @Id\n"
+" public Long getId() { return id; }\n"
+"\n"
+" public void setId(Long id) { this.id = id; }\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:70
+#, no-c-format
+msgid ""
+"<literal>@Entity</literal> declares the class as an entity bean (i.e. a
"
+"persistent POJO class), <literal>@Id</literal> declares the identifier
"
+"property of this entity bean. The other mapping declarations are implicit. "
+"This configuration by exception concept is central to the new EJB3 "
+"specification and a major improvement. The class Flight is mapped to the "
+"Flight table, using the column id as its primary key column."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:78
+#, no-c-format
+msgid ""
+"Depending on whether you annotate fields or methods, the access type used by
"
+"Hibernate will be <literal>field</literal> or
<literal>property</literal>. "
+"The EJB3 spec requires that you declare annotations on the element type that
"
+"will be accessed, i.e. the getter method if you use
<literal>property</"
+"literal> access, the field if you use <literal>field</literal>
access. "
+"Mixing EJB3 annotations in both fields and methods should be avoided. "
+"Hibernate will guess the access type from the position of
<literal>@Id</"
+"literal> or <literal>(a)EmbeddedId</literal>."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:89
+#, no-c-format
+msgid "Defining the table"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:91
+#, no-c-format
+msgid ""
+"<literal>@Table</literal> is set at the class level; it allows you to
define "
+"the table, catalog, and schema names for your entity bean mapping. If no "
+"<literal>@Table</literal> is defined the default values are used: the
"
+"unqualified class name of the entity."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:96
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Table(name=\"tbl_sky\")\n"
+"public class Sky implements Serializable {\n"
+"..."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:98
+#, no-c-format
+msgid ""
+"The <literal>@Table</literal> element also contains a
<literal>schema</"
+"literal> and a <literal>catalog</literal> attributes, if they need
to be "
+"defined. You can also define unique constraints to the table using the "
+"<literal>@UniqueConstraint</literal> annotation in conjunction with
"
+"<literal>@Table</literal> (for a unique constraint bound to a single
column, "
+"refer to <literal>(a)Column</literal>)."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:105
+#, no-c-format
+msgid ""
+"@Table(name=\"tbl_sky\",\n"
+" <emphasis role=\"bold\">uniqueConstraints =
{@UniqueConstraint"
+"(columnNames={\"month\", \"day\"})}</emphasis>\n"
+")"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:107
+#, no-c-format
+msgid ""
+"A unique constraint is applied to the tuple month, day. Note that the "
+"<literal>columnNames</literal> array refers to the logical column
names."
+msgstr ""
+
+#. Tag: remark
+#: entity.xml:111
+#, no-c-format
+msgid ""
+"The logical column name is defined by the Hibernate NamingStrategy "
+"implementation. The default EJB3 naming strategy use the physical column "
+"name as the logical column name. Note that this may be different than the "
+"property name (if the column name is explicit). Unless you override the "
+"NamingStrategy, you shouldn't worry about that."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:120
+#, no-c-format
+msgid "Versioning for optimistic locking"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:122
+#, no-c-format
+msgid ""
+"You can add optimistic locking capability to an entity bean using the "
+"<literal>@Version</literal> annotation:"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:125
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Flight implements Serializable {\n"
+"...\n"
+" @Version\n"
+" @Column(name=\"OPTLOCK\")\n"
+" public Integer getVersion() { ... }\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:127
+#, no-c-format
+msgid ""
+"The version property will be mapped to the <literal>OPTLOCK</literal>
"
+"column, and the entity manager will use it to detect conflicting updates "
+"(preventing lost updates you might otherwise see with the last-commit-wins "
+"strategy)."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:132
+#, no-c-format
+msgid ""
+"The version column may be a numeric (the recommended solution) or a "
+"timestamp as per the EJB3 spec. Hibernate support any kind of type provided "
+"that you define and implement the appropriate
<classname>UserVersionType</"
+"classname>."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:137
+#, no-c-format
+msgid ""
+"The application must not alter the version number set up by Hibernate in any
"
+"way. To artificially increase the version number, check in Hibernate Entity "
+"Manager's reference documentation
<literal>LockMode.WRITE</literal>"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:145
+#, no-c-format
+msgid "Mapping simple properties"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:148
+#, no-c-format
+msgid "Declaring basic property mappings"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:150
+#, no-c-format
+msgid ""
+"Every non static non transient property (field or method) of an entity bean "
+"is considered persistent, unless you annotate it as
<literal>@Transient</"
+"literal>. Not having an annotation for your property is equivalent to the
"
+"appropriate <literal>@Basic</literal> annotation. The
<literal>@Basic</"
+"literal> annotation allows you to declare the fetching strategy for a "
+"property:"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:157
+#, no-c-format
+msgid ""
+"public transient int counter; //transient property\n"
+"\n"
+"private String firstname; //persistent property\n"
+"\n"
+"@Transient\n"
+"String getLengthInMeter() { ... } //transient property\n"
+"\n"
+"String getName() {... } // persistent property\n"
+"\n"
+"@Basic\n"
+"int getLength() { ... } // persistent property\n"
+"\n"
+"@Basic(fetch = FetchType.LAZY)\n"
+"String getDetailedComment() { ... } // persistent property\n"
+"\n"
+"(a)Temporal(TemporalType.TIME)\n"
+"java.util.Date getDepartureTime() { ... } // persistent property
\n"
+"\n"
+"(a)Enumerated(EnumType.STRING)\n"
+"Starred getNote() { ... } //enum persisted as String in database"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:159
+#, no-c-format
+msgid ""
+"<literal>counter</literal>, a transient field, and
<literal>lengthInMeter</"
+"literal>, a method annotated as <literal>@Transient</literal>, and
will be "
+"ignored by the entity manager. <literal>name</literal>,
<literal>length</"
+"literal>, and <literal>firstname</literal> properties are mapped
persistent "
+"and eagerly fetched (the default for simple properties). The "
+"<literal>detailedComment</literal> property value will be lazily
fetched "
+"from the database once a lazy property of the entity is accessed for the "
+"first time. Usually you don't need to lazy simple properties (not to be "
+"confused with lazy association fetching)."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:171
+#, no-c-format
+msgid ""
+"To enable property level lazy fetching, your classes have to be "
+"instrumented: bytecode is added to the original one to enable such feature, "
+"please refer to the Hibernate reference documentation. If your classes are "
+"not instrumented, property level lazy loading is silently ignored."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:178
+#, no-c-format
+msgid ""
+"The recommended alternative is to use the projection capability of EJB-QL or
"
+"Criteria queries."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:181
+#, no-c-format
+msgid ""
+"EJB3 support property mapping of all basic types supported by Hibernate (all
"
+"basic Java types , their respective wrappers and serializable classes). "
+"Hibernate Annotations support out of the box Enum type mapping either into a
"
+"ordinal column (saving the enum ordinal) or a string based column (saving "
+"the enum string representation): the persistence representation, defaulted "
+"to ordinal, can be overriden through the <literal>@Enumerated</literal>
"
+"annotation as shown in the <literal>note</literal> property
example."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:190
+#, no-c-format
+msgid ""
+"In core Java APIs, the temporal precision is not defined. When dealing with "
+"temporal data you might want to describe the expected precision in database.
"
+"Temporal data can have <literal>DATE</literal>,
<literal>TIME</literal>, or "
+"<literal>TIMESTAMP</literal> precision (ie the actual date, only the
time, "
+"or both). Use the <literal>@Temporal</literal> annotation to fine tune
that."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:197
+#, no-c-format
+msgid ""
+"<literal>@Lob</literal> indicates that the property should be persisted
in a "
+"Blob or a Clob depending on the property type:
<classname>java.sql.Clob</"
+"classname>, <classname>Character[]</classname>,
<classname>char[]</"
+"classname> and java.lang.<classname>String</classname> will be
persisted in "
+"a Clob. <classname>java.sql.Blob</classname>,
<classname>Byte[]</classname>, "
+"<classname>byte[] </classname>and serializable type will be persisted
in a "
+"Blob."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:206
+#, no-c-format
+msgid ""
+"@Lob\n"
+"public String getFullText() {\n"
+" return fullText;\n"
+"}\n"
+"\n"
+"@Lob \n"
+"public byte[] getFullCode() {\n"
+" return fullCode;\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:208
+#, no-c-format
+msgid ""
+"If the property type implements
<classname>java.io.Serializable</classname> "
+"and is not a basic type, and if the property is not annotated with "
+"<literal>@Lob</literal>, then the Hibernate
<literal>serializable</literal> "
+"type is used."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:216
+#, no-c-format
+msgid "Declaring column attributes"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:218
+#, no-c-format
+msgid ""
+"The column(s) used for a property mapping can be defined using the "
+"<literal>@Column</literal> annotation. Use it to override default
values "
+"(see the EJB3 specification for more information on the defaults). You can "
+"use this annotation at the property level for properties that are:"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:226
+#, no-c-format
+msgid "not annotated at all"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:230
+#, no-c-format
+msgid "annotated with <literal>@Basic</literal>"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:234
+#, no-c-format
+msgid "annotated with <literal>@Version</literal>"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:238
+#, no-c-format
+msgid "annotated with <literal>@Lob</literal>"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:242
+#, no-c-format
+msgid "annotated with <literal>@Temporal</literal>"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:246
+#, no-c-format
+msgid ""
+"annotated with
<literal>(a)org.hibernate.annotations.CollectionOfElements</"
+"literal> (for Hibernate only)"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:252
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Flight implements Serializable {\n"
+"...\n"
+"@Column(updatable = false, name = \"flight_name\", nullable = false,
"
+"length=50)\n"
+"public String getName() { ... }"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:254
+#, no-c-format
+msgid ""
+"The <literal>name</literal> property is mapped to the
<literal>flight_name</"
+"literal> column, which is not nullable, has a length of 50 and is not "
+"updatable (making the property immutable)."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:259
+#, no-c-format
+msgid ""
+"This annotation can be applied to regular properties as well as "
+"<literal>@Id</literal> or <literal>@Version</literal>
properties."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:286
+#, no-c-format
+msgid ""
+"@Column(\n"
+" name=\"columnName\";\n"
+" boolean unique() default false;\n"
+" boolean nullable() default true;\n"
+" boolean insertable() default true;\n"
+" boolean updatable() default true;\n"
+" String columnDefinition() default \"\";\n"
+" String table() default \"\";\n"
+" int length() default 255;\n"
+" int precision() default 0; // decimal precision\n"
+" int scale() default 0; // decimal scale"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:290
+#, no-c-format
+msgid ""
+"<literal>name</literal> (optional): the column name (default to the
property "
+"name)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:295
+#, no-c-format
+msgid ""
+"<literal>unique</literal> (optional): set a unique constraint on this
column "
+"or not (default false)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:300
+#, no-c-format
+msgid ""
+"<literal>nullable</literal> (optional): set the column as nullable
(default "
+"true)."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:305
+#, no-c-format
+msgid ""
+"<literal>insertable</literal> (optional): whether or not the column
will be "
+"part of the insert statement (default true)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:311
+#, no-c-format
+msgid ""
+"<literal>updatable</literal> (optional): whether or not the column will
be "
+"part of the update statement (default true)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:317
+#, no-c-format
+msgid ""
+"<literal>columnDefinition</literal> (optional): override the sql DDL
"
+"fragment for this particular column (non portable)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:323
+#, no-c-format
+msgid ""
+"<literal>table</literal> (optional): define the targeted table (default
"
+"primary table)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:328
+#, no-c-format
+msgid ""
+"<literal><literal>length</literal></literal> (optional):
column length "
+"(default 255)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:333
+#, no-c-format
+msgid ""
+"<literal><literal>precision</literal></literal> (optional):
column decimal "
+"precision (default 0)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:338
+#, no-c-format
+msgid ""
+"<literal><literal>scale</literal></literal> (optional):
column decimal scale "
+"if useful (default 0)"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:346
+#, no-c-format
+msgid "Embedded objects (aka components)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:348
+#, no-c-format
+msgid ""
+"It is possible to declare an embedded component inside an entity and even "
+"override its column mapping. Component classes have to be annotated at the "
+"class level with the <literal>@Embeddable</literal> annotation. It is
"
+"possible to override the column mapping of an embedded object for a "
+"particular entity using the <literal>@Embedded</literal> and "
+"<literal>@AttributeOverride</literal> annotation in the associated
property:"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:356
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Person implements Serializable {\n"
+"\n"
+" // Persistent component using defaults\n"
+" Address homeAddress;\n"
+"\n"
+" @Embedded\n"
+" @AttributeOverrides( {\n"
+" @AttributeOverride(name=\"iso2\", column =
@Column(name="
+"\"bornIso2\") ),\n"
+" @AttributeOverride(name=\"name\", column =
@Column(name="
+"\"bornCountryName\") )\n"
+" } )\n"
+" Country bornIn;\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:358
+#, no-c-format
+msgid ""
+"@Embeddable\n"
+"public class Address implements Serializable {\n"
+" String city;\n"
+" Country nationality; //no overriding here\n"
+"}"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:360
+#, no-c-format
+msgid ""
+"@Embeddable\n"
+"public class Country implements Serializable {\n"
+" private String iso2;\n"
+" @Column(name=\"countryName\") private String name;\n"
+"\n"
+" public String getIso2() { return iso2; }\n"
+" public void setIso2(String iso2) { this.iso2 = iso2; }\n"
+"\n"
+" \n"
+" public String getName() { return name; }\n"
+" public void setName(String name) { this.name = name; }\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:362
+#, no-c-format
+msgid ""
+"A embeddable object inherit the access type of its owning entity (note that "
+"you can override that using the Hibernate specific
<literal>@AccessType</"
+"literal> annotations (see <xref
linkend=\"entity-hibspec\"/>)."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:367
+#, no-c-format
+msgid ""
+"The <literal>Person</literal> entity bean has two component properties,
"
+"<literal>homeAddress</literal> and
<literal>bornIn</literal>. "
+"<literal>homeAddress</literal> property has not been annotated, but
"
+"Hibernate will guess that it is a persistent component by looking for the "
+"<literal>@Embeddable</literal> annotation in the Address class. We also
"
+"override the mapping of a column name (to
<literal>bornCountryName</"
+"literal>) with the <literal>@Embedded</literal> and "
+"<literal>@AttributeOverride </literal>annotations for each mapped
attribute "
+"of <literal>Country</literal>. As you can see, <literal>Country
</literal>is "
+"also a nested component of <literal>Address</literal>, again using
auto-"
+"detection by Hibernate and EJB3 defaults. Overriding columns of embedded "
+"objects of embedded objects is currently not supported in the EJB3 spec, "
+"however, Hibernate Annotations supports it through dotted expressions."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:383
+#, no-c-format
+msgid ""
+"@Embedded\n"
+" @AttributeOverrides( {\n"
+" @AttributeOverride(name=\"city\", column =
@Column(name="
+"\"fld_city\") ),\n"
+" @AttributeOverride(name=\"<emphasis
role=\"bold\">nationality."
+"iso2</emphasis>\", column = @Column(name=\"nat_Iso2\")
),\n"
+" @AttributeOverride(name=\"<emphasis
role=\"bold\">nationality."
+"name</emphasis>\", column = @Column(name=\"nat_CountryName\")
)\n"
+" //nationality columns in homeAddress are overridden\n"
+" } )\n"
+" Address homeAddress;"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:383
+#, no-c-format
+msgid ""
+"Hibernate Annotations supports one more feature that is not explicitly "
+"supported by the EJB3 specification. You can annotate a embedded object with
"
+"the <literal>@MappedSuperclass</literal> annotation to make the
superclass "
+"properties persistent (see <literal>@MappedSuperclass</literal> for
more "
+"informations)."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:390
+#, no-c-format
+msgid ""
+"While not supported by the EJB3 specification, Hibernate Annotations allows "
+"you to use association annotations in an embeddable object (ie "
+"<literal>@*ToOne</literal> nor
<literal>@*ToMany</literal>). To override the "
+"association columns you can use
<literal>(a)AssociationOverride</literal>."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:396
+#, no-c-format
+msgid ""
+"If you want to have the same embeddable object type twice in the same "
+"entity, the column name defaulting will not work: at least one of the "
+"columns will have to be explicit. Hibernate goes beyond the EJB3 spec and "
+"allows you to enhance the defaulting mechanism through the "
+"<classname>NamingStrategy</classname>. "
+"<classname>DefaultComponentSafeNamingStrategy</classname> is a small
"
+"improvement over the default EJB3NamingStrategy that allows embedded objects
"
+"to be defaulted even if used twice in the same entity."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:407
+#, no-c-format
+msgid "Non-annotated property defaults"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:409
+#, no-c-format
+msgid "If a property is not annotated, the following rules apply:"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:414
+#, no-c-format
+msgid "If the property is of a single type, it is mapped as @Basic"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:420
+#, no-c-format
+msgid ""
+"Otherwise, if the type of the property is annotated as @Embeddable, it is "
+"mapped as @Embedded"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:426
+#, no-c-format
+msgid ""
+"Otherwise, if the type of the property is Serializable, it is mapped as "
+"@Basic in a column holding the object in its serialized version"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:432
+#, no-c-format
+msgid ""
+"Otherwise, if the type of the property is java.sql.Clob or java.sql.Blob, it
"
+"is mapped as @Lob with the appropriate LobType"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:441
+#, no-c-format
+msgid "Mapping identifier properties"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:443
+#, no-c-format
+msgid ""
+"The <literal>@Id</literal> annotation lets you define which property is
the "
+"identifier of your entity bean. This property can be set by the application "
+"itself or be generated by Hibernate (preferred). You can define the "
+"identifier generation strategy thanks to the
<literal>@GeneratedValue</"
+"literal> annotation:"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:451
+#, no-c-format
+msgid ""
+"AUTO - either identity column, sequence or table depending on the underlying
"
+"DB"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:457
+#, no-c-format
+msgid "TABLE - table holding the id"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:463
+#, no-c-format
+msgid "IDENTITY - identity column"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:469
+#, no-c-format
+msgid "SEQUENCE - sequence"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:475
+#, no-c-format
+msgid ""
+"Hibernate provides more id generators than the basic EJB3 ones. Check <xref
"
+"linkend=\"entity-hibspec\"/> for more informations."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:478
+#, no-c-format
+msgid ""
+"The following example shows a sequence generator using the SEQ_STORE "
+"configuration (see below)"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:481
+#, no-c-format
+msgid ""
+"@Id @GeneratedValue(strategy=GenerationType.SEQUENCE,
generator=\"SEQ_STORE"
+"\")\n"
+"public Integer getId() { ... }"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:483
+#, no-c-format
+msgid "The next example uses the identity generator:"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:485
+#, no-c-format
+msgid ""
+"@Id @GeneratedValue(strategy=GenerationType.IDENTITY)\n"
+"public Long getId() { ... }"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:487
+#, no-c-format
+msgid ""
+"The <literal>AUTO</literal> generator is the preferred type for
portable "
+"applications (across several DB vendors). The identifier generation "
+"configuration can be shared for several <literal>@Id</literal> mappings
with "
+"the generator attribute. There are several configurations available through "
+"<literal>@SequenceGenerator</literal> and
<literal>@TableGenerator</"
+"literal>. The scope of a generator can be the application or the class. "
+"Class-defined generators are not visible outside the class and can override "
+"application level generators. Application level generators are defined at "
+"XML level (see <xref linkend=\"xml-overriding\"/>):"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:499
+#, no-c-format
+msgid ""
+"<table-generator name=\"EMP_GEN\"\n"
+" table=\"GENERATOR_TABLE\"\n"
+" pk-column-name=\"key\"\n"
+" value-column-name=\"hi\"\n"
+" pk-column-value=\"EMP\"\n"
+" allocation-size=\"20\"/>\n"
+"\n"
+"//and the annotation equivalent\n"
+"\n"
+"(a)javax.persistence.TableGenerator(\n"
+" name=\"EMP_GEN\",\n"
+" table=\"GENERATOR_TABLE\",\n"
+" pkColumnName = \"key\",\n"
+" valueColumnName = \"hi\"\n"
+" pkColumnValue=\"EMP\",\n"
+" allocationSize=20\n"
+")\n"
+"\n"
+"<sequence-generator name=\"SEQ_GEN\" \n"
+" sequence-name=\"my_sequence\"\n"
+" allocation-size=\"20\"/>\n"
+"\n"
+"//and the annotation equivalent\n"
+"\n"
+"(a)javax.persistence.SequenceGenerator(\n"
+" name=\"SEQ_GEN\",\n"
+" sequenceName=\"my_sequence\",\n"
+" allocationSize=20\n"
+")"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:501
+#, no-c-format
+msgid ""
+"If JPA XML (like <filename>META-INF/orm.xml</filename>) is used to
define "
+"thegenerators, <literal>EMP_GEN</literal> and
<literal>SEQ_GEN</literal> are "
+"application level generators. <literal>EMP_GEN</literal> defines a
table "
+"based id generator using the hilo algorithm with a
<literal>max_lo</literal> "
+"of 20. The hi value is kept in a <literal>table</literal> "
+"\"<literal>GENERATOR_TABLE</literal>\". The information is
kept in a row "
+"where <literal>pkColumnName</literal> \"key\" is equals to
"
+"<literal>pkColumnValue</literal>
\"<literal>EMP</literal>\" and column "
+"<literal>valueColumnName</literal>
\"<literal>hi</literal>\" contains the "
+"the next high value used."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:512
+#, no-c-format
+msgid ""
+"<literal>SEQ_GEN</literal> defines a sequence generator using a
sequence "
+"named <literal>my_sequence</literal>. The allocation size used for this
"
+"sequence based hilo algorithm is 20. Note that this version of Hibernate "
+"Annotations does not handle <literal>initialValue</literal> in the
sequence "
+"generator. The default allocation size is 50, so if you want to use a "
+"sequence and pickup the value each time, you must set the allocation size to
"
+"1."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:521
+#, no-c-format
+msgid ""
+"Package level definition is no longer supported by the EJB 3.0 "
+"specification. However, you can use the
<literal>@GenericGenerator</literal> "
+"at the package level (see <xref
linkend=\"entity-hibspec-identifier\"/>)."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:527
+#, no-c-format
+msgid ""
+"The next example shows the definition of a sequence generator in a class "
+"scope:"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:530
+#, no-c-format
+msgid ""
+"@Entity\n"
+"(a)javax.persistence.SequenceGenerator(\n"
+" name=\"SEQ_STORE\",\n"
+" sequenceName=\"my_sequence\"\n"
+")\n"
+"public class Store implements Serializable {\n"
+" private Long id;\n"
+"\n"
+" @Id @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="
+"\"SEQ_STORE\")\n"
+" public Long getId() { return id; }\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:532
+#, no-c-format
+msgid ""
+"This class will use a sequence named my_sequence and the SEQ_STORE generator
"
+"is not visible in other classes. Note that you can check the Hibernate "
+"Annotations tests in the
<package>org.hibernate.test.annotations.id</"
+"package> package for more examples."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:538
+#, no-c-format
+msgid "You can define a composite primary key through several syntaxes:"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:543
+#, no-c-format
+msgid ""
+"annotate the component property as @Id and make the component class "
+"@Embeddable"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:549
+#, no-c-format
+msgid "annotate the component property as @EmbeddedId"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:555
+#, no-c-format
+msgid ""
+"annotate the class as @IdClass and annotate each property of the entity "
+"involved in the primary key with @Id"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:561
+#, no-c-format
+msgid ""
+"While quite common to the EJB2 developer, <literal>@IdClass</literal>
is "
+"likely new for Hibernate users. The composite primary key class corresponds "
+"to multiple fields or properties of the entity class, and the names of "
+"primary key fields or properties in the primary key class and those of the "
+"entity class must match and their types must be the same. Let's look at an
"
+"example:"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:568
+#, no-c-format
+msgid ""
+"@Entity\n"
+"<emphasis
role=\"bold\">(a)IdClass(FootballerPk.class)</emphasis>\n"
+"public class Footballer {\n"
+" //part of the id key\n"
+" <emphasis role=\"bold\">@Id</emphasis> public String
getFirstname() {\n"
+" return firstname;\n"
+" }\n"
+"\n"
+" public void setFirstname(String firstname) {\n"
+" this.firstname = firstname;\n"
+" }\n"
+"\n"
+" //part of the id key\n"
+" <emphasis role=\"bold\">@Id</emphasis> public String
getLastname() {\n"
+" return lastname;\n"
+" }\n"
+"\n"
+" public void setLastname(String lastname) {\n"
+" this.lastname = lastname;\n"
+" }\n"
+"\n"
+" public String getClub() {\n"
+" return club;\n"
+" }\n"
+"\n"
+" public void setClub(String club) {\n"
+" this.club = club;\n"
+" }\n"
+"\n"
+" //appropriate equals() and hashCode() implementation\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"public class FootballerPk implements Serializable {\n"
+" //same name and type as in Footballer\n"
+" public String getFirstname() {\n"
+" return firstname;\n"
+" }\n"
+"\n"
+" public void setFirstname(String firstname) {\n"
+" this.firstname = firstname;\n"
+" }\n"
+"\n"
+" //same name and type as in Footballer\n"
+" public String getLastname() {\n"
+" return lastname;\n"
+" }\n"
+"\n"
+" public void setLastname(String lastname) {\n"
+" this.lastname = lastname;\n"
+" }\n"
+"\n"
+" //appropriate equals() and hashCode() implementation\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:570
+#, no-c-format
+msgid ""
+"As you may have seen, <literal>@IdClass</literal> points to the "
+"corresponding primary key class."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:573
+#, no-c-format
+msgid ""
+"While not supported by the EJB3 specification, Hibernate allows you to "
+"define associations inside a composite identifier. Simply use the regular "
+"annotations for that"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:577
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@AssociationOverride( name=\"id.channel\", joinColumns =
@JoinColumn(name="
+"\"chan_id\") )\n"
+"public class TvMagazin {\n"
+" @EmbeddedId public TvMagazinPk id;\n"
+" @Temporal(TemporalType.TIME) Date time;\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"public class TvMagazinPk implements Serializable {\n"
+" @ManyToOne\n"
+" public Channel channel;\n"
+" public String name;\n"
+" @ManyToOne\n"
+" public Presenter presenter;\n"
+"}"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:581
+#, no-c-format
+msgid "Mapping inheritance"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:583
+#, no-c-format
+msgid "EJB3 supports the three types of inheritance:"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:587
+#, no-c-format
+msgid "Table per Class Strategy: the <union-class> element in
Hibernate"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:593
+#, no-c-format
+msgid ""
+"Single Table per Class Hierarchy Strategy: the <subclass> element in
"
+"Hibernate"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:599
+#, no-c-format
+msgid ""
+"Joined Subclass Strategy: the <joined-subclass> element in
Hibernate"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:604
+#, no-c-format
+msgid ""
+"The chosen strategy is declared at the class level of the top level entity "
+"in the hierarchy using the <literal>@Inheritance</literal>
annotation."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:609
+#, no-c-format
+msgid "Annotating interfaces is currently not supported."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:613
+#, no-c-format
+msgid "Table per class"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:615
+#, no-c-format
+msgid ""
+"This strategy has many drawbacks (esp. with polymorphic queries and "
+"associations) explained in the EJB3 spec, the Hibernate reference "
+"documentation, Hibernate in Action, and many other places. Hibernate work "
+"around most of them implementing this strategy using <literal>SQL
UNION</"
+"literal> queries. It is commonly used for the top level of an inheritance
"
+"hierarchy:"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:622
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)\n"
+"public class Flight implements Serializable {"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:624
+#, no-c-format
+msgid ""
+"This strategy support one to many associations provided that they are "
+"bidirectional. This strategy does not support the
<literal>IDENTITY</"
+"literal> generator strategy: the id has to be shared across several tables.
"
+"Consequently, when using this strategy, you should not use <literal>AUTO
</"
+"literal>nor <literal>IDENTITY</literal>."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:633
+#, no-c-format
+msgid "Single table per class hierarchy"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:635
+#, no-c-format
+msgid ""
+"All properties of all super- and subclasses are mapped into the same table, "
+"instances are distinguished by a special discriminator column:"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:639
+#, no-c-format
+msgid ""
+"@Entity\n"
+"(a)Inheritance(strategy=InheritanceType.SINGLE_TABLE)\n"
+"@DiscriminatorColumn(\n"
+" name=\"planetype\",\n"
+" discriminatorType=DiscriminatorType.STRING\n"
+")\n"
+"@DiscriminatorValue(\"Plane\")\n"
+"public class Plane { ... }\n"
+"\n"
+"@Entity\n"
+"@DiscriminatorValue(\"A320\")\n"
+"public class A320 extends Plane { ... }"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:641
+#, no-c-format
+msgid ""
+"<classname>Plane</classname> is the superclass, it defines the
inheritance "
+"strategy <literal>InheritanceType.SINGLE_TABLE</literal>. It also
defines "
+"the discriminator column through the
<literal>@DiscriminatorColumn</literal> "
+"annotation, a discriminator column can also define the discriminator type. "
+"Finally, the <literal>@DiscriminatorValue</literal> annotation defines
the "
+"value used to differentiate a class in the hierarchy. All of these "
+"attributes have sensible default values. The default name of the "
+"discriminator column is <literal>DTYPE</literal>. The default
discriminator "
+"value is the entity name (as defined in
<literal>(a)Entity.name</literal>) for "
+"DiscriminatorType.STRING. <classname>A320</classname> is a subclass;
you "
+"only have to define discriminator value if you don't want to use the default
"
+"value. The strategy and the discriminator type are implicit."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:656
+#, no-c-format
+msgid ""
+"<literal>@Inheritance</literal> and
<literal>@DiscriminatorColumn</literal> "
+"should only be defined at the top of the entity hierarchy."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:662
+#, no-c-format
+msgid "Joined subclasses"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:664
+#, no-c-format
+msgid ""
+"The<literal> @PrimaryKeyJoinColumn</literal> and "
+"<literal>@PrimaryKeyJoinColumns</literal> annotations define the
primary key"
+"(s) of the joined subclass table:"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:668
+#, no-c-format
+msgid ""
+"@Entity\n"
+"(a)Inheritance(strategy=InheritanceType.JOINED)\n"
+"public class Boat implements Serializable { ... }\n"
+"\n"
+"@Entity\n"
+"public class Ferry extends Boat { ... }\n"
+"\n"
+"@Entity\n"
+"@PrimaryKeyJoinColumn(name=\"BOAT_ID\")\n"
+"public class AmericaCupClass extends Boat { ... }"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:670
+#, no-c-format
+msgid ""
+"All of the above entities use the <literal>JOINED</literal> strategy,
the "
+"<literal>Ferry</literal> table is joined with the
<literal>Boat</literal> "
+"table using the same primary key names. The
<literal>AmericaCupClass</"
+"literal> table is joined with <literal>Boat</literal> using the join
"
+"condition <code>Boat.id = AmericaCupClass.BOAT_ID</code>."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:679
+#, no-c-format
+msgid "Inherit properties from superclasses"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:681
+#, no-c-format
+msgid ""
+"This is sometimes useful to share common properties through a technical or a
"
+"business superclass without including it as a regular mapped entity (ie no "
+"specific table for this entity). For that purpose you can map them as "
+"<literal>(a)MappedSuperclass</literal>."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:686
+#, no-c-format
+msgid ""
+"@MappedSuperclass\n"
+"public class BaseEntity {\n"
+" @Basic\n"
+" @Temporal(TemporalType.TIMESTAMP)\n"
+" public Date getLastUpdate() { ... }\n"
+" public String getLastUpdater() { ... }\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity class Order extends BaseEntity {\n"
+" @Id public Integer getId() { ... }\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:688
+#, no-c-format
+msgid ""
+"In database, this hierarchy will be represented as an
<literal>Order</"
+"literal> table having the <literal>id</literal>,
<literal>lastUpdate</"
+"literal> and <literal>lastUpdater</literal> columns. The embedded
superclass "
+"property mappings are copied into their entity subclasses. Remember that the
"
+"embeddable superclass is not the root of the hierarchy though."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:696
+#, no-c-format
+msgid ""
+"Properties from superclasses not mapped as
<literal>@MappedSuperclass</"
+"literal> are ignored."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:701
+#, no-c-format
+msgid ""
+"The access type (field or methods), is inherited from the root entity, "
+"unless you use the Hibernate annotation
<literal>@AccessType</literal>"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:707
+#, no-c-format
+msgid ""
+"The same notion can be applied to <literal>@Embeddable</literal>
objects to "
+"persist properties from their superclasses. You also need to use "
+"<literal>@MappedSuperclass</literal> to do that (this should not be
"
+"considered as a standard EJB3 feature though)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:715
+#, no-c-format
+msgid ""
+"It is allowed to mark a class as <literal>@MappedSuperclass</literal>
in the "
+"middle of the mapped inheritance hierarchy."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:721
+#, no-c-format
+msgid ""
+"Any class in the hierarchy non annotated with
<literal>@MappedSuperclass</"
+"literal> nor <literal>@Entity</literal> will be ignored."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:726
+#, no-c-format
+msgid ""
+"You can override columns defined in entity superclasses at the root entity "
+"level using the <literal>@AttributeOverride</literal>
annotation."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:730
+#, no-c-format
+msgid ""
+"@MappedSuperclass\n"
+"public class FlyingObject implements Serializable {\n"
+"\n"
+" public int getAltitude() {\n"
+" return altitude;\n"
+" }\n"
+"\n"
+" @Transient\n"
+" public int getMetricAltitude() {\n"
+" return metricAltitude;\n"
+" }\n"
+"\n"
+" @ManyToOne\n"
+" public PropulsionType getPropulsion() {\n"
+" return metricAltitude;\n"
+" }\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"@AttributeOverride( name=\"altitude\", column =
@Column(name=\"fld_altitude"
+"\") )\n"
+"@AssociationOverride( name=\"propulsion\", joinColumns =
@JoinColumn(name="
+"\"fld_propulsion_fk\") )\n"
+"public class Plane extends FlyingObject {\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:732
+#, no-c-format
+msgid ""
+"The <literal>altitude</literal> property will be persisted in an
"
+"<literal>fld_altitude</literal> column of table
<literal>Plane</literal> and "
+"the propulsion association will be materialized in a "
+"<literal>fld_propulsion_fk</literal> foreign key column."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:738
+#, no-c-format
+msgid ""
+"You can define <literal>@AttributeOverride</literal>(s) and "
+"<literal>@AssociationOverride</literal>(s) on
<literal>@Entity</literal> "
+"classes, <literal>@MappedSuperclass</literal> classes and properties
"
+"pointing to an <literal>@Embeddable</literal> object."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:747
+#, no-c-format
+msgid "Mapping entity bean associations/relationships"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:750
+#, no-c-format
+msgid "One-to-one"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:752
+#, no-c-format
+msgid ""
+"You can associate entity beans through a one-to-one relationship using "
+"<literal>@OneToOne</literal>. There are three cases for one-to-one
"
+"associations: either the associated entities share the same primary keys "
+"values, a foreign key is held by one of the entities (note that this FK "
+"column in the database should be constrained unique to simulate one-to-one "
+"multiplicity), or a association table is used to store the link between the "
+"2 entities (a unique constraint has to be defined on each fk to ensure the "
+"one to one multiplicity)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:761
+#, no-c-format
+msgid "First, we map a real one-to-one association using shared primary keys:"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:764
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Body {\n"
+" @Id\n"
+" public Long getId() { return id; }\n"
+"\n"
+" @OneToOne(cascade = CascadeType.ALL)\n"
+" @PrimaryKeyJoinColumn\n"
+" public Heart getHeart() {\n"
+" return heart;\n"
+" }\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:766
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Heart {\n"
+" @Id\n"
+" public Long getId() { ...}\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:768
+#, no-c-format
+msgid ""
+"The one to one is marked as true by using the "
+"<literal>@PrimaryKeyJoinColumn</literal> annotation."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:771
+#, no-c-format
+msgid ""
+"In the following example, the associated entities are linked through a "
+"foreign key column:"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:774
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Customer implements Serializable {\n"
+" @OneToOne(cascade = CascadeType.ALL)\n"
+" <emphasis
role=\"bold\">@JoinColumn(name=\"passport_fk\")</emphasis>\n"
+" public Passport getPassport() {\n"
+" ...\n"
+" }\n"
+"\n"
+"@Entity\n"
+"public class Passport implements Serializable {\n"
+" @OneToOne(<emphasis role=\"bold\">mappedBy =
\"passport\"</emphasis>)\n"
+" public Customer getOwner() {\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:776
+#, no-c-format
+msgid ""
+"A <classname>Customer</classname> is linked to a
<classname>Passport</"
+"classname>, with a foreign key column named
<literal>passport_fk</literal> "
+"in the <literal>Customer</literal> table. The join column is declared
with "
+"the <literal>@JoinColumn</literal> annotation which looks like the
"
+"<literal>@Column</literal> annotation. It has one more parameters named
"
+"<literal>referencedColumnName</literal>. This parameter declares the
column "
+"in the targeted entity that will be used to the join. Note that when using "
+"<literal><literal>referencedColumnName</literal></literal>
to a non primary "
+"key column, the associated class has to be
<classname>Serializable</"
+"classname>. Also note that the
<literal><literal>referencedColumnName</"
+"literal></literal> to a non primary key column has to be mapped to a
"
+"property having a single column (other cases might not work)."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:792
+#, no-c-format
+msgid ""
+"The association may be bidirectional. In a bidirectional relationship, one "
+"of the sides (and only one) has to be the owner: the owner is responsible "
+"for the association column(s) update. To declare a side as
<emphasis>not</"
+"emphasis> responsible for the relationship, the attribute
<literal>mappedBy</"
+"literal> is used. <literal>mappedBy</literal> refers to the property
name of "
+"the association on the owner side. In our case, this is
<literal>passport</"
+"literal>. As you can see, you don't have to (must not) declare the join
"
+"column since it has already been declared on the owners side."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:803
+#, no-c-format
+msgid ""
+"If no <literal>@JoinColumn</literal> is declared on the owner side, the
"
+"defaults apply. A join column(s) will be created in the owner table and its "
+"name will be the concatenation of the name of the relationship in the owner "
+"side, <keycap>_</keycap> (underscore), and the name of the primary key
column"
+"(s) in the owned side. In this example <literal>passport_id</literal>
"
+"because the property name is <literal>passport</literal> and the column
id "
+"of <literal>Passport </literal>is
<literal>id</literal>."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:812
+#, no-c-format
+msgid "The third possibility (using an association table) is very exotic."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:815
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Customer implements Serializable {\n"
+" @OneToOne(cascade = CascadeType.ALL)\n"
+" <emphasis role=\"bold\">@JoinTable(name =
\"CustomerPassports\",\n"
+" joinColumns = @JoinColumn(name=\"customer_fk\"),\n"
+" inverseJoinColumns =
@JoinColumn(name=\"passport_fk\")</emphasis>\n"
+" )\n"
+" public Passport getPassport() {\n"
+" ...\n"
+" }\n"
+"\n"
+"@Entity\n"
+"public class Passport implements Serializable {\n"
+" @OneToOne(<emphasis role=\"bold\">mappedBy =
\"passport\"</emphasis>)\n"
+" public Customer getOwner() {\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:817
+#, no-c-format
+msgid ""
+"A <classname>Customer</classname> is linked to a
<classname>Passport</"
+"classname> through a association table named
<literal>CustomerPassports</"
+"literal> ; this association table has a foreign key column named "
+"<literal>passport_fk</literal> pointing to the
<literal>Passport</literal> "
+"table (materialized by the <literal>inverseJoinColumn</literal>, and a
"
+"foreign key column named <literal>customer_fk</literal> pointing to the
"
+"<literal>Customer</literal> table materialized by the
<literal>joinColumns</"
+"literal> attribute."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:827
+#, no-c-format
+msgid ""
+"You must declare the join table name and the join columns explicitly in such
"
+"a mapping."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:832
+#, no-c-format
+msgid "Many-to-one"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:834
+#, no-c-format
+msgid ""
+"Many-to-one associations are declared at the property level with the "
+"annotation <literal>@ManyToOne</literal>:"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:837
+#, no-c-format
+msgid ""
+"@Entity()\n"
+"public class Flight implements Serializable {\n"
+" <emphasis role=\"bold\">@ManyToOne</emphasis>( cascade =
{CascadeType."
+"PERSIST, CascadeType.MERGE} )\n"
+" @JoinColumn(name=\"COMP_ID\")\n"
+" public Company getCompany() {\n"
+" return company;\n"
+" }\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:839
+#, no-c-format
+msgid ""
+"The <literal>@JoinColumn</literal> attribute is optional, the default
value"
+"(s) is like in one to one, the concatenation of the name of the relationship
"
+"in the owner side, <keycap>_</keycap> (underscore), and the name of the
"
+"primary key column in the owned side. In this example
<literal>company_id</"
+"literal> because the property name is <literal>company</literal> and
the "
+"column id of Company is <literal>id</literal>."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:847
+#, no-c-format
+msgid ""
+"<literal>@ManyToOne</literal> has a parameter named
<literal>targetEntity</"
+"literal> which describes the target entity name. You usually don't need this
"
+"parameter since the default value (the type of the property that stores the "
+"association) is good in almost all cases. However this is useful when you "
+"want to use interfaces as the return type instead of the regular entity."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:854
+#, no-c-format
+msgid ""
+"@Entity()\n"
+"public class Flight implements Serializable {\n"
+" @ManyToOne( cascade = {CascadeType.PERSIST, CascadeType.MERGE}, "
+"<emphasis\n"
+"
role=\"bold\">targetEntity=CompanyImpl.class</emphasis> )\n"
+" @JoinColumn(name=\"COMP_ID\")\n"
+" public Company getCompany() {\n"
+" return company;\n"
+" }\n"
+" ...\n"
+"}\n"
+"\n"
+"public interface Company {\n"
+" ..."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:856
+#, no-c-format
+msgid ""
+"You can alse map a many to one association through an association table. "
+"This association table described by the <literal>@JoinTable</literal>
"
+"annotation will contains a foreign key referencing back the entity table "
+"(through <literal>(a)JoinTable.joinColumns</literal>) and a a foreign key
"
+"referencing the target entity table (through <literal>(a)JoinTable."
+"inverseJoinColumns</literal>)."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:864
+#, no-c-format
+msgid ""
+"@Entity()\n"
+"public class Flight implements Serializable {\n"
+" @ManyToOne( cascade = {CascadeType.PERSIST, CascadeType.MERGE} )\n"
+" <emphasis
role=\"bold\">@JoinTable(name=\"Flight_Company\",\n"
+" joinColumns = @JoinColumn(name=\"FLIGHT_ID\"),\n"
+" inverseJoinColumns = @JoinColumn(name=\"COMP_ID\")\n"
+" )</emphasis>\n"
+" public Company getCompany() {\n"
+" return company;\n"
+" }\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:868
+#, no-c-format
+msgid "Collections"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:872
+#, no-c-format
+msgid "Overview"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:874
+#, no-c-format
+msgid ""
+"You can map <classname>Collection</classname>,
<literal>List</literal> (ie "
+"ordered lists, not indexed lists), <literal>Map</literal> and "
+"<classname>Set</classname>. The EJB3 specification describes how to map
an "
+"ordered list (ie a list ordered at load time) using <literal>(a)javax."
+"persistence.OrderBy</literal> annotation: this annotation takes into "
+"parameter a list of comma separated (target entity) properties to order the "
+"collection by (eg <code>firstname asc, age desc</code>), if the string
is "
+"empty, the collection will be ordered by id. For true indexed collections, "
+"please refer to the <xref linkend=\"entity-hibspec\"/>. EJB3 allows
you to "
+"map Maps using as a key one of the target entity property using "
+"<literal>@MapKey(name=\"myProperty\")</literal> (myProperty
is a property "
+"name in the target entity). When using <literal>@MapKey</literal>
(without "
+"property name), the target entity primary key is used. The map key uses the "
+"same column as the property pointed out: there is no additional column "
+"defined to hold the map key, and it does make sense since the map key "
+"actually represent a target property. Be aware that once loaded, the key is "
+"no longer kept in sync with the property, in other words, if you change the "
+"property value, the key will not change automatically in your Java model "
+"(for true map support please refers to <xref
linkend=\"entity-hibspec\"/>). "
+"Many people confuse <literal><map></literal> capabilities
and "
+"<literal>@MapKey</literal> ones. These are two different features.
"
+"<literal>@MapKey</literal> still has some limitations, please check the
"
+"forum or the JIRA tracking system for more informations."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:902
+#, no-c-format
+msgid "Hibernate has several notions of collections."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:907
+#, no-c-format
+msgid "Collections semantics"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:918
+#, no-c-format
+msgid "Semantic"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:920
+#, no-c-format
+msgid "java representation"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:922
+#, no-c-format
+msgid "annotations"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:928
+#, no-c-format
+msgid "Bag semantic"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:930
+#, no-c-format
+msgid "<para>java.util.List</para>"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:930
+#, no-c-format
+msgid "java.util.Collection"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:932
+#, no-c-format
+msgid "(a)org.hibernate.annotations.CollectionOfElements"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:932
+#, no-c-format
+msgid "or @OneToMany"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:932
+#, no-c-format
+msgid "or @ManyToMany"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:936
+#, no-c-format
+msgid ""
+"Bag semantic with primary key (withtout the limitations of Bag semantic)"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:939
+#, no-c-format
+msgid "java.util.List, java.util.Collection"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:941
+#, no-c-format
+msgid ""
+"((a)org.hibernate.annotations.CollectionOfElements or @OneToMany or "
+"@ManyToMany) and @CollectionId"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:946
+#, no-c-format
+msgid "List semantic"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:948
+#, no-c-format
+msgid "<entry>java.util.List</entry>"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:950
+#, no-c-format
+msgid ""
+"((a)org.hibernate.annotations.CollectionOfElements or @OneToMany or "
+"@ManyToMany) and @org.hibernate.annotations.IndexColumn"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:956
+#, no-c-format
+msgid "Set semantic"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:958
+#, no-c-format
+msgid "java.util.Set"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:960
+#, no-c-format
+msgid ""
+"(a)org.hibernate.annotations.CollectionOfElements or @OneToMany or @ManyToMany"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:965
+#, no-c-format
+msgid "Map semantic"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:967
+#, no-c-format
+msgid "java.util.Map"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:969
+#, no-c-format
+msgid ""
+"((a)org.hibernate.annotations.CollectionOfElements or @OneToMany or "
+"@ManyToMany) and (nothing or @org.hibernate.annotations.MapKey/"
+"MapKeyManyToMany for true map support, OR @javax.persistence.MapKey"
+msgstr ""
+
+#. Tag: remark
+#: entity.xml:978
+#, no-c-format
+msgid ""
+"So specifically, java.util.List collections without @org.hibernate."
+"annotations.IndexColumn are going to be considered as bags."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:982
+#, no-c-format
+msgid ""
+"Collection of primitive, core type or embedded objects is not supported by "
+"the EJB3 specification. Hibernate Annotations allows them however (see <xref
"
+"linkend=\"entity-hibspec\"/>)."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:986
+#, no-c-format
+msgid ""
+"@Entity public class City {\n"
+" @OneToMany(mappedBy=\"city\")\n"
+" <emphasis
role=\"bold\">@OrderBy(\"streetName\")</emphasis>\n"
+" public List<Street> getStreets() {\n"
+" return streets;\n"
+" }\n"
+"...\n"
+"}\n"
+"\n"
+"@Entity public class Street {\n"
+" <emphasis role=\"bold\">public String
getStreetName()</emphasis> {\n"
+" return streetName;\n"
+" }\n"
+"\n"
+" @ManyToOne\n"
+" public City getCity() {\n"
+" return city;\n"
+" }\n"
+" ...\n"
+"}\n"
+"\n"
+"\n"
+"@Entity\n"
+"public class Software {\n"
+" @OneToMany(mappedBy=\"software\")\n"
+" <emphasis
role=\"bold\">@MapKey(name=\"codeName\")</emphasis>\n"
+" public Map<String, Version> getVersions() {\n"
+" return versions;\n"
+" }\n"
+"...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"@Table(name=\"tbl_version\")\n"
+"public class Version {\n"
+" <emphasis role=\"bold\">public String
getCodeName()</emphasis> {...}\n"
+"\n"
+" @ManyToOne\n"
+" public Software getSoftware() { ... }\n"
+"...\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:988
+#, no-c-format
+msgid ""
+"So <literal>City</literal> has a collection of
<literal>Street</literal>s "
+"that are ordered by <literal>streetName</literal> (of
<literal>Street</"
+"literal>) when the collection is loaded. <literal>Software</literal>
has a "
+"map of <literal>Version</literal>s which key is the
<literal>Version</"
+"literal> <literal>codeName</literal>."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:995
+#, no-c-format
+msgid ""
+"Unless the collection is a generic, you will have to define "
+"<literal>targetEntity</literal>. This is a annotation attribute that
take "
+"the target entity class as a value."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1002
+#, no-c-format
+msgid "One-to-many"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1004
+#, no-c-format
+msgid ""
+"One-to-many associations are declared at the property level with the "
+"annotation <literal>@OneToMany</literal>. One to many associations may
be "
+"bidirectional."
+msgstr ""
+
+#. Tag: sect4
+#: entity.xml:1006
+#, no-c-format
+msgid ""
+"<sect5> <title>Bidirectional</title> <para>Since many to
one are (almost) "
+"always the owner side of a bidirectional relationship in the EJB3 spec, the "
+"one to many association is annotated by <literal>@OneToMany( mappedBy=...
)</"
+"literal></para> <programlisting>@Entity\n"
+"public class Troop {\n"
+" @OneToMany(mappedBy=\"troop\")\n"
+" public Set<Soldier> getSoldiers() {\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Soldier {\n"
+" @ManyToOne\n"
+" @JoinColumn(name=\"troop_fk\")\n"
+" public Troop getTroop() {\n"
+" ...\n"
+"} </programlisting>
<para><classname>Troop</classname> has a "
+"bidirectional one to many relationship with <literal>Soldier</literal>
"
+"through the <literal>troop</literal> property. You don't have to
(must not) "
+"define any physical mapping in the <literal>mappedBy</literal>
side.</para> "
+"<para>To map a bidirectional one to many, with the one-to-many side as the
"
+"owning side, you have to remove the <literal>mappedBy</literal> element
and "
+"set the many to one <literal>@JoinColumn</literal> as insertable and
"
+"updatable to false. This solution is obviously not optimized and will "
+"produce some additional UPDATE statements.</para>
<programlisting>@Entity\n"
+"public class Troop {\n"
+" @OneToMany\n"
+" @JoinColumn(name=\"troop_fk\") //we need to duplicate the physical
"
+"information\n"
+" public Set<Soldier> getSoldiers() {\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Soldier {\n"
+" @ManyToOne\n"
+" @JoinColumn(name=\"troop_fk\", insertable=false,
updatable=false)\n"
+" public Troop getTroop() {\n"
+" ...\n"
+"}</programlisting> </sect5> <sect5>
<title>Unidirectional</title> <para>A "
+"unidirectional one to many using a foreign key column in the owned entity is
"
+"not that common and not really recommended. We strongly advise you to use a "
+"join table for this kind of association (as explained in the next section). "
+"This kind of association is described through a
<literal>@JoinColumn</"
+"literal></para> <programlisting>\n"
+"@Entity\n"
+"public class Customer implements Serializable {\n"
+" @OneToMany(cascade=CascadeType.ALL, fetch=FetchType.EAGER)\n"
+" @JoinColumn(name=\"CUST_ID\")\n"
+" public Set<Ticket> getTickets() {\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Ticket implements Serializable {\n"
+" ... //no bidir\n"
+"}\n"
+" </programlisting>
<para><literal>Customer</literal> describes "
+"a unidirectional relationship with <literal>Ticket</literal> using the
join "
+"column <literal>CUST_ID</literal>.</para> </sect5>
<sect5> "
+"<title>Unidirectional with join table</title> <para>A
unidirectional one to "
+"many with join table is much preferred. This association is described "
+"through an <literal>(a)JoinTable</literal>.</para>
<programlisting>\n"
+"@Entity\n"
+"public class Trainer {\n"
+" @OneToMany\n"
+" @JoinTable(\n"
+" name=\"TrainedMonkeys\",\n"
+" joinColumns = @JoinColumn( name=\"trainer_id\"),\n"
+" inverseJoinColumns = @JoinColumn(
name=\"monkey_id\")\n"
+" )\n"
+" public Set<Monkey> getTrainedMonkeys() {\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Monkey {\n"
+" ... //no bidir\n"
+"}\n"
+" </programlisting>
<para><literal>Trainer</literal> describes "
+"a unidirectional relationship with <classname>Monkey</classname> using
the "
+"join table <classname>TrainedMonkeys</classname>, with a foreign key
"
+"<literal>trainer_id</literal> to <literal>Trainer</literal>
"
+"(<literal>joinColumns</literal>) and a foreign key
<literal>monkey_id</"
+"literal> to <literal>Monkey</literal>
(<literal>inversejoinColumns</"
+"literal>).</para> </sect5> <sect5
id=\"entity-mapping-association-collection-"
+"manytomany-default\" revision=\"1\">
<title>Defaults</title> <para>Without "
+"describing any physical mapping, a unidirectional one to many with join "
+"table is used. The table name is the concatenation of the owner table name, "
+"<keycap>_</keycap>, and the other side table name. The foreign key
name(s) "
+"referencing the owner table is the concatenation of the owner table, "
+"<keycap>_</keycap>, and the owner primary key column(s) name. The
foreign "
+"key name(s) referencing the other side is the concatenation of the owner "
+"property name, <keycap>_</keycap>, and the other side primary key
column(s) "
+"name. A unique constraint is added to the foreign key referencing the other "
+"side table to reflect the one to many.</para> <programlisting>\n"
+"@Entity\n"
+"public class Trainer {\n"
+" @OneToMany\n"
+" public Set<Tiger> getTrainedTigers() {\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Tiger {\n"
+" ... //no bidir\n"
+"}\n"
+" </programlisting>
<para><classname>Trainer</classname> "
+"describes a unidirectional relationship with
<classname>Tiger</classname> "
+"using the join table <literal>Trainer_Tiger</literal>, with a foreign
key "
+"<literal>trainer_id</literal> to <literal>Trainer</literal>
(table name, "
+"<keycap>_</keycap>, trainer id) and a foreign key
<literal>trainedTigers_id</"
+"literal> to <literal>Monkey</literal> (property name,
<keycap>_</keycap>, "
+"Tiger primary column).</para> </sect5>"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1099
+#, no-c-format
+msgid "Many-to-many"
+msgstr ""
+
+#. Tag: sect4
+#: entity.xml:1099
+#, no-c-format
+msgid ""
+"<sect5> <title>Definition</title> <para>A many-to-many
association is "
+"defined logically using the <literal>@ManyToMany</literal> annotation.
You "
+"also have to describe the association table and the join conditions using "
+"the <literal>@JoinTable</literal> annotation. If the association is
"
+"bidirectional, one side has to be the owner and one side has to be the "
+"inverse end (ie. it will be ignored when updating the relationship values in
"
+"the association table):</para> <programlisting>\n"
+"@Entity\n"
+"public class Employer implements Serializable {\n"
+" @ManyToMany(\n"
+"
targetEntity=org.hibernate.test.metadata.manytomany.Employee.class,\n"
+" cascade={CascadeType.PERSIST, CascadeType.MERGE}\n"
+" )\n"
+" @JoinTable(\n"
+" name=\"EMPLOYER_EMPLOYEE\",\n"
+" joinColumns=@JoinColumn(name=\"EMPER_ID\"),\n"
+" inverseJoinColumns=@JoinColumn(name=\"EMPEE_ID\")\n"
+" )\n"
+" public Collection getEmployees() {\n"
+" return employees;\n"
+" }\n"
+" ...\n"
+"}\n"
+" </programlisting> <programlisting>\n"
+"@Entity\n"
+"public class Employee implements Serializable {\n"
+" @ManyToMany(\n"
+" cascade = {CascadeType.PERSIST, CascadeType.MERGE},\n"
+" mappedBy = \"employees\",\n"
+" targetEntity = Employer.class\n"
+" )\n"
+" public Collection getEmployers() {\n"
+" return employers;\n"
+" }\n"
+"}\n"
+" </programlisting> <para>We've already shown the many
"
+"declarations and the detailed attributes for associations. We'll go deeper
"
+"in the <literal>@JoinTable</literal> description, it defines a "
+"<literal>name</literal>, an array of join columns (an array in
annotation is "
+"defined using { A, B, C }), and an array of inverse join columns. The latter
"
+"ones are the columns of the association table which refer to the "
+"<classname>Employee</classname> primary key (the \"other
side\").</para> "
+"<para>As seen previously, the other side don't have to (must not)
describe "
+"the physical mapping: a simple <literal>mappedBy</literal> argument
"
+"containing the owner side property name bind the two.</para> </sect5>
"
+"<sect5> <title>Default values</title> <para>As any other
annotations, most "
+"values are guessed in a many to many relationship. Without describing any "
+"physical mapping in a unidirectional many to many the following rules "
+"applied. The table name is the concatenation of the owner table name, "
+"<keycap>_</keycap> and the other side table name. The foreign key
name(s) "
+"referencing the owner table is the concatenation of the owner table name, "
+"<keycap>_</keycap> and the owner primary key column(s). The foreign key
name"
+"(s) referencing the other side is the concatenation of the owner property "
+"name, <keycap>_</keycap>, and the other side primary key column(s).
These "
+"are the same rules used for a unidirectional one to many relationship.</"
+"para> <programlisting>\n"
+"@Entity\n"
+"public class Store {\n"
+" @ManyToMany(cascade = CascadeType.PERSIST)\n"
+" public Set<City> getImplantedIn() {\n"
+" ...\n"
+" }\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class City {\n"
+" ... //no bidirectional relationship\n"
+"}\n"
+" </programlisting> <para>A
<literal>Store_City</literal> is "
+"used as the join table. The <literal>Store_id</literal> column is a
foreign "
+"key to the <literal>Store</literal> table. The
<literal>implantedIn_id</"
+"literal> column is a foreign key to the <literal>City</literal>
table.</"
+"para> <para>Without describing any physical mapping in a bidirectional
many "
+"to many the following rules applied. The table name is the concatenation of "
+"the owner table name, <keycap>_</keycap> and the other side table name.
The "
+"foreign key name(s) referencing the owner table is the concatenation of the "
+"other side property name, <keycap>_</keycap>, and the owner primary key
"
+"column(s). The foreign key name(s) referencing the other side is the "
+"concatenation of the owner property name, <keycap>_</keycap>, and the
other "
+"side primary key column(s). These are the same rules used for a "
+"unidirectional one to many relationship.</para>
<programlisting>\n"
+"@Entity\n"
+"public class Store {\n"
+" @ManyToMany(cascade = {CascadeType.PERSIST, CascadeType.MERGE})\n"
+" public Set<Customer> getCustomers() {\n"
+" ...\n"
+" }\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Customer {\n"
+" @ManyToMany(mappedBy=\"customers\")\n"
+" public Set<Store> getStores() {\n"
+" ...\n"
+" }\n"
+"}\n"
+" </programlisting> <para>A
<literal>Store_Customer</literal> "
+"is used as the join table. The <literal>stores_id</literal> column is a
"
+"foreign key to the <literal>Store</literal> table. The "
+"<literal>customers_id</literal> column is a foreign key to the "
+"<literal>Customer</literal> table.</para> </sect5>"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1177
+#, no-c-format
+msgid "Transitive persistence with cascading"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1179
+#, no-c-format
+msgid ""
+"You probably have noticed the <literal>cascade</literal> attribute
taking an "
+"array of <classname>CascadeType</classname> as a value. The cascade
concept "
+"in EJB3 is very is similar to the transitive persistence and cascading of "
+"operations in Hibernate, but with slightly different semantics and cascading
"
+"types:"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1187
+#, no-c-format
+msgid ""
+"CascadeType.PERSIST: cascades the persist (create) operation to associated "
+"entities persist() is called or if the entity is managed"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1192
+#, no-c-format
+msgid ""
+"CascadeType.MERGE: cascades the merge operation to associated entities if "
+"merge() is called or if the entity is managed"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1197
+#, no-c-format
+msgid ""
+"CascadeType.REMOVE: cascades the remove operation to associated entities if "
+"delete() is called"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1202
+#, no-c-format
+msgid ""
+"CascadeType.REFRESH: cascades the refresh operation to associated entities "
+"if refresh() is called"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1207
+#, no-c-format
+msgid "CascadeType.ALL: all of the above"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1213
+#, no-c-format
+msgid ""
+"CascadeType.ALL also covers Hibernate specific operations like save-update, "
+"lock etc... Check <xref linkend=\"entity-hibspec-cascade\"/> for
more "
+"information"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1218
+#, no-c-format
+msgid ""
+"Please refer to the chapter 6.3 of the EJB3 specification for more "
+"information on cascading and create/merge semantics."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1223
+#, no-c-format
+msgid "Association fetching"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1225
+#, no-c-format
+msgid ""
+"You have the ability to either eagerly or lazily fetch associated entities. "
+"The <literal>fetch</literal> parameter can be set to
<literal>FetchType."
+"LAZY</literal> or <literal>FetchType.EAGER</literal>.
<literal>EAGER</"
+"literal> will try to use an outer join select to retrieve the associated "
+"object, while <literal>LAZY</literal> will only trigger a select when
the "
+"associated object is accessed for the first time.
<literal>@OneToMany</"
+"literal> and <literal>@ManyToMany</literal> associations are
defaulted to "
+"<literal>LAZY</literal> and <literal>@OneToOne</literal>
and "
+"<literal>@ManyToOne</literal> are defaulted to
<literal>EAGER</literal>. For "
+"more information about static fetching, check <xref
linkend=\"entity-hibspec-"
+"singleassoc-fetching\"/>."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1238
+#, no-c-format
+msgid ""
+"The recommanded approach is to use <literal>LAZY</literal> onn all
static "
+"fetching definitions and override this choice dynamically through JPA-QL. "
+"JPA-QL has a <literal>fetch</literal> keyword that allows you to
override "
+"laziness when doing a particular query. This is very useful to improve "
+"performance and is decided on a use case to use case basis."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1248
+#, no-c-format
+msgid "Mapping composite primary and foreign keys"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1250
+#, no-c-format
+msgid ""
+"Composite primary keys use a embedded class as the primary key "
+"representation, so you'd use the <literal>@Id</literal> and "
+"<literal>@Embeddable</literal> annotations. Alternatively, you can use
the "
+"<literal>@EmbeddedId</literal> annotation. Note that the dependent
class has "
+"to be serializable and implements
<methodname>equals()</methodname>/"
+"<methodname>hashCode()</methodname>. You can also use
<literal>@IdClass</"
+"literal> as described in <xref
linkend=\"entity-mapping-identifier\"/>."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1259
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class RegionalArticle implements Serializable {\n"
+"\n"
+" @Id\n"
+" public RegionalArticlePk getPk() { ... }\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"public class RegionalArticlePk implements Serializable { ... }"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1261
+#, no-c-format
+msgid "or alternatively"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1263
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class RegionalArticle implements Serializable {\n"
+"\n"
+" @EmbeddedId\n"
+" public RegionalArticlePk getPk() { ... }\n"
+"}\n"
+"\n"
+"public class RegionalArticlePk implements Serializable { ... }"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1265
+#, no-c-format
+msgid ""
+"<literal>@Embeddable</literal> inherit the access type of its owning
entity "
+"unless the Hibernate specific annotation <literal>@AccessType</literal>
is "
+"used. Composite foreign keys (if not using the default sensitive values) are
"
+"defined on associations using the <literal>@JoinColumns</literal>
element, "
+"which is basically an array of <literal>@JoinColumn</literal>. It is
"
+"considered a good practice to express
<literal>referencedColumnNames</"
+"literal> explicitly. Otherwise, Hibernate will suppose that you use the same
"
+"order of columns as in the primary key declaration."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1275
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Parent implements Serializable {\n"
+" @Id\n"
+" public ParentPk id;\n"
+" public int age;\n"
+"\n"
+" @OneToMany(cascade=CascadeType.ALL)\n"
+" @JoinColumns ({\n"
+" @JoinColumn(name=\"parentCivility\", referencedColumnName =
\"isMale"
+"\"),\n"
+" @JoinColumn(name=\"parentLastName\", referencedColumnName =
"
+"\"lastName\"),\n"
+" @JoinColumn(name=\"parentFirstName\", referencedColumnName =
"
+"\"firstName\")\n"
+" })\n"
+" public Set<Child> children; //unidirectional\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1277
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Child implements Serializable {\n"
+" @Id @GeneratedValue\n"
+" public Integer id;\n"
+"\n"
+" @ManyToOne\n"
+" @JoinColumns ({\n"
+" @JoinColumn(name=\"parentCivility\", referencedColumnName =
\"isMale"
+"\"),\n"
+" @JoinColumn(name=\"parentLastName\", referencedColumnName =
"
+"\"lastName\"),\n"
+" @JoinColumn(name=\"parentFirstName\", referencedColumnName =
"
+"\"firstName\")\n"
+" })\n"
+" public Parent parent; //unidirectional\n"
+"}"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1279
+#, no-c-format
+msgid ""
+"@Embeddable\n"
+"public class ParentPk implements Serializable {\n"
+" String firstName;\n"
+" String lastName;\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1281
+#, no-c-format
+msgid "Note the explicit usage of the
<literal>referencedColumnName</literal>."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1286
+#, no-c-format
+msgid "Mapping secondary tables"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1288
+#, no-c-format
+msgid ""
+"You can map a single entity bean to several tables using the "
+"<literal>@SecondaryTable</literal> or
<literal>@SecondaryTables</literal> "
+"class level annotations. To express that a column is in a particular table, "
+"use the <literal>table</literal> parameter of
<literal>@Column</literal> or "
+"<literal>(a)JoinColumn</literal>."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1295
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Table(name=\"MainCat\")\n"
+"<emphasis role=\"bold\">@SecondaryTables({\n"
+" @SecondaryTable(name=\"Cat1\", pkJoinColumns={\n"
+" @PrimaryKeyJoinColumn(name=\"cat_id\",
referencedColumnName=\"id\")\n"
+" ),\n"
+" @SecondaryTable(name=\"Cat2\",
uniqueConstraints={@UniqueConstraint"
+"(columnNames={\"storyPart2\"})})\n"
+"})</emphasis>\n"
+"public class Cat implements Serializable {\n"
+"\n"
+" private Integer id;\n"
+" private String name;\n"
+" private String storyPart1;\n"
+" private String storyPart2;\n"
+"\n"
+" @Id @GeneratedValue\n"
+" public Integer getId() {\n"
+" return id;\n"
+" }\n"
+"\n"
+" public String getName() {\n"
+" return name;\n"
+" }\n"
+" \n"
+" <emphasis
role=\"bold\">@Column(table=\"Cat1\")</emphasis>\n"
+" public String getStoryPart1() {\n"
+" return storyPart1;\n"
+" }\n"
+"\n"
+" <emphasis
role=\"bold\">@Column(table=\"Cat2\")</emphasis>\n"
+" public String getStoryPart2() {\n"
+" return storyPart2;\n"
+" }"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1297
+#, no-c-format
+msgid ""
+"In this example, <literal>name</literal> will be in
<literal>MainCat</"
+"literal>. <literal>storyPart1</literal> will be in
<literal>Cat1</literal> "
+"and <literal>storyPart2</literal> will be in
<literal>Cat2</literal>. "
+"<literal>Cat1</literal> will be joined to
<literal>MainCat</literal> using "
+"the <literal>cat_id</literal> as a foreign key, and
<literal>Cat2</literal> "
+"using <literal>id</literal> (ie the same column name, the
<literal>MainCat</"
+"literal> id column has). Plus a unique constraint on
<literal>storyPart2</"
+"literal> has been set."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1307
+#, no-c-format
+msgid ""
+"Check out the JBoss EJB 3 tutorial or the Hibernate Annotations unit test "
+"suite for more examples."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1313
+#, no-c-format
+msgid "Mapping Queries"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1317
+#, no-c-format
+msgid "Mapping JPAQL/HQL queries"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1319
+#, no-c-format
+msgid ""
+"You can map EJBQL/HQL queries using annotations.
<literal>@NamedQuery</"
+"literal> and <literal>@NamedQueries</literal> can be defined at the
class "
+"level or in a JPA XML file. However their definitions are global to the "
+"session factory/entity manager factory scope. A named query is defined by "
+"its name and the actual query string."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1326
+#, no-c-format
+msgid ""
+"<entity-mappings>\n"
+" <named-query name=\"plane.getAll\">\n"
+" <query>select p from Plane p</query>\n"
+" </named-query>\n"
+" ...\n"
+"</entity-mappings>\n"
+"...\n"
+"\n"
+"@Entity\n"
+"(a)NamedQuery(name=\"night.moreRecentThan\", query=\"select n from
Night n "
+"where n.date >= :date\")\n"
+"public class Night {\n"
+" ...\n"
+"}\n"
+"\n"
+"public class MyDao {\n"
+" doStuff() {\n"
+" Query q = s.getNamedQuery(\"night.moreRecentThan\");\n"
+" q.setDate( \"date\", aMonthAgo );\n"
+" List results = q.list();\n"
+" ...\n"
+" }\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1328
+#, no-c-format
+msgid ""
+"You can also provide some hints to a query through an array of "
+"<literal>QueryHint</literal> through a
<literal>hints</literal> attribute."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1332
+#, no-c-format
+msgid "The availabe Hibernate hints are"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1337
+#, no-c-format
+msgid "Query hints"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1346
+#, no-c-format
+msgid "hint"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1348
+#, no-c-format
+msgid "description"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1354
+#, no-c-format
+msgid "org.hibernate.cacheable"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1356
+#, no-c-format
+msgid ""
+"Whether the query should interact with the second level cache (defualt to "
+"false)"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1361
+#, no-c-format
+msgid "org.hibernate.cacheRegion"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1363
+#, no-c-format
+msgid "Cache region name (default used otherwise)"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1367
+#, no-c-format
+msgid "org.hibernate.timeout"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1369
+#, no-c-format
+msgid "Query timeout"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1373
+#, no-c-format
+msgid "org.hibernate.fetchSize"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1375
+#, no-c-format
+msgid "resultset fetch size"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1379
+#, no-c-format
+msgid "org.hibernate.flushMode"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1381
+#, no-c-format
+msgid "Flush mode used for this query"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1385
+#, no-c-format
+msgid "org.hibernate.cacheMode"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1387
+#, no-c-format
+msgid "Cache mode used for this query"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1391
+#, no-c-format
+msgid "org.hibernate.readOnly"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1393
+#, no-c-format
+msgid ""
+"Entities loaded by this query should be in read only mode or not (default to
"
+"false)"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1398
+#, no-c-format
+msgid "org.hibernate.comment"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1400
+#, no-c-format
+msgid "Query comment added to the generated SQL"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1408
+#, no-c-format
+msgid "Mapping native queries"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1410
+#, no-c-format
+msgid ""
+"You can also map a native query (ie a plain SQL query). To achieve that, you
"
+"need to describe the SQL resultset structure using "
+"<literal>@SqlResultSetMapping</literal> (or
<literal>@SqlResultSetMappings</"
+"literal> if you plan to define several resulset mappings). Like "
+"<literal>@NamedQuery</literal>, a
<literal>@SqlResultSetMapping</literal> "
+"can be defined at class level or in a JPA XML file. However its scope is "
+"global to the application."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1419
+#, no-c-format
+msgid ""
+"As we will see, a <literal>resultSetMapping</literal> parameter is
defined "
+"in <literal>@NamedNativeQuery</literal>, it represents the name of a
defined "
+"<literal>@SqlResultSetMapping</literal>. The resultset mapping declares
the "
+"entities retrieved by this native query. Each field of the entity is bound "
+"to an SQL alias (or column name). All fields of the entity including the "
+"ones of subclasses and the foreign key columns of related entities have to "
+"be present in the SQL query. Field definitions are optional provided that "
+"they map to the same column name as the one declared on the class property."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1429
+#, no-c-format
+msgid ""
+"@NamedNativeQuery(name=\"night&area\", query=\"select
night.id nid, "
+"night.night_duration, \"\n"
+" + \" night.night_date, area.id aid, night.area_id, area.name
\"\n"
+" + \"from Night night, Area area where night.area_id = area.id\",
"
+"<emphasis\n"
+"
role=\"bold\">resultSetMapping=\"joinMapping\"</emphasis>)\n"
+"@SqlResultSetMapping(name=\"joinMapping\", entities={\n"
+" @EntityResult(entityClass=org.hibernate.test.annotations.query.Night."
+"class, fields = {\n"
+" @FieldResult(name=\"id\", column=\"nid\"),\n"
+" @FieldResult(name=\"duration\",
column=\"night_duration\"),\n"
+" @FieldResult(name=\"date\",
column=\"night_date\"),\n"
+" @FieldResult(name=\"area\",
column=\"area_id\"),\n"
+" discriminatorColumn=\"disc\"\n"
+" }),\n"
+" @EntityResult(entityClass=org.hibernate.test.annotations.query.Area."
+"class, fields = {\n"
+" @FieldResult(name=\"id\", column=\"aid\"),\n"
+" @FieldResult(name=\"name\", column=\"name\")\n"
+" })\n"
+" }\n"
+")"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1431
+#, no-c-format
+msgid ""
+"In the above example, the <literal>night&area</literal> named
query use "
+"the <literal>joinMapping</literal> result set mapping. This mapping
returns "
+"2 entities, <literal>Night</literal> and
<literal>Area</literal>, each "
+"property is declared and associated to a column name, actually the column "
+"name retrieved by the query. Let's now see an implicit declaration of the
"
+"property / column."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1438
+#, no-c-format
+msgid ""
+"@Entity\n"
+"<emphasis
role=\"bold\">@SqlResultSetMapping(name=\"implicit\", "
+"entities=(a)EntityResult(entityClass=org.hibernate.test.annotations.query."
+"SpaceShip.class))\n"
+"@NamedNativeQuery(name=\"implicitSample\", query=\"select * from
SpaceShip"
+"\", resultSetMapping=\"implicit\")</emphasis>\n"
+"public class SpaceShip {\n"
+" private String name;\n"
+" private String model;\n"
+" private double speed;\n"
+"\n"
+" @Id\n"
+" public String getName() {\n"
+" return name;\n"
+" }\n"
+"\n"
+" public void setName(String name) {\n"
+" this.name = name;\n"
+" }\n"
+"\n"
+" @Column(name=\"model_txt\")\n"
+" public String getModel() {\n"
+" return model;\n"
+" }\n"
+"\n"
+" public void setModel(String model) {\n"
+" this.model = model;\n"
+" }\n"
+"\n"
+" public double getSpeed() {\n"
+" return speed;\n"
+" }\n"
+"\n"
+" public void setSpeed(double speed) {\n"
+" this.speed = speed;\n"
+" }\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1440
+#, no-c-format
+msgid ""
+"In this example, we only describe the entity member of the result set "
+"mapping. The property / column mappings is done using the entity mapping "
+"values. In this case the <literal>model</literal> property is bound to
the "
+"<literal>model_txt </literal>column. If the association to a related
entity "
+"involve a composite primary key, a <literal>@FieldResult</literal>
element "
+"should be used for each foreign key column. The
<literal>@FieldResult</"
+"literal> name is composed of the property name for the relationship, "
+"followed by a dot (\".\"), followed by the name or the field or property
of "
+"the primary key."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1450
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@SqlResultSetMapping(name=\"compositekey\",\n"
+" entities=(a)EntityResult(entityClass=org.hibernate.test.annotations."
+"query.SpaceShip.class,\n"
+" fields = {\n"
+" @FieldResult(name=\"name\", column =
\"name\"),\n"
+" @FieldResult(name=\"model\", column =
\"model\"),\n"
+" @FieldResult(name=\"speed\", column =
\"speed\"),\n"
+"<emphasis role=\"bold\">
@FieldResult(name=\"captain."
+"firstname\", column = \"firstn\"),\n"
+" @FieldResult(name=\"captain.lastname\", column =
\"lastn"
+"\"),</emphasis>\n"
+" @FieldResult(name=\"dimensions.length\", column =
"
+"\"length\"),\n"
+" @FieldResult(name=\"dimensions.width\", column =
\"width"
+"\")\n"
+" }),\n"
+" columns = { @ColumnResult(name = \"surface\"),\n"
+" @ColumnResult(name = \"volume\") } )\n"
+"\n"
+"@NamedNativeQuery(name=\"compositekey\",\n"
+" query=\"select name, model, speed, lname as lastn, fname as firstn,
"
+"length, width, length * width as surface from SpaceShip\", \n"
+" resultSetMapping=\"compositekey\")\n"
+"} )\n"
+"public class SpaceShip {\n"
+" private String name;\n"
+" private String model;\n"
+" private double speed;\n"
+" private Captain captain;\n"
+" private Dimensions dimensions;\n"
+"\n"
+" @Id\n"
+" public String getName() {\n"
+" return name;\n"
+" }\n"
+"\n"
+" public void setName(String name) {\n"
+" this.name = name;\n"
+" }\n"
+"\n"
+" @ManyToOne(fetch= FetchType.LAZY)\n"
+" @JoinColumns( {\n"
+" @JoinColumn(name=\"fname\", referencedColumnName =
\"firstname"
+"\"),\n"
+" @JoinColumn(name=\"lname\", referencedColumnName =
\"lastname"
+"\")\n"
+" } )\n"
+" public Captain getCaptain() {\n"
+" return captain;\n"
+" }\n"
+"\n"
+" public void setCaptain(Captain captain) {\n"
+" this.captain = captain;\n"
+" }\n"
+"\n"
+" public String getModel() {\n"
+" return model;\n"
+" }\n"
+"\n"
+" public void setModel(String model) {\n"
+" this.model = model;\n"
+" }\n"
+"\n"
+" public double getSpeed() {\n"
+" return speed;\n"
+" }\n"
+"\n"
+" public void setSpeed(double speed) {\n"
+" this.speed = speed;\n"
+" }\n"
+"\n"
+" public Dimensions getDimensions() {\n"
+" return dimensions;\n"
+" }\n"
+"\n"
+" public void setDimensions(Dimensions dimensions) {\n"
+" this.dimensions = dimensions;\n"
+" }\n"
+"}\n"
+"\n"
+"@Entity\n"
+"(a)IdClass(Identity.class)\n"
+"public class Captain implements Serializable {\n"
+" private String firstname;\n"
+" private String lastname;\n"
+"\n"
+" @Id\n"
+" public String getFirstname() {\n"
+" return firstname;\n"
+" }\n"
+"\n"
+" public void setFirstname(String firstname) {\n"
+" this.firstname = firstname;\n"
+" }\n"
+"\n"
+" @Id\n"
+" public String getLastname() {\n"
+" return lastname;\n"
+" }\n"
+"\n"
+" public void setLastname(String lastname) {\n"
+" this.lastname = lastname;\n"
+" }\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1453
+#, no-c-format
+msgid ""
+"If you look at the dimension property, you'll see that Hibernate supports
"
+"the dotted notation for embedded objects (you can even have nested embedded "
+"objects). EJB3 implementations do not have to support this feature, we do
:-)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1459
+#, no-c-format
+msgid ""
+"If you retrieve a single entity and if you use the default mapping, you can "
+"use the <literal>resultClass</literal> attribute instead of "
+"<literal>resultSetMapping</literal>:"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1463
+#, no-c-format
+msgid ""
+"<emphasis
role=\"bold\">@NamedNativeQuery(name=\"implicitSample\",
query="
+"\"select * from SpaceShip\", \n"
+" resultClass=SpaceShip.class)</emphasis>\n"
+"public class SpaceShip {"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1465
+#, no-c-format
+msgid ""
+"In some of your native queries, you'll have to return scalar values, for
"
+"example when building report queries. You can map them in the "
+"<literal>@SqlResultsetMapping</literal> through
<literal>@ColumnResult</"
+"literal>. You actually can even mix, entities and scalar returns in the same
"
+"native query (this is probably not that common though)."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1472
+#, no-c-format
+msgid ""
+"<emphasis
role=\"bold\">@SqlResultSetMapping(name=\"scalar\", "
+"columns=@ColumnResult(name=\"dimension\"))\n"
+"@NamedNativeQuery(name=\"scalar\", query=\"select length*width as
dimension "
+"from SpaceShip\",
resultSetMapping=\"scalar\")</emphasis>"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1474
+#, no-c-format
+msgid ""
+"An other query hint specific to native queries has been introduced: "
+"<literal>org.hibernate.callable</literal> which can be true or false
"
+"depending on whether the query is a stored procedure or not."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1482
+#, no-c-format
+msgid "Hibernate Annotation Extensions"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1484
+#, no-c-format
+msgid ""
+"Hibernate 3.1 offers a variety of additional annotations that you can mix/"
+"match with your EJB 3 entities. They have been designed as a natural "
+"extension of EJB3 annotations."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1488
+#, no-c-format
+msgid ""
+"To empower the EJB3 capabilities, hibernate provides specific annotations "
+"that match hibernate features. The
<classname>org.hibernate.annotations</"
+"classname> package contains all these annotations extensions."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1494
+#, no-c-format
+msgid "Entity"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1496
+#, no-c-format
+msgid ""
+"You can fine tune some of the actions done by Hibernate on entities beyond "
+"what the EJB3 spec offers."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1499
+#, no-c-format
+msgid ""
+"<classname>(a)org.hibernate.annotations.Entity</classname> adds
additional "
+"metadata that may be needed beyond what is defined in the standard "
+"<literal>@Entity</literal>"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1503
+#, no-c-format
+msgid "mutable: whether this entity is mutable or not"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1508
+#, no-c-format
+msgid "dynamicInsert: allow dynamic SQL for inserts"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1513
+#, no-c-format
+msgid "dynamicUpdate: allow dynamic SQL for updates"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1518
+#, no-c-format
+msgid ""
+"selectBeforeUpdate: Specifies that Hibernate should never perform an SQL "
+"UPDATE unless it is certain that an object is actually modified."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1523
+#, no-c-format
+msgid ""
+"polymorphism: whether the entity polymorphism is of PolymorphismType."
+"IMPLICIT (default) or PolymorphismType.EXPLICIT"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1528
+#, no-c-format
+msgid ""
+"optimisticLock: optimistic locking strategy (OptimisticLockType.VERSION, "
+"OptimisticLockType.NONE, OptimisticLockType.DIRTY or OptimisticLockType.ALL)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1534
+#, no-c-format
+msgid ""
+"(a)javax.persistence.Entity is still mandatory, @org.hibernate.annotations."
+"Entity is not a replacement."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1538
+#, no-c-format
+msgid "Here are some additional Hibernate annotation extensions"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1540
+#, no-c-format
+msgid ""
+"<literal>(a)org.hibernate.annotations.BatchSize</literal> allows you to
define "
+"the batch size when fetching instances of this entity ( eg. "
+"<literal>@BatchSize(size=4)</literal> ). When loading a given entity,
"
+"Hibernate will then load all the uninitialized entities of the same type in "
+"the persistence context up to the batch size."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1546
+#, no-c-format
+msgid ""
+"<literal>(a)org.hibernate.annotations.Proxy</literal> defines the
laziness "
+"attributes of the entity. lazy (default to true) define whether the class is
"
+"lazy or not. proxyClassName is the interface used to generate the proxy "
+"(default is the class itself)."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1551
+#, no-c-format
+msgid ""
+"<literal>(a)org.hibernate.annotations.Where</literal> defines an optional
SQL "
+"WHERE clause used when instances of this class is retrieved."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1555
+#, no-c-format
+msgid ""
+"<literal>(a)org.hibernate.annotations.Check</literal> defines an optional
"
+"check constraints defined in the DDL statetement."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1558
+#, no-c-format
+msgid ""
+"<literal>(a)OnDelete(action=OnDeleteAction.CASCADE)</literal> on joined
"
+"subclasses: use a SQL cascade delete on deletion instead of the regular "
+"Hibernate mechanism."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1562
+#, no-c-format
+msgid ""
+"<literal>@Table(appliesTo=\"tableName\", indexes = {
@Index(name=\"index1\", "
+"columnNames={\"column1\", \"column2\"} ) } )</literal>
creates the defined "
+"indexes on the columns of table <literal>tableName</literal>. This can
be "
+"applied on the primary table or any secondary table. The
<literal>@Tables</"
+"literal> annotation allows your to apply indexes on different tables. This
"
+"annotation is expected where
<literal>(a)javax.persistence.Table</literal> or "
+"<literal>(a)javax.persistence.SecondaryTable</literal>(s) occurs."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1572
+#, no-c-format
+msgid ""
+"<literal>(a)org.hibernate.annotations.Table</literal> is a complement,
not a "
+"replacement to <literal>(a)javax.persistence.Table</literal>. Especially,
if "
+"you want to change the default name of a table, you must use
<literal>(a)javax."
+"persistence.Table</literal>, not
<literal>(a)org.hibernate.annotations.Table</"
+"literal>."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1580
+#, no-c-format
+msgid ""
+"<literal>(a)org.hibernate.annotations.Table</literal> can also be used to
"
+"define the following elements of secondary tables:"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1585
+#, no-c-format
+msgid ""
+"<literal>fetch</literal>: If set to JOIN, the default, Hibernate will
use an "
+"inner join to retrieve a secondary table defined by a class or its "
+"superclasses and an outer join for a secondary table defined by a subclass. "
+"If set to select then Hibernate will use a sequential select for a secondary
"
+"table defined on a subclass, which will be issued only if a row turns out to
"
+"represent an instance of the subclass. Inner joins will still be used to "
+"retrieve a secondary defined by the class and its superclasses."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1597
+#, no-c-format
+msgid ""
+"<literal>inverse</literal>: If true, Hibernate will not try to insert
or "
+"update the properties defined by this join. Default to false."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1603
+#, no-c-format
+msgid ""
+"<literal>optional</literal>: If enabled (the default), Hibernate will
insert "
+"a row only if the properties defined by this join are non-null and will "
+"always use an outer join to retrieve the properties."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1610
+#, no-c-format
+msgid ""
+"<literal>foreignKey</literal>: defines the Foreign Key name of a
secondary "
+"table pointing back to the primary table."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1615
+#, no-c-format
+msgid ""
+"<literal>@Immutable</literal> marks an entity or collection as
immutable. An "
+"immutable entity may not be updated by the application. This allows "
+"Hibernate to make some minor performance optimizations. Updates to an "
+"immutable entity will be ignored, but no exception is thrown. "
+"<literal>@Immutable</literal> must be used on root entities only.
"
+"<literal>@Immutable</literal> placed on a collection makes the
collection "
+"immutable, meaning additions and deletions to and from the collection are "
+"not allowed. A <literal>HibernateException</literal> is thrown in this
case."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1625
+#, no-c-format
+msgid ""
+"<literal>@Persister</literal> lets you define your own custom
persistence "
+"strategy. You may, for example, specify your own subclass of
<classname>org."
+"hibernate.persister.EntityPersister</classname> or you might even provide a
"
+"completely new implementation of the interface <literal>org.hibernate."
+"persister.ClassPersister</literal> that implements persistence via, for
"
+"example, stored procedure calls, serialization to flat files or LDAP."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1633
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@BatchSize(size=5)\n"
+"(a)org.hibernate.annotations.Entity(\n"
+" selectBeforeUpdate = true,\n"
+" dynamicInsert = true, dynamicUpdate = true,\n"
+" optimisticLock = OptimisticLockType.ALL,\n"
+" polymorphism = PolymorphismType.EXPLICIT)\n"
+"@Where(clause=\"1=1\")\n"
+"(a)org.hibernate.annotations.Table(name=\"Forest\", indexes = {
@Index(name="
+"\"idx\", columnNames = { \"name\", \"length\" } ) }
)\n"
+"(a)Persister(impl=MyEntityPersister.class)\n"
+"public class Forest { ... }"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1633
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Inheritance(\n"
+" strategy=InheritanceType.JOINED\n"
+")\n"
+"public class Vegetable { ... }\n"
+"\n"
+"@Entity\n"
+"(a)OnDelete(action=OnDeleteAction.CASCADE)\n"
+"public class Carrot extends Vegetable { ... }"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1637
+#, no-c-format
+msgid "Identifier"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1639
+#, no-c-format
+msgid ""
+"Hibernate Annotations goes beyond the Java Persistence specification when "
+"defining identifiers."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1643
+#, no-c-format
+msgid "Generators"
+msgstr ""
+
+#. Tag: literal
+#: entity.xml:1645
+#, no-c-format
+msgid ""
+"<literal>(a)org.hibernate.annotations.GenericGenerator</literal> and
"
+"<literal>(a)org.hibernate.annotations.GenericGenerators</literal> allows
you "
+"to define an Hibernate specific id generator."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1650
+#, no-c-format
+msgid ""
+"@Id @GeneratedValue(generator=\"system-uuid\")\n"
+"@GenericGenerator(name=\"system-uuid\", strategy =
\"uuid\")\n"
+"public String getId() {\n"
+"\n"
+"@Id @GeneratedValue(generator=\"hibseq\")\n"
+"@GenericGenerator(name=\"hibseq\", strategy =
\"seqhilo\",\n"
+" parameters = {\n"
+" @Parameter(name=\"max_lo\", value = \"5\"),\n"
+" @Parameter(name=\"sequence\",
value=\"heybabyhey\")\n"
+" }\n"
+")\n"
+"public Integer getId() {"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1652
+#, no-c-format
+msgid ""
+"<literal>strategy</literal> is the short name of an Hibernate3
generator "
+"strategy or the fully qualified class name of an "
+"<classname>IdentifierGenerator</classname> implementation. You can add
some "
+"parameters through the <literal>parameters</literal> attribute."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1658
+#, no-c-format
+msgid ""
+"Contrary to their standard counterpart,
<literal>@GenericGenerator</literal> "
+"and <literal>@GenericGenerators</literal> can be used in package level
"
+"annotations, making them application level generators (just like if they "
+"were in a JPA XML file)."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1664
+#, no-c-format
+msgid ""
+"@GenericGenerators(\n"
+" {\n"
+" @GenericGenerator(\n"
+" name=\"hibseq\",\n"
+" strategy = \"seqhilo\",\n"
+" parameters = {\n"
+" @Parameter(name=\"max_lo\", value =
\"5\"),\n"
+" @Parameter(name=\"sequence\",
value=\"heybabyhey\")\n"
+" }\n"
+" ),\n"
+" @GenericGenerator(...)\n"
+" }\n"
+")\n"
+"package org.hibernate.test.model"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1668
+#, no-c-format
+msgid "@NaturalId"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1670
+#, no-c-format
+msgid ""
+"While not used as identifier property, some (group of) properties represent "
+"natural identifier of an entity. This is especially true when the schema "
+"uses the recommended approach of using surrogate primary key even if a "
+"natural business key exists. Hibernate allows to map such natural properties
"
+"and reuse them in a <classname>Criteria</classname> query. The natural
"
+"identifier is composed of all the properties marked
<classname>@NaturalId</"
+"classname>."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1679
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Citizen {\n"
+" @Id\n"
+" @GeneratedValue\n"
+" private Integer id;\n"
+" private String firstname;\n"
+" private String lastname;\n"
+" \n"
+" @NaturalId\n"
+" @ManyToOne\n"
+" private State state;\n"
+"\n"
+" @NaturalId\n"
+" private String ssn;\n"
+" ...\n"
+"}\n"
+"\n"
+"\n"
+"\n"
+"//and later on query\n"
+"List results = s.createCriteria( Citizen.class )\n"
+" .add( Restrictions.naturalId().set( \"ssn\",
\"1234\" ).set"
+"( \"state\", ste ) )\n"
+" .list();"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1681
+#, no-c-format
+msgid ""
+"Note that the group of properties representing the natural identifier have "
+"to be unique (Hibernate will generate a unique constraint if the database "
+"schema is generated)."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1688
+#, no-c-format
+msgid "Property"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1691
+#, no-c-format
+msgid "Access type"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1693
+#, no-c-format
+msgid ""
+"The access type is guessed from the position of <literal>@Id</literal>
or "
+"<literal>@EmbeddedId</literal> in the entity hierarchy. Sub-entities,
"
+"embedded objects and mapped superclass inherit the access type from the root
"
+"entity."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1698
+#, no-c-format
+msgid "In Hibernate, you can override the access type to:"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1702
+#, no-c-format
+msgid "use a custom access type strategy"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1706
+#, no-c-format
+msgid "fine tune the access type at the class level or at the property level"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1711
+#, no-c-format
+msgid ""
+"An @AccessType annotation has been introduced to support this behavior. You "
+"can define the access type on"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1716
+#, no-c-format
+msgid "an entity"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1720
+#, no-c-format
+msgid "a superclass"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1724
+#, no-c-format
+msgid "an embeddable object"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1728
+#, no-c-format
+msgid "a property"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1732
+#, no-c-format
+msgid ""
+"The access type is overriden for the annotated element, if overriden on a "
+"class, all the properties of the given class inherit the access type. For "
+"root entities, the access type is considered to be the default one for the "
+"whole hierarchy (overridable at class or property level)."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1738
+#, no-c-format
+msgid ""
+"If the access type is marked as \"property\", the getters are scanned for
"
+"annotations, if the access type is marked as \"field\", the fields are
"
+"scanned for annotations. Otherwise the elements marked with @Id or "
+"@embeddedId are scanned."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1743
+#, no-c-format
+msgid ""
+"You can override an access type for a property, but the element to annotate "
+"will not be influenced: for example an entity having access type "
+"<literal>field</literal>, can annotate a field with
<literal>@AccessType"
+"(\"property\")</literal>, the access type will then be property for
this "
+"attribute, the the annotations still have to be carried on the field."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1750
+#, no-c-format
+msgid ""
+"If a superclass or an embeddable object is not annotated, the root entity "
+"access type is used (even if an access type has been define on an "
+"intermediate superclass or embeddable object). The russian doll principle "
+"does not apply."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1755
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Person implements Serializable {\n"
+" @Id @GeneratedValue //access type field\n"
+" Integer id;\n"
+"\n"
+" @Embedded\n"
+" @AttributeOverrides({\n"
+" @AttributeOverride(name = \"iso2\", column = @Column(name =
\"bornIso2"
+"\")),\n"
+" @AttributeOverride(name = \"name\", column = @Column(name = "
+"\"bornCountryName\"))\n"
+" })\n"
+" Country bornIn;\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"<emphasis
role=\"bold\">@AccessType(\"property\")</emphasis> //override
"
+"access type for all properties in Country\n"
+"public class Country implements Serializable {\n"
+" private String iso2;\n"
+" private String name;\n"
+"\n"
+" public String getIso2() {\n"
+" return iso2;\n"
+" }\n"
+"\n"
+" public void setIso2(String iso2) {\n"
+" this.iso2 = iso2;\n"
+" }\n"
+"\n"
+" @Column(name = \"countryName\")\n"
+" public String getName() {\n"
+" return name;\n"
+" }\n"
+"\n"
+" public void setName(String name) {\n"
+" this.name = name;\n"
+" }\n"
+"}"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1759
+#, no-c-format
+msgid "Formula"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1761
+#, no-c-format
+msgid ""
+"Sometimes, you want the Database to do some computation for you rather than "
+"in the JVM, you might also create some kind of virtual column. You can use a
"
+"SQL fragment (aka formula) instead of mapping a property into a column. This
"
+"kind of property is read only (its value is calculated by your formula "
+"fragment)."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1767
+#, no-c-format
+msgid ""
+"@Formula(\"obj_length * obj_height * obj_width\")\n"
+"public long getObjectVolume()"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1769
+#, no-c-format
+msgid ""
+"The SQL fragment can be as complex as you want and even include subselects."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1774
+#, no-c-format
+msgid "Type"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1776
+#, no-c-format
+msgid ""
+"<literal>(a)org.hibernate.annotations.Type</literal> overrides the
default "
+"hibernate type used: this is generally not necessary since the type is "
+"correctly inferred by Hibernate. Please refer to the Hibernate reference "
+"guide for more informations on the Hibernate types."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1781
+#, no-c-format
+msgid ""
+"<literal>(a)org.hibernate.annotations.TypeDef</literal> and
<literal>(a)org."
+"hibernate.annotations.TypeDefs</literal> allows you to declare type "
+"definitions. These annotations can be placed at the class or package level. "
+"Note that these definitions are be global for the session factory (even when
"
+"defined at the class level). Type definitions have to be defined before any "
+"usage. If the type is used on a single entity, you can plance the definition
"
+"on the entity itself. Otherwise, it is recommended to place the definition a
"
+"the package level since the entity processing order is not guaranteed."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1790
+#, no-c-format
+msgid ""
+"Package level annotations are placed in a file named
<filename>package-info."
+"java</filename> in the appropriate package. Place your annotations before
"
+"the package declaration."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1793
+#, no-c-format
+msgid ""
+"//in org/hibernate/test/annotations/entity/package-info.java\n"
+"@TypeDefs(\n"
+" {\n"
+" @TypeDef(\n"
+" name=\"caster\",\n"
+" typeClass = CasterStringType.class,\n"
+" parameters = {\n"
+" @Parameter(name=\"cast\", value=\"lower\")\n"
+" }\n"
+" )\n"
+" }\n"
+")\n"
+"package org.hibernate.test.annotations.entity;\n"
+"\n"
+"//in org/hibernate/test/annotations/entity/Forest.java\n"
+"public class Forest {\n"
+" @Type(type=\"caster\")\n"
+" public String getSmallText() {\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1795
+#, no-c-format
+msgid ""
+"When using composite user type, you will have to express column definitions.
"
+"The <literal>@Columns</literal> has been introduced for that
purpose."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1799
+#, no-c-format
+msgid ""
+"(a)Type(type=\"org.hibernate.test.annotations.entity.MonetaryAmountUserType"
+"\")\n"
+"@Columns(columns = {\n"
+" @Column(name=\"r_amount\"),\n"
+" @Column(name=\"r_currency\")\n"
+"})\n"
+"public MonetaryAmount getAmount() {\n"
+" return amount;\n"
+"}\n"
+"\n"
+"\n"
+"public class MonetaryAmount implements Serializable {\n"
+" private BigDecimal amount;\n"
+" private Currency currency;\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1803
+#, no-c-format
+msgid "Index"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1805
+#, no-c-format
+msgid ""
+"You can define an index on a particular column using the
<literal>@Index</"
+"literal> annotation on a one column property, the columnNames attribute will
"
+"then be ignored"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1809
+#, no-c-format
+msgid ""
+"@Column(secondaryTable=\"Cat1\")\n"
+"@Index(name=\"story1index\")\n"
+"public String getStoryPart1() {\n"
+" return storyPart1;\n"
+"}"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1813
+#, no-c-format
+msgid "@Parent"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1815
+#, no-c-format
+msgid ""
+"When inside an embeddable object, you can define one of the properties as a "
+"pointer back to the owner element."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1818
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Person {\n"
+" @Embeddable public Address address;\n"
+" ...\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"public class Address {\n"
+" @Parent public Person owner;\n"
+" ...\n"
+"}\n"
+"\n"
+"\n"
+"person == person.address.owner"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1822
+#, no-c-format
+msgid "Generated properties"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1824
+#, no-c-format
+msgid ""
+"Some properties are generated at insert or update time by your database. "
+"Hibernate can deal with such properties and triggers a subsequent select to "
+"read these properties."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1828
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Antenna {\n"
+" @Id public Integer id;\n"
+" @Generated(GenerationTime.ALWAYS) @Column(insertable = false, updatable "
+"= false)\n"
+" public String longitude;\n"
+"\n"
+" @Generated(GenerationTime.INSERT) @Column(insertable = false)\n"
+" public String latitude;\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1830
+#, no-c-format
+msgid ""
+"Annotate your property as <literal>@Generated</literal> You have to
make "
+"sure your insertability or updatability does not conflict with the "
+"generation strategy you have chosen. When GenerationTime.INSERT is chosen, "
+"the property must not contains insertable columns, when GenerationTime."
+"ALWAYS is chosen, the property must not contains insertable nor updatable "
+"columns."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1837
+#, no-c-format
+msgid ""
+"<literal>@Version</literal> properties cannot be
<literal>@Generated(INSERT)"
+"</literal> by design, it has to be either
<literal>NEVER</literal> or "
+"<literal>ALWAYS</literal>."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1843
+#, no-c-format
+msgid "@Target"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1845
+#, no-c-format
+msgid ""
+"Sometimes, the type guessed by reflection is not the one you want Hibernate "
+"to use. This is especially true on components when an interface is used. You
"
+"can use <literal>@Target</literal> to by pass the reflection guessing
"
+"mechanism (very much like the <literal>targetEntity</literal> attribute
"
+"available on associations."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1852
+#, no-c-format
+msgid ""
+"@Embedded\n"
+" <emphasis
role=\"bold\">(a)Target(OwnerImpl.class)</emphasis>\n"
+" public Owner getOwner() {\n"
+" return owner;\n"
+" }"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1858
+#, no-c-format
+msgid "Optimistic lock"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1860
+#, no-c-format
+msgid ""
+"It is sometimes useful to avoid increasing the version number even if a "
+"given property is dirty (particularly collections). You can do that by "
+"annotating the property (or collection) with <literal>@OptimisticLock"
+"(excluded=true)</literal>."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1865
+#, no-c-format
+msgid ""
+"More formally, specifies that updates to this property do not require "
+"acquisition of the optimistic lock."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1871
+#, no-c-format
+msgid "Inheritance"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1873
+#, no-c-format
+msgid ""
+"SINGLE_TABLE is a very powerful strategy but sometimes, and especially for "
+"legacy systems, you cannot add an additional discriminator column. For that "
+"purpose Hibernate has introduced the notion of discriminator formula: "
+"<literal>@DiscriminatorFormula</literal> is a replacement of "
+"<literal>@DiscriminatorColumn</literal> and use a SQL fragment as a
formula "
+"for discriminator resolution (no need to have a dedicated column)."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1882
+#, no-c-format
+msgid ""
+"@Entity\n"
+"<emphasis role=\"bold\">@DiscriminatorFormula(\"case when
forest_type is "
+"null then 0 else forest_type end\")</emphasis>\n"
+"public class Forest { ... }"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1884
+#, no-c-format
+msgid ""
+"By default, when querying the top entities, Hibernate does not put a "
+"restriction clause on the discriminator column. This can be inconvenient if "
+"this column contains values not mapped in your hierarchy (through "
+"<literal>@DiscriminatorValue</literal>). To work around that you can
use "
+"<literal>@ForceDiscriminator</literal> (at the class level, next to
"
+"<literal>@DiscriminatorColumn</literal>). Hibernate will then list the
"
+"available values when loading the entities."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1892
+#, no-c-format
+msgid ""
+"You can define the foreign key name generated by Hibernate for subclass "
+"tables in the JOINED inheritance strategy."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1895
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Inheritance(strategy = InheritanceType.JOINED)\n"
+"public abstract class File { ... }\n"
+"\n"
+"@Entity\n"
+"@ForeignKey(name = \"FK_DOCU_FILE\")\n"
+"public class Document extends File {"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1897
+#, no-c-format
+msgid ""
+"The foreign key from the <literal>Document</literal> table to the
"
+"<literal>File</literal> table will be named
<literal>FK_DOCU_FILE</literal>."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1903
+#, no-c-format
+msgid "Single Association related annotations"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1905
+#, no-c-format
+msgid ""
+"By default, when Hibernate cannot resolve the association because the "
+"expected associated element is not in database (wrong id on the association "
+"column), an exception is raised by Hibernate. This might be inconvenient for
"
+"legacy and badly maintained schemas. You can ask Hibernate to ignore such "
+"elements instead of raising an exception using the
<literal>@NotFound</"
+"literal> annotation. This annotation can be used on a
<literal>@OneToOne</"
+"literal> (with FK), <literal>@ManyToOne</literal>,
<literal>@OneToMany</"
+"literal> or <literal>@ManyToMany</literal> association."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1915
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Child {\n"
+" ...\n"
+" @ManyToOne\n"
+" @NotFound(action=NotFoundAction.IGNORE)\n"
+" public Parent getParent() { ... }\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1917
+#, no-c-format
+msgid ""
+"Sometimes you want to delegate to your database the deletion of cascade when
"
+"a given entity is deleted."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1920
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Child {\n"
+" ...\n"
+" @ManyToOne\n"
+" @OnDelete(action=OnDeleteAction.CASCADE)\n"
+" public Parent getParent() { ... }\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1922
+#, no-c-format
+msgid ""
+"In this case Hibernate generates a cascade delete constraint at the database
"
+"level."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1925
+#, no-c-format
+msgid ""
+"Foreign key constraints, while generated by Hibernate, have a fairly "
+"unreadable name. You can override the constraint name by use "
+"<literal>(a)ForeignKey</literal>."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1929
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Child {\n"
+" ...\n"
+" @ManyToOne\n"
+" <emphasis
role=\"bold\">@ForeignKey(name=\"FK_PARENT\")</emphasis>\n"
+" public Parent getParent() { ... }\n"
+" ...\n"
+"}\n"
+"\n"
+"alter table Child add constraint FK_PARENT foreign key (parent_id) "
+"references Parent"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1932
+#, no-c-format
+msgid "Lazy options and fetching modes"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1934
+#, no-c-format
+msgid ""
+"EJB3 comes with the <literal>fetch</literal> option to define lazy
loading "
+"and fetching modes, however Hibernate has a much more option set in this "
+"area. To fine tune the lazy loading and fetching strategies, some additional
"
+"annotations have been introduced:"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1941
+#, no-c-format
+msgid ""
+"<literal>@LazyToOne</literal>: defines the lazyness option on "
+"<literal>@ManyToOne</literal> and
<literal>@OneToOne</literal> associations. "
+"<literal>LazyToOneOption</literal> can be
<literal>PROXY</literal> (ie use a "
+"proxy based lazy loading), <literal>NO_PROXY</literal> (use a bytecode
"
+"enhancement based lazy loading - note that build time bytecode processing is
"
+"necessary) and <literal>FALSE</literal> (association not lazy)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1951
+#, no-c-format
+msgid ""
+"<literal>@LazyCollection</literal>: defines the lazyness option on
"
+"<literal>@ManyTo</literal>Many and
<literal>@OneToMany</literal> "
+"associations. LazyCollectionOption can be <literal>TRUE</literal> (the
"
+"collection is lazy and will be loaded when its state is accessed), "
+"<literal>EXTRA</literal> (the collection is lazy and all operations
will try "
+"to avoid the collection loading, this is especially useful for huge "
+"collections when loading all the elements is not necessary) and FALSE "
+"(association not lazy)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1963
+#, no-c-format
+msgid ""
+"<literal>@Fetch</literal>: defines the fetching strategy used to load
the "
+"association. <literal>FetchMode</literal> can be
<literal>SELECT</literal> "
+"(a select is triggered when the association needs to be loaded), "
+"<literal>SUBSELECT</literal> (only available for collections, use a
"
+"subselect strategy - please refers to the Hibernate Reference Documentation "
+"for more information) or <literal>JOIN</literal> (use a SQL JOIN to
load the "
+"association while loading the owner entity). <literal>JOIN</literal>
"
+"overrides any lazy attribute (an association loaded through a
<literal>JOIN</"
+"literal> strategy cannot be lazy)."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1977
+#, no-c-format
+msgid "The Hibernate annotations overrides the EJB3 fetching options."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1981
+#, no-c-format
+msgid "Lazy and fetch options equivalent"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1986
+#, no-c-format
+msgid "Annotations"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1988
+#, no-c-format
+msgid "Lazy"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1990
+#, no-c-format
+msgid "Fetch"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1996
+#, no-c-format
+msgid "(a)[One|Many]ToOne](fetch=FetchType.LAZY)"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1998
+#, no-c-format
+msgid "@LazyToOne(PROXY)"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:2000 entity.xml:2016
+#, no-c-format
+msgid "@Fetch(SELECT)"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:2004
+#, no-c-format
+msgid "(a)[One|Many]ToOne](fetch=FetchType.EAGER)"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:2006
+#, no-c-format
+msgid "@LazyToOne(FALSE)"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:2008 entity.xml:2024
+#, no-c-format
+msgid "@Fetch(JOIN)"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:2012
+#, no-c-format
+msgid "(a)ManyTo[One|Many](fetch=FetchType.LAZY)"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:2014
+#, no-c-format
+msgid "@LazyCollection(TRUE)"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:2020
+#, no-c-format
+msgid "(a)ManyTo[One|Many](fetch=FetchType.EAGER)"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:2022
+#, no-c-format
+msgid "@LazyCollection(FALSE)"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:2032
+#, no-c-format
+msgid "@Any"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2034
+#, no-c-format
+msgid ""
+"The <classname>@Any</classname> annotation defines a polymorphic
association "
+"to classes from multiple tables. This type of mapping always requires more "
+"than one column. The first column holds the type of the associated entity. "
+"The remaining columns hold the identifier. It is impossible to specify a "
+"foreign key constraint for this kind of association, so this is most "
+"certainly not meant as the usual way of mapping (polymorphic) associations. "
+"You should use this only in very special cases (eg. audit logs, user session
"
+"data, etc)."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2043
+#, no-c-format
+msgid ""
+"The @Any annotation describes the column holding the metadata information. "
+"To link the value of the metadata information and an actual entity type, The
"
+"<classname>@AnyDef</classname> and
<classname>@AnyDefs</classname> "
+"annotations are used."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2048
+#, no-c-format
+msgid ""
+"@Any( metaColumn = @Column( name = \"property_type\" ),
fetch=FetchType."
+"EAGER )\n"
+" @AnyMetaDef( \n"
+" idType = \"integer\", \n"
+" metaType = \"string\", \n"
+" metaValues = {\n"
+" @MetaValue( value = \"S\", targetEntity =
StringProperty."
+"class ),\n"
+" @MetaValue( value = \"I\", targetEntity =
IntegerProperty."
+"class )\n"
+" } )\n"
+" @JoinColumn( name = \"property_id\" )\n"
+" public Property getMainProperty() {\n"
+" return mainProperty;\n"
+" }"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2050
+#, no-c-format
+msgid ""
+"<methodname>idType</methodname> represents the target entities
identifier "
+"property type and <methodname>metaType</methodname> the metadata type
"
+"(usually String)."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2054
+#, no-c-format
+msgid ""
+"Note that <classname>@AnyDef</classname> can be mutualized and reused.
It is "
+"recommended to place it as a package metadata in this case."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2058
+#, no-c-format
+msgid ""
+"//on a package\n"
+"@AnyMetaDef( name=\"property\" \n"
+" idType = \"integer\", \n"
+" metaType = \"string\", \n"
+" metaValues = {\n"
+" @MetaValue( value = \"S\", targetEntity = StringProperty.class
),\n"
+" @MetaValue( value = \"I\", targetEntity = IntegerProperty.class
)\n"
+" } )\n"
+"package org.hibernate.test.annotations.any;\n"
+"\n"
+"\n"
+"//in a class\n"
+" @Any( metaDef=\"property\", metaColumn = @Column( name =
\"property_type"
+"\" ), fetch=FetchType.EAGER )\n"
+" @JoinColumn( name = \"property_id\" )\n"
+" public Property getMainProperty() {\n"
+" return mainProperty;\n"
+" }"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:2063
+#, no-c-format
+msgid "Collection related annotations"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:2066
+#, no-c-format
+msgid "Enhance collection settings"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2068
+#, no-c-format
+msgid "It is possible to set"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2070
+#, no-c-format
+msgid "the batch size for collections using @BatchSize"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2075
+#, no-c-format
+msgid ""
+"the where clause, using @Where (applied on the target entity) or "
+"@WhereJoinTable (applied on the association table)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2080
+#, no-c-format
+msgid "the check clause, using @Check"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2085
+#, no-c-format
+msgid "the SQL order by clause, using @OrderBy"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2090
+#, no-c-format
+msgid ""
+"the delete cascade strategy through @OnDelete(action=OnDeleteAction.CASCADE)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2095
+#, no-c-format
+msgid ""
+"the collection immutability using @Immutable: if set specifies that the "
+"elements of the collection never change (a minor performance optimization in
"
+"some cases)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2100
+#, no-c-format
+msgid ""
+"a custom collection persister (ie the persistence strategy used) using "
+"<literal>@Persister</literal>: the class must implement
<classname>org."
+"hibernate.persister.collectionCollectionPersister</classname>"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2107
+#, no-c-format
+msgid ""
+"You can also declare a sort comparator. Use the
<literal>@Sort</literal> "
+"annotation. Expressing the comparator type you want between unsorted, "
+"natural or custom comparator. If you want to use your own comparator "
+"implementation, you'll also have to express the implementation class using
"
+"the <literal>comparator</literal> attribute. Note that you need to use
"
+"either a <classname>SortedSet</classname> or a
<classname>SortedMap</"
+"classname> interface."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2116
+#, no-c-format
+msgid ""
+"(a)OneToMany(cascade=CascadeType.ALL, fetch=FetchType.EAGER)\n"
+" @JoinColumn(name=\"CUST_ID\")\n"
+" @Sort(type = SortType.COMPARATOR, comparator = TicketComparator.class)\n"
+" @Where(clause=\"1=1\")\n"
+" @OnDelete(action=OnDeleteAction.CASCADE)\n"
+" public SortedSet<Ticket> getTickets() {\n"
+" return tickets;\n"
+" }"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2118
+#, no-c-format
+msgid ""
+"Please refer to the previous descriptions of these annotations for more "
+"informations."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2121
+#, no-c-format
+msgid ""
+"Foreign key constraints, while generated by Hibernate, have a fairly "
+"unreadable name. You can override the constraint name by use "
+"<literal>@ForeignKey</literal>. Note that this annotation has to be
placed "
+"on the owning side of the relationship, <literal>inverseName</literal>
"
+"referencing to the other side constraint."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2128
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Woman {\n"
+" ...\n"
+" @ManyToMany(cascade = {CascadeType.ALL})\n"
+" <emphasis role=\"bold\">@ForeignKey(name =
\"TO_WOMAN_FK\", inverseName "
+"= \"TO_MAN_FK\")</emphasis>\n"
+" public Set<Man> getMens() {\n"
+" return mens;\n"
+" }\n"
+"}\n"
+"\n"
+"alter table Man_Woman add constraint TO_WOMAN_FK foreign key (woman_id) "
+"references Woman\n"
+"alter table Man_Woman add constraint TO_MAN_FK foreign key (man_id) "
+"references Man"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:2132
+#, no-c-format
+msgid "Extra collection types"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:2135
+#, no-c-format
+msgid "List"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2137
+#, no-c-format
+msgid ""
+"Beyond EJB3, Hibernate Annotations supports true
<classname>List</classname> "
+"and <classname>Array</classname>. Map your collection the same way as
usual "
+"and add the @<literal>IndexColumn</literal>. This annotation allows you
to "
+"describe the column that will hold the index. You can also declare the index
"
+"value in DB that represent the first element (aka as base index). The usual "
+"value is <literal>0</literal> or
<literal>1</literal>."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2146
+#, no-c-format
+msgid ""
+"@OneToMany(cascade = CascadeType.ALL)\n"
+"@IndexColumn(name = \"drawer_position\", base=1)\n"
+"public List<Drawer> getDrawers() {\n"
+" return drawers;\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2149
+#, no-c-format
+msgid ""
+"If you forgot to set <literal>@IndexColumn</literal>, the bag semantic
is "
+"applied. If you want the bag semantic without the limitations of it, "
+"consider using <literal>(a)CollectionId</literal>."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:2157
+#, no-c-format
+msgid "<title>Map</title>"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2159
+#, no-c-format
+msgid ""
+"Hibernate Annotations also supports true Map mappings, if
<literal>(a)javax."
+"persistence.MapKey</literal> is not set, hibernate will map the key element
"
+"or embeddable object in its/their own columns. To override the default "
+"columns, you can use
<literal>(a)org.hibernate.annotations.MapKey</literal> if "
+"your key is a basic type (defaulted to <literal>mapkey</literal>) or an
"
+"embeddable object, or you can use <literal>(a)org.hibernate.annotations."
+"MapKeyManyToMany</literal> if your key is an entity."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2169
+#, no-c-format
+msgid ""
+"Both <literal>(a)org.hibernate.annotations.MapKey</literal> and
<literal>(a)org."
+"hibernate.annotations.MapKeyManyToMany</literal> allows you to override the
"
+"target element to be used. This is especially useful if your collection does
"
+"not use generics (or if you use interfaces)."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2175
+#, no-c-format
+msgid ""
+"@CollectionOfElements(targetElement = SizeImpl.class)\n"
+" @MapKeyManyToMany(<emphasis role=\"bold\">targetEntity =
LuggageImpl."
+"class</emphasis>)\n"
+" private Map<Luggage, Size> sizePerLuggage = new
HashMap<"
+"Luggage, Size>();"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:2182
+#, no-c-format
+msgid "Bidirectional association with indexed collections"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2184
+#, no-c-format
+msgid ""
+"A bidirectional association where one end is an indexed collection (ie. "
+"represented as a <literal>@IndexColumn</literal>,
<literal>(a)org.hibernate."
+"annotations.MapKey</literal> or
<classname>(a)org.hibernate.annotations."
+"MapKeyManyToMany</classname>) requires special consideration. If a property
"
+"on the associated class explicitly maps the indexed value, the use of "
+"<methodname>mappedBy</methodname> is permitted:"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2192
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Parent {\n"
+" @OneToMany(mappedBy=\"parent\")\n"
+" @org.hibernate.annotations.IndexColumn(name=\"order\")\n"
+" private List<Child> children;\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Child {\n"
+" ...\n"
+" //the index column is mapped as a property in the associated entity\n"
+" @Column(name=\"order\")\n"
+" private int order;\n"
+"\n"
+" @ManyToOne\n"
+" @JoinColumn(name=\"parent_id\", nullable=false)\n"
+" private Parent parent;\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2194
+#, no-c-format
+msgid ""
+"But, if there is no such property on the child class, we can't think of the
"
+"association as truly bidirectional (there is information available at one "
+"end of the association that is not available at the other end: the index). "
+"In this case, we can't map the collection as
<literal>mappedBy</literal>. "
+"Instead, we could use the following mapping:"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2201
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Parent {\n"
+" @OneToMany\n"
+" @org.hibernate.annotations.IndexColumn(name=\"order\")\n"
+" @JoinColumn(name=\"parent_id\", nullable=false)\n"
+" private List<Child> children;\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Child {\n"
+" ...\n"
+" @ManyToOne\n"
+" @JoinColumn(name=\"parent_id\", insertable=false, updatable=false,
"
+"nullable=false)\n"
+" private Parent parent;\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2203
+#, no-c-format
+msgid ""
+"Note that in this mapping, the collection-valued end of the association is "
+"responsible for updating the foreign key."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:2208
+#, no-c-format
+msgid "Bag with primary key"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2210
+#, no-c-format
+msgid ""
+"Another interesting feature is the ability to define a surrogate primary key
"
+"to a bag collection. This remove pretty much all of the drawbacks of bags: "
+"update and removal are efficient, more than one
<literal>EAGER</literal> bag "
+"per query or per entity. This primary key will be contained in a additional "
+"column of your collection table but will not be visible to the Java "
+"application. @CollectionId is used to mark a collection as id bag, it also "
+"allow to override the primary key column(s), the primary key type and the "
+"generator strategy. The strategy can be <literal>identity</literal>, or
any "
+"defined generator name of your application."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2221
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@TableGenerator(name=\"ids_generator\", table=\"IDS\")\n"
+"public class Passport {\n"
+" ...\n"
+"\n"
+" @ManyToMany(cascade = CascadeType.ALL)\n"
+" @JoinTable(name=\"PASSPORT_VISASTAMP\")\n"
+" <emphasis role=\"bold\">@CollectionId(\n"
+" columns = @Column(name=\"COLLECTION_ID\"), \n"
+" type=@Type(type=\"long\"), \n"
+" generator = \"ids_generator\"\n"
+" )</emphasis>\n"
+" private Collection<Stamp> visaStamp = new ArrayList();\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:2225
+#, no-c-format
+msgid "Collection of element or composite elements"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2227
+#, no-c-format
+msgid ""
+"Hibernate Annotations also supports collections of core types (Integer, "
+"String, Enums, ...), collections of embeddable objects and even arrays of "
+"primitive types. This is known as collection of elements."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2232
+#, no-c-format
+msgid ""
+"A collection of elements has to be annotated as "
+"<literal>@CollectionOfElements</literal> (as a replacement of "
+"<literal>@OneToMany</literal>) To define the collection table, the
"
+"<literal>@JoinTable</literal> annotation is used on the association
"
+"property, <literal>joinColumns</literal> defines the join columns
between "
+"the entity primary table and the collection table (inverseJoincolumn is "
+"useless and should be left empty). For collection of core types or array of "
+"primitive types, you can override the element column definition using a "
+"<literal>@Column</literal> on the association property. You can also
"
+"override the columns of a collection of embeddable object using "
+"<literal>@AttributeOverride</literal>. To reach the collection element,
you "
+"need to append \"element\" to the attribute override name (eg
\"element\" "
+"for core types, or \"element.serial\" for the serial property of an
"
+"embeddable element). To reach the index/key of a collection, append
\"key\" "
+"instead."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2249
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Boy {\n"
+" private Integer id;\n"
+" private Set<String> nickNames = new
HashSet<String>();\n"
+" private int[] favoriteNumbers;\n"
+" private Set<Toy> favoriteToys = new
HashSet<Toy>();\n"
+" private Set<Character> characters = new
HashSet<Character>"
+"();\n"
+"\n"
+" @Id @GeneratedValue\n"
+" public Integer getId() {\n"
+" return id;\n"
+" }\n"
+"\n"
+" <emphasis role=\"bold\">@CollectionOfElements\n"
+" public Set<String></emphasis> getNickNames() {\n"
+" return nickNames;\n"
+" }\n"
+"\n"
+" <emphasis role=\"bold\">@CollectionOfElements\n"
+" @JoinTable(\n"
+" table=@Table(name=\"BoyFavoriteNumbers\"),\n"
+" joinColumns = @JoinColumn(name=\"BoyId\")\n"
+" )\n"
+" @Column(name=\"favoriteNumber\",
nullable=false)</emphasis>\n"
+" @IndexColumn(name=\"nbr_index\")\n"
+" public int[] getFavoriteNumbers() {\n"
+" return favoriteNumbers;\n"
+" }\n"
+"\n"
+" <emphasis role=\"bold\">@CollectionOfElements\n"
+" @AttributeOverride( name=\"element.serial\",
column=@Column(name="
+"\"serial_nbr\") )</emphasis>\n"
+" public Set<Toy> getFavoriteToys() {\n"
+" return favoriteToys;\n"
+" }\n"
+"\n"
+" <emphasis role=\"bold\">@CollectionOfElements\n"
+" public Set<Character></emphasis> getCharacters() {\n"
+" return characters;\n"
+" }\n"
+" ...\n"
+"}\n"
+"\n"
+"public enum Character {\n"
+" GENTLE,\n"
+" NORMAL,\n"
+" AGGRESSIVE,\n"
+" ATTENTIVE,\n"
+" VIOLENT,\n"
+" CRAFTY\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"public class Toy {\n"
+" public String name;\n"
+" public String serial;\n"
+" public Boy owner;\n"
+"\n"
+" public String getName() {\n"
+" return name;\n"
+" }\n"
+"\n"
+" public void setName(String name) {\n"
+" this.name = name;\n"
+" }\n"
+"\n"
+" public String getSerial() {\n"
+" return serial;\n"
+" }\n"
+"\n"
+" public void setSerial(String serial) {\n"
+" this.serial = serial;\n"
+" }\n"
+"\n"
+" <emphasis role=\"bold\">@Parent</emphasis>\n"
+" public Boy getOwner() {\n"
+" return owner;\n"
+" }\n"
+"\n"
+" public void setOwner(Boy owner) {\n"
+" this.owner = owner;\n"
+" }\n"
+"\n"
+" public boolean equals(Object o) {\n"
+" if ( this == o ) return true;\n"
+" if ( o == null || getClass() != o.getClass() ) return false;\n"
+"\n"
+" final Toy toy = (Toy) o;\n"
+"\n"
+" if ( !name.equals( toy.name ) ) return false;\n"
+" if ( !serial.equals( toy.serial ) ) return false;\n"
+"\n"
+" return true;\n"
+" }\n"
+"\n"
+" public int hashCode() {\n"
+" int result;\n"
+" result = name.hashCode();\n"
+" result = 29 * result + serial.hashCode();\n"
+" return result;\n"
+" }\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2251
+#, no-c-format
+msgid ""
+"On a collection of embeddable objects, the embeddable object can have a "
+"property annotated with <literal>@Parent</literal>. This property will
then "
+"point back to the entity containing the collection."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2257
+#, no-c-format
+msgid ""
+"Previous versions of Hibernate Annotations used the
<literal>@OneToMany</"
+"literal> to mark a collection of elements. Due to semantic inconsistencies,
"
+"we've introduced the annotation
<literal>@CollectionOfElements</literal>. "
+"Marking collections of elements the old way still work but is considered "
+"deprecated and is going to be unsupported in future releases"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:2267
+#, no-c-format
+msgid "@ManyToAny"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2269
+#, no-c-format
+msgid ""
+"<classname>@ManyToAny</classname> allows polymorphic associations to
classes "
+"from multiple tables. This type of mapping always requires more than one "
+"column. The first column holds the type of the associated entity. The "
+"remaining columns hold the identifier. It is impossible to specify a foreign
"
+"key constraint for this kind of association, so this is most certainly not "
+"meant as the usual way of mapping (polymorphic) associations. You should use
"
+"this only in very special cases (eg. audit logs, user session data, etc)."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2279
+#, no-c-format
+msgid ""
+"@ManyToAny(\n"
+" metaColumn = @Column( name = \"property_type\" ) )\n"
+" @AnyMetaDef( \n"
+" idType = \"integer\", \n"
+" metaType = \"string\",\n"
+" metaValues = {\n"
+" @MetaValue( value = \"S\", targetEntity =
StringProperty."
+"class ),\n"
+" @MetaValue( value = \"I\", targetEntity =
IntegerProperty."
+"class ) } )\n"
+" @Cascade( { org.hibernate.annotations.CascadeType.ALL } )\n"
+" @JoinTable( name = \"obj_properties\", joinColumns = @JoinColumn(
name = "
+"\"obj_id\" ),\n"
+" inverseJoinColumns = @JoinColumn( name = \"property_id\" )
)\n"
+" public List<Property> getGeneralProperties() {"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2281
+#, no-c-format
+msgid ""
+"Like <classname>@Any</classname>,
<classname>@ManyToAny</classname> can use "
+"named <classname>@AnyDef</classname>s, see <xref
linkend=\"entity-hibspec-"
+"singleassoc-any\"/> for more info."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:2290
+#, no-c-format
+msgid "Cascade"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2292
+#, no-c-format
+msgid ""
+"Hibernate offers more operations than the Java Persistence specification. "
+"You can use the <literal>@Cascade</literal> annotation to cascade the
"
+"following operations:"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2298
+#, no-c-format
+msgid "PERSIST"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2302
+#, no-c-format
+msgid "MERGE"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2306
+#, no-c-format
+msgid "REMOVE"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2310
+#, no-c-format
+msgid "REFRESH"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2314
+#, no-c-format
+msgid "DELETE"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2318
+#, no-c-format
+msgid "SAVE_UPDATE"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2322
+#, no-c-format
+msgid "REPLICATE"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2326
+#, no-c-format
+msgid "DELETE_ORPHAN"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2330
+#, no-c-format
+msgid "LOCK"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2334
+#, no-c-format
+msgid "EVICT"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2338
+#, no-c-format
+msgid ""
+"This is especially useful for <literal>SAVE_UPDATE</literal> (which is
the "
+"operation cascaded at flush time if you use plain Hibernate Annotations - "
+"Hibernate EntityManager cascade <literal>PERSIST</literal> at flush
time as "
+"per the specification). DELETE_ORPHAN applies only to
<literal>@OneToMany</"
+"literal> associations, and indicates that the
<methodname>delete()/remove()</"
+"methodname> operation should be applied to any child object that is removed
"
+"from the association. In other words, if a child is dereferenced by a "
+"persistent parent and if <literal>DELETE_ORPHAN</literal> is used, the
"
+"\"orphaned\" child is deleted."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2350
+#, no-c-format
+msgid ""
+"@OneToMany( cascade = {CascadeType.PERSIST, CascadeType.MERGE}
<emphasis\n"
+" role=\"bold\">)\n"
+"(a)Cascade({org.hibernate.annotations.CascadeType.SAVE_UPDATE,\n"
+"
org.hibernate.annotations.CascadeType.DELETE_ORPHAN})</emphasis>\n"
+"public Collection<Employer> getEmployers()"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2352
+#, no-c-format
+msgid ""
+"It is recommended to use @Cascade to compliment @*To*(cascade=...) as shown "
+"in the previous example."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:2357
+#, no-c-format
+msgid "Cache"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2359
+#, no-c-format
+msgid ""
+"In order to optimize your database accesses, you can activate the so called "
+"second level cache of Hibernate. This cache is configurable on a per entity "
+"and per collection basis."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2363
+#, no-c-format
+msgid ""
+"<literal>(a)org.hibernate.annotations.Cache</literal> defines the caching
"
+"strategy and region of a given second level cache. This annotation can be "
+"applied on the root entity (not the sub entities), and on the collections."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2368
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)\n"
+"public class Forest { ... }"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2370
+#, no-c-format
+msgid ""
+"(a)OneToMany(cascade=CascadeType.ALL, fetch=FetchType.EAGER)\n"
+" @JoinColumn(name=\"CUST_ID\")\n"
+" @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)\n"
+" public SortedSet<Ticket> getTickets() {\n"
+" return tickets;\n"
+" }"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2383
+#, no-c-format
+msgid ""
+"@Cache(\n"
+" CacheConcurrencyStrategy usage();\n"
+" String region() default \"\";\n"
+" String include() default \"all\";\n"
+")"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2387
+#, no-c-format
+msgid ""
+"usage: the given cache concurrency strategy (NONE, READ_ONLY, "
+"NONSTRICT_READ_WRITE, READ_WRITE, TRANSACTIONAL)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2392
+#, no-c-format
+msgid ""
+"region (optional): the cache region (default to the fqcn of the class or the
"
+"fq role name of the collection)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2397
+#, no-c-format
+msgid ""
+"<literal>include</literal> (optional): all to include all properties,
non-"
+"lazy to only include non lazy properties (default all)."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:2406
+#, no-c-format
+msgid "Filters"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2408
+#, no-c-format
+msgid ""
+"Hibernate has the ability to apply arbitrary filters on top of your data. "
+"Those filters are applied at runtime on a given session. First, you need to "
+"define them."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2412
+#, no-c-format
+msgid ""
+"<literal>(a)org.hibernate.annotations.FilterDef</literal> or "
+"<literal>@FilterDefs</literal> define filter definition(s) used by
filter(s) "
+"using the same name. A filter definition has a name() and an array of "
+"parameters(). A parameter will allow you to adjust the behavior of the "
+"filter at runtime. Each parameter is defined by a
<literal>@ParamDef</"
+"literal> which has a name and a type. You can also define a
defaultCondition"
+"() parameter for a given <literal>@FilterDef</literal> to set the
default "
+"condition to use when none are defined in each individual
<literal>@Filter</"
+"literal>. A <literal>@FilterDef</literal>(s) can be defined at the
class or "
+"package level."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2424
+#, no-c-format
+msgid ""
+"We now need to define the SQL filter clause applied to either the entity "
+"load or the collection load. <literal>@Filter</literal> is used and
placed "
+"either on the entity or the collection element"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2428
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@FilterDef(name=\"minLength\", parameters=@ParamDef(
name=\"minLength\", "
+"type=\"integer\" ) )\n"
+"@Filters( {\n"
+" @Filter(name=\"betweenLength\", condition=\":minLength <=
length and :"
+"maxLength >= length\"),\n"
+" @Filter(name=\"minLength\", condition=\":minLength <=
length\")\n"
+"} )\n"
+"public class Forest { ... }"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2430
+#, no-c-format
+msgid ""
+"When the collection use an association table as a relational representation,
"
+"you might want to apply the filter condition to the association table itself
"
+"or to the target entity table. To apply the constraint on the target entity,
"
+"use the regular <literal>@Filter</literal> annotation. However, if you
wan "
+"to target the association table, use the
<literal>@FilterJoinTable</literal> "
+"annotation."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2438
+#, no-c-format
+msgid ""
+"@OneToMany\n"
+" @JoinTable\n"
+" //filter on the target entity table\n"
+" @Filter(name=\"betweenLength\", condition=\":minLength <=
length and :"
+"maxLength >= length\")\n"
+" //filter on the association table\n"
+" @FilterJoinTable(name=\"security\", condition=\":userlevel
>= "
+"requredLevel\")\n"
+" public Set<Forest> getForests() { ... }"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:2442
+#, no-c-format
+msgid "Queries"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2444
+#, no-c-format
+msgid ""
+"Since Hibernate has more features on named queries than the one defined in "
+"the EJB3 specification,
<literal>(a)org.hibernate.annotations.NamedQuery</"
+"literal>,
<literal>(a)org.hibernate.annotations.NamedQueries</literal>, "
+"<literal>(a)org.hibernate.annotations.NamedNativeQuery</literal> and
"
+"<literal>(a)org.hibernate.annotations.NamedNativeQueries</literal> have
been "
+"introduced. They add some attributes to the standard version and can be used
"
+"as a replacement:"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2455
+#, no-c-format
+msgid "flushMode: define the query flush mode (Always, Auto, Commit or
Manual)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2460
+#, no-c-format
+msgid "cacheable: whether the query should be cached or not"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2464
+#, no-c-format
+msgid "cacheRegion: cache region used if the query is cached"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2468
+#, no-c-format
+msgid "fetchSize: JDBC statement fetch size for this query"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2472
+#, no-c-format
+msgid "timeout: query time out"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2476
+#, no-c-format
+msgid ""
+"callable: for native queries only, to be set to true for stored procedures"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2481
+#, no-c-format
+msgid ""
+"comment: if comments are activated, the comment seen when the query is sent "
+"to the database."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2486
+#, no-c-format
+msgid "cacheMode: Cache interaction mode (get, ignore, normal, put or
refresh)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2491
+#, no-c-format
+msgid ""
+"readOnly: whether or not the elements retrievent from the query are in read "
+"only mode."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2496
+#, no-c-format
+msgid ""
+"Those hints can be set in a standard
<literal>(a)javax.persistence.NamedQuery</"
+"literal> annotations through the detyped
<literal>@QueryHint</literal>. "
+"Another key advantage is the ability to set those annotations at a package "
+"level."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:2503
+#, no-c-format
+msgid "Custom SQL for CRUD operations"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2505
+#, no-c-format
+msgid ""
+"Hibernate gives you the ability to override every single SQL statement "
+"generated. We have seen native SQL query usage already, but you can also "
+"override the SQL statement used to load or change the state of entities."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2510
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Table(name=\"CHAOS\")\n"
+"<emphasis role=\"bold\">@SQLInsert( sql=\"INSERT INTO
CHAOS(size, name, "
+"nickname, id) VALUES(?,upper(?),?,?)\")\n"
+"@SQLUpdate( sql=\"UPDATE CHAOS SET size = ?, name = upper(?), nickname = ?
"
+"WHERE id = ?\")\n"
+"@SQLDelete( sql=\"DELETE CHAOS WHERE id = ?\")\n"
+"@SQLDeleteAll( sql=\"DELETE CHAOS\")\n"
+"</emphasis><emphasis role=\"bold\">@Loader(namedQuery =
\"chaos\")</"
+"emphasis>\n"
+"@NamedNativeQuery(name=\"chaos\", query=\"select id, size, name,
lower"
+"( nickname ) as nickname from CHAOS where id= ?\", resultClass = Chaos."
+"class)\n"
+"public class Chaos {\n"
+" @Id\n"
+" private Long id;\n"
+" private Long size;\n"
+" private String name;\n"
+" private String nickname;"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2512
+#, no-c-format
+msgid ""
+"<literal>@SQLInsert</literal>,
<literal>@SQLUpdate</literal>, "
+"<literal>@SQLDelete</literal>,
<literal>@SQLDeleteAll</literal> respectively "
+"override the INSERT statement, UPDATE statement, DELETE statement, DELETE "
+"statement to remove all entities."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2517
+#, no-c-format
+msgid ""
+"If you expect to call a store procedure, be sure to set the "
+"<literal>callable</literal> attribute to true
(<literal>@SQLInsert"
+"(callable=true, ...)</literal>)."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2521
+#, no-c-format
+msgid ""
+"To check that the execution happens correctly, Hibernate allows you to "
+"define one of those three strategies:"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2526
+#, no-c-format
+msgid ""
+"NONE: no check is performed: the store procedure is expected to fail upon "
+"issues"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2531
+#, no-c-format
+msgid "COUNT: use of rowcount to check that the update is successful"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2536
+#, no-c-format
+msgid ""
+"PARAM: like COUNT but using an output parameter rather that the standard "
+"mechanism"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2541
+#, no-c-format
+msgid ""
+"To define the result check style, use the <literal>check</literal>
parameter "
+"(<literal>(a)SQLUpdate(check=ResultCheckStyle.COUNT,
...)</literal>)."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2545
+#, no-c-format
+msgid ""
+"You can also override the SQL load statement by a native SQL query or a HQL "
+"query. You just have to refer to a named query with the "
+"<literal><literal>@Loader</literal></literal>
annotation."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2549
+#, no-c-format
+msgid ""
+"You can use the exact same set of annotations to override the collection "
+"related statements."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2552
+#, no-c-format
+msgid ""
+"@OneToMany\n"
+"@JoinColumn(name=\"chaos_fk\")\n"
+"<emphasis role=\"bold\">@SQLInsert( sql=\"UPDATE
CASIMIR_PARTICULE SET "
+"chaos_fk = ? where id = ?\")\n"
+"@SQLDelete( sql=\"UPDATE CASIMIR_PARTICULE SET chaos_fk = null where id =
?"
+"\")</emphasis>\n"
+"private Set<CasimirParticle> particles = new HashSet<"
+"CasimirParticle>();"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2554
+#, no-c-format
+msgid ""
+"The parameters order is important and is defined by the order Hibernate "
+"handle properties. You can see the expected order by enabling debug logging "
+"for the <literal>org.hibernate.persister.entity</literal> level. With
this "
+"level enabled Hibernate will print out the static SQL that is used to "
+"create, update, delete etc. entities. (To see the expected sequence, "
+"remember to not include your custom SQL through annotations as that will "
+"override the Hibernate generated static sql.)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2563
+#, no-c-format
+msgid ""
+"Overriding SQL statements for secondary tables is also possible using "
+"<literal>(a)org.hibernate.annotations.Table</literal> and either (or all)
"
+"attributes <literal>sqlInsert</literal>,
<literal>sqlUpdate</literal>, "
+"<literal>sqlDelete</literal>:"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2568
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@SecondaryTables({\n"
+" @SecondaryTable(name = \"`Cat nbr1`\"),\n"
+" @SecondaryTable(name = \"Cat2\"})\n"
+"(a)org.hibernate.annotations.Tables( {\n"
+" @Table(appliesTo = \"Cat\", comment = \"My cat table\"
),\n"
+" @Table(appliesTo = \"Cat2\", foreignKey =
@ForeignKey(name=\"FK_CAT2_CAT"
+"\"), fetch = FetchMode.SELECT,\n"
+" <emphasis
role=\"bold\">sqlInsert=@SQLInsert(sql=\"insert into Cat2"
+"(storyPart2, id) values(upper(?), ?)\") )</emphasis>\n"
+"} )\n"
+"public class Cat implements Serializable {"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2570
+#, no-c-format
+msgid ""
+"The previous example also show that you can give a comment to a given table "
+"(promary or secondary): This comment will be used for DDL generation."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:2576
+#, no-c-format
+msgid "Tuplizer"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2578
+#, no-c-format
+msgid ""
+"<classname>org.hibernate.tuple.Tuplizer</classname>, and its
sub-interfaces, "
+"are responsible for managing a particular representation of a piece of data,
"
+"given that representation's
<literal>org.hibernate.EntityMode</literal>. If "
+"a given piece of data is thought of as a data structure, then a tuplizer is "
+"the thing which knows how to create such a data structure and how to extract
"
+"values from and inject values into such a data structure. For example, for "
+"the POJO entity mode, the correpsonding tuplizer knows how create the POJO "
+"through its constructor and how to access the POJO properties using the "
+"defined property accessors. There are two high-level types of Tuplizers, "
+"represented by the
<classname>org.hibernate.tuple.EntityTuplizer</classname> "
+"and <classname>org.hibernate.tuple.ComponentTuplizer</classname>
interfaces. "
+"EntityTuplizers are responsible for managing the above mentioned contracts "
+"in regards to entities, while <classname>ComponentTuplizers</classname>
do "
+"the same for components. Check the Hibernate reference documentation for "
+"more information."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2596
+#, no-c-format
+msgid ""
+"To define tuplixer in annotations, simply use the
<literal>@Tuplizer</"
+"literal> annotation on the according element"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2599
+#, no-c-format
+msgid ""
+"@Entity\n"
+"<emphasis role=\"bold\">@Tuplizer(impl =
DynamicEntityTuplizer.class)</"
+"emphasis>\n"
+"public interface Cuisine {\n"
+" @Id\n"
+" @GeneratedValue\n"
+" public Long getId();\n"
+" public void setId(Long id);\n"
+"\n"
+" public String getName();\n"
+" public void setName(String name);\n"
+"\n"
+" <emphasis role=\"bold\">@Tuplizer(impl =
DynamicComponentTuplizer.class)"
+"</emphasis>\n"
+" public Country getCountry();\n"
+" public void setCountry(Country country);\n"
+"\n"
+"\n"
+"}"
+msgstr ""
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/de-DE/setup.po
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/de-DE/setup.po
(rev 0)
+++ annotations/branches/v3_4_0_GA_CP/src/main/docbook/de-DE/setup.po 2009-12-22 06:50:19
UTC (rev 18313)
@@ -0,0 +1,319 @@
+#. Tag: title
+#: setup.xml:28
+#, no-c-format
+msgid "Setting up an annotations project"
+msgstr ""
+
+#. Tag: title
+#: setup.xml:31
+#, no-c-format
+msgid "Requirements"
+msgstr ""
+
+#. Tag: para
+#: setup.xml:35
+#, no-c-format
+msgid ""
+"<ulink
url=\"http://www.hibernate.org/6.html\">Download</ulink> and unpack
"
+"the Hibernate Annotations distribution from the Hibernate website."
+msgstr ""
+
+#. Tag: emphasis
+#: setup.xml:41
+#, no-c-format
+msgid "This release requires Hibernate Core 3.3 and above."
+msgstr ""
+
+#. Tag: para
+#: setup.xml:46
+#, no-c-format
+msgid "This release is known to work on Hibernate Core 3.3.0.SP1"
+msgstr ""
+
+#. Tag: para
+#: setup.xml:50
+#, no-c-format
+msgid ""
+"Make sure you have JDK 5.0 installed or above. You can of course continue "
+"using XDoclet and get some of the benefits of annotation-based metadata with
"
+"older JDK versions. Note that this document only describes JDK 5.0 "
+"annotations and you have to refer to the XDoclet documentation for more "
+"information."
+msgstr ""
+
+#. Tag: title
+#: setup.xml:60
+#, no-c-format
+msgid "Configuration"
+msgstr ""
+
+#. Tag: para
+#: setup.xml:62
+#, no-c-format
+msgid ""
+"First, set up your classpath (after you have created a new project in your "
+"favorite IDE):"
+msgstr ""
+
+#. Tag: para
+#: setup.xml:65
+#, no-c-format
+msgid ""
+"Copy all Hibernate3 core and required 3rd party library files (see lib/"
+"README.txt in Hibernate)."
+msgstr ""
+
+#. Tag: para
+#: setup.xml:70
+#, no-c-format
+msgid ""
+"Copy <filename>hibernate-annotations.jar</filename>,
<filename>lib/hibernate-"
+"comons-annotations.jar</filename> and
<filename>lib/ejb3-persistence.jar</"
+"filename> from the Hibernate Annotations distribution to your classpath as
"
+"well."
+msgstr ""
+
+#. Tag: para
+#: setup.xml:77
+#, no-c-format
+msgid ""
+"If you wish to use <ulink
url=\"http://validator.hibernate.org\">Hibernate "
+"Validator</ulink>, download it from the Hibernate website and add "
+"<filename>hibernate-validator.jar</filename> in your classpath."
+msgstr ""
+
+#. Tag: para
+#: setup.xml:82
+#, no-c-format
+msgid ""
+"If you wish to use <ulink
url=\"http://search.hibernate.org\">Hibernate "
+"Search</ulink>, download it from the Hibernate website and add "
+"<filename>hibernate-search.jar</filename> and
<filename>lucene-core-x.y.z."
+"jar</filename> in your classpath."
+msgstr ""
+
+#. Tag: para
+#: setup.xml:88
+#, no-c-format
+msgid ""
+"We also recommend a small wrapper class to startup Hibernate in a static "
+"initializer block, known as <classname>HibernateUtil</classname>. You
might "
+"have seen this class in various forms in other areas of the Hibernate "
+"documentation. For Annotation support you have to enhance this helper class "
+"as follows:"
+msgstr ""
+
+#. Tag: programlisting
+#: setup.xml:92
+#, no-c-format
+msgid ""
+"package hello;\n"
+"\n"
+"import org.hibernate.*;\n"
+"import org.hibernate.cfg.*;\n"
+"import test.*;\n"
+"import test.animals.Dog;\n"
+"\n"
+"public class HibernateUtil {\n"
+"\n"
+"private static final SessionFactory sessionFactory;\n"
+"\n"
+" static {\n"
+" try {\n"
+"\n"
+" sessionFactory = new <emphasis role=\"bold"
+"\">AnnotationConfiguration()</emphasis>\n"
+" configure().buildSessionFactory();\n"
+" } catch (Throwable ex) {\n"
+" // Log exception!\n"
+" throw new ExceptionInInitializerError(ex);\n"
+" }\n"
+" }\n"
+"\n"
+" public static Session getSession()\n"
+" throws HibernateException {\n"
+" return sessionFactory.openSession();\n"
+" }\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: setup.xml:94
+#, no-c-format
+msgid ""
+"Interesting here is the use of <classname>AnnotationConfiguration</"
+"classname>. The packages and annotated classes are declared in your regular
"
+"XML configuration file (usually
<filename>hibernate.cfg.xml</filename>). "
+"Here is the equivalent of the above declaration:"
+msgstr ""
+
+#. Tag: programlisting
+#: setup.xml:100
+#, no-c-format
+msgid ""
+"<!DOCTYPE hibernate-configuration PUBLIC\n"
+" \"-//Hibernate/Hibernate Configuration DTD 3.0//EN\"\n"
+" \"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"
+"\">\n"
+"\n"
+" <hibernate-configuration>\n"
+" <session-factory>\n"
+" <emphasis role=\"bold\"><mapping
package=\"test.animals\"/"
+">\n"
+" <mapping class=\"test.Flight\"/>\n"
+" <mapping class=\"test.Sky\"/>\n"
+" <mapping class=\"test.Person\"/>\n"
+" <mapping
class=\"test.animals.Dog\"/></emphasis>\n"
+"<emphasis role=\"bold\"> <mapping
resource=\"test/animals/orm."
+"xml\"/></emphasis>\n"
+" </session-factory>\n"
+" </hibernate-configuration>"
+msgstr ""
+
+#. Tag: para
+#: setup.xml:102
+#, no-c-format
+msgid ""
+"Note that you can mix the hbm.xml use and the new annotation one. The "
+"resource element can be either an hbm file or an EJB3 XML deployment "
+"descriptor. The distinction is transparent for your configuration process."
+msgstr ""
+
+#. Tag: para
+#: setup.xml:107
+#, no-c-format
+msgid ""
+"Alternatively, you can define the annotated classes and packages using the "
+"programmatic API"
+msgstr ""
+
+#. Tag: programlisting
+#: setup.xml:110
+#, no-c-format
+msgid ""
+"sessionFactory = new <emphasis
role=\"bold\">AnnotationConfiguration()\n"
+" .addPackage(\"test.animals\") //the fully qualified package
name\n"
+" .addAnnotatedClass(Flight.class)\n"
+" .addAnnotatedClass(Sky.class)\n"
+" .addAnnotatedClass(Person.class)\n"
+" .addAnnotatedClass(Dog.class)</emphasis>\n"
+"<emphasis
role=\"bold\">.addResource(\"test/animals/orm.xml\")</emphasis>\n"
+" configure()..buildSessionFactory();"
+msgstr ""
+
+#. Tag: para
+#: setup.xml:112
+#, no-c-format
+msgid ""
+"You can also use the Hibernate EntityManager which has its own configuration
"
+"mechanism. Please refer to this project documentation for more details."
+msgstr ""
+
+#. Tag: para
+#: setup.xml:116
+#, no-c-format
+msgid ""
+"There is no other difference in the way you use Hibernate APIs with "
+"annotations, except for this startup routine change or in the configuration "
+"file. You can use your favorite configuration method for other properties "
+"( <filename>hibernate.properties</filename>,
<filename>hibernate.cfg.xml</"
+"filename>, programmatic APIs, etc). You can even mix annotated persistent
"
+"classes and classic <filename>hbm.cfg.xml</filename> declarations with
the "
+"same <classname>SessionFactory</classname>. You can however not declare
a "
+"class several times (whether annotated or through hbm.xml). You cannot mix "
+"configuration strategies (hbm vs annotations) in a mapped entity hierarchy "
+"either."
+msgstr ""
+
+#. Tag: para
+#: setup.xml:128
+#, no-c-format
+msgid ""
+"To ease the migration process from hbm files to annotations, the "
+"configuration mechanism detects the mapping duplication between annotations "
+"and hbm files. HBM files are then prioritized over annotated metadata on a "
+"class to class basis. You can change the priority using
<literal>hibernate."
+"mapping.precedence</literal> property. The default is <literal>hbm,
class</"
+"literal>, changing it to <literal>class, hbm</literal> will
prioritize the "
+"annotated classes over hbm files when a conflict occurs."
+msgstr ""
+
+#. Tag: title
+#: setup.xml:139
+#, no-c-format
+msgid "Properties"
+msgstr ""
+
+#. Tag: para
+#: setup.xml:141
+#, no-c-format
+msgid ""
+"Asides from the Hibernate core properties, Hibernate Annotations reacts to "
+"the following one"
+msgstr ""
+
+#. Tag: title
+#: setup.xml:146
+#, no-c-format
+msgid "Logging"
+msgstr ""
+
+#. Tag: para
+#: setup.xml:148
+#, no-c-format
+msgid ""
+"Hibernate Annotations utilizes <ulink
url=\"http://www.slf4j.org/\">Simple "
+"Logging Facade for Java</ulink> (SLF4J) in order to log various system
"
+"events. SLF4J can direct your logging output to several logging frameworks "
+"(NOP, Simple, log4j version 1.2, JDK 1.4 logging, JCL or logback) depending "
+"on your chosen binding. In order to setup logging properly you will need "
+"<filename>slf4j-api.jar</filename> in your classpath together with the
jar "
+"file for your preferred binding -
<filename>slf4j-log4j12.jar</filename> in "
+"the case of Log4J. See the SLF4J <ulink type=\"\"
url=\"http://www.slf4j.org/"
+"manual.html\">documentation</ulink> for more detail."
+msgstr ""
+
+#. Tag: para
+#: setup.xml:160
+#, no-c-format
+msgid "The logging categories interesting for Hibernate Annotations are:"
+msgstr ""
+
+#. Tag: title
+#: setup.xml:164
+#, no-c-format
+msgid "Hibernate Annotations Log Categories"
+msgstr ""
+
+#. Tag: entry
+#: setup.xml:169
+#, no-c-format
+msgid "Category"
+msgstr ""
+
+#. Tag: entry
+#: setup.xml:171
+#, no-c-format
+msgid "Function"
+msgstr ""
+
+#. Tag: emphasis
+#: setup.xml:177
+#, no-c-format
+msgid "org.hibernate.cfg"
+msgstr ""
+
+#. Tag: entry
+#: setup.xml:179
+#, no-c-format
+msgid "Log all configuration related events (not only annotations)."
+msgstr ""
+
+#. Tag: para
+#: setup.xml:186
+#, no-c-format
+msgid ""
+"For further category configuration refer to the <ulink
url=\"http://www."
+"hibernate.org/hib_docs/v3/reference/en/html_single/#configuration-logging"
+"\">Logging</ulink> in the Hibernate Core documentation."
+msgstr ""
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/de-DE/xml-overriding.po
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/de-DE/xml-overriding.po
(rev 0)
+++ annotations/branches/v3_4_0_GA_CP/src/main/docbook/de-DE/xml-overriding.po 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,415 @@
+#. Tag: title
+#: xml-overriding.xml:28
+#, no-c-format
+msgid "Overriding metadata through XML"
+msgstr ""
+
+#. Tag: para
+#: xml-overriding.xml:30
+#, no-c-format
+msgid ""
+"The primary target for metadata in EJB3 is annotations, but the EJB3 "
+"specification provides a way to override or replace the annotation defined "
+"metadata through an XML deployment descriptor. In the current release only "
+"pure EJB3 annotations overriding are supported. If you wish to use Hibernate
"
+"specific features in some entities, you'll have to either use annotations or
"
+"fallback to hbm files. You can of course mix and match annotated entities "
+"and entities describes in hbm files."
+msgstr ""
+
+#. Tag: para
+#: xml-overriding.xml:38
+#, no-c-format
+msgid "The unit test suite shows some additional XML file samples."
+msgstr ""
+
+#. Tag: title
+#: xml-overriding.xml:41
+#, no-c-format
+msgid "Principles"
+msgstr ""
+
+#. Tag: para
+#: xml-overriding.xml:43
+#, no-c-format
+msgid ""
+"The XML deployment descriptor structure has been designed to reflect the "
+"annotations one. So if you know the annotations structure, using the XML "
+"schema will be straightforward for you."
+msgstr ""
+
+#. Tag: para
+#: xml-overriding.xml:47
+#, no-c-format
+msgid ""
+"You can define one ot more XML files describing your metadata, these files "
+"will be merged by the overriding engine."
+msgstr ""
+
+#. Tag: title
+#: xml-overriding.xml:51
+#, no-c-format
+msgid "Global level metadata"
+msgstr ""
+
+#. Tag: para
+#: xml-overriding.xml:53
+#, no-c-format
+msgid ""
+"You can define global level metadata available for all XML files. You must "
+"not define these metadata more than once per deployment."
+msgstr ""
+
+#. Tag: programlisting
+#: xml-overriding.xml:56
+#, no-c-format
+msgid ""
+"<?xml version=\"1.0\"
encoding=\"UTF-8\"?>\n"
+"\n"
+"<entity-mappings \n"
+"
xmlns=\"http://java.sun.com/xml/ns/persistence/orm\"\n"
+"
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
+"
xsi:schemaLocation=\"http://java.sun.com/xml/ns/persistence/orm
orm_1_0.xsd"
+"\"\n"
+" version=\"1.0\">\n"
+"\n"
+" <persistence-unit-metadata>\n"
+" <xml-mapping-metadata-complete/>\n"
+" <persistence-unit-defaults>\n"
+" <schema>myschema</schema>\n"
+" <catalog>mycatalog</catalog>\n"
+" <cascade-persist/>\n"
+" </persistence-unit-defaults>\n"
+" </persistence-unit-metadata>"
+msgstr ""
+
+#. Tag: para
+#: xml-overriding.xml:58
+#, no-c-format
+msgid ""
+"<literal>xml-mapping-metadata-complete</literal> means that all entity,
"
+"mapped-superclasses and embeddable metadata should be picked up from XML (ie
"
+"ignore annotations)."
+msgstr ""
+
+#. Tag: para
+#: xml-overriding.xml:62
+#, no-c-format
+msgid ""
+"<literal>schema / catalog</literal> will override all default
definitions of "
+"schema and catalog in the metadata (both XML and annotations)."
+msgstr ""
+
+#. Tag: para
+#: xml-overriding.xml:66
+#, no-c-format
+msgid ""
+"<literal>cascade-persist</literal> means that all associations have
PERSIST "
+"as a cascade type. We recommend you to not use this feature."
+msgstr ""
+
+#. Tag: title
+#: xml-overriding.xml:72
+#, no-c-format
+msgid "Entity level metadata"
+msgstr ""
+
+#. Tag: para
+#: xml-overriding.xml:74
+#, no-c-format
+msgid ""
+"You can either define or override metadata informations on a given entity."
+msgstr ""
+
+#. Tag: section
+#: xml-overriding.xml:75
+#, no-c-format
+msgid ""
+"<programlistingco> <areaspec> <area coords=\"3 85\"
id=\"aa1\"/> <area "
+"coords=\"9 85\" id=\"aa2\"/> <area coords=\"10
85\" id=\"aa3\"/> <area "
+"coords=\"11 85\" id=\"aa4\"/> <area coords=\"17
85\" id=\"aa5\"/> <area "
+"coords=\"23 85\" id=\"aa6\"/> <area coords=\"24
85\" id=\"aa7\"/> <area "
+"coords=\"25 85\" id=\"aa8\"/> <area coords=\"26
85\" id=\"aa9\"/> <area "
+"coords=\"31 85\" id=\"aa10\"/> </areaspec>
<programlisting><?xml version="
+"\"1.0\" encoding=\"UTF-8\"?>\n"
+"\n"
+"<entity-mappings \n"
+"
xmlns=\"http://java.sun.com/xml/ns/persistence/orm\"\n"
+"
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
+"
xsi:schemaLocation=\"http://java.sun.com/xml/ns/persistence/orm
orm_1_0.xsd"
+"\"\n"
+" version=\"1.0\">\n"
+"\n"
+"
<package>org.hibernate.test.annotations.reflection</"
+"package>\n"
+" <entity class=\"Administration\" access=\"PROPERTY\"
metadata-"
+"complete=\"true\">\n"
+" <table name=\"tbl_admin\">\n"
+" <unique-constraint>\n"
+"
<column-name>firstname</column-name>\n"
+"
<column-name>lastname</column-name>\n"
+" </unique-constraint>\n"
+" </table>\n"
+" <secondary-table name=\"admin2\">\n"
+" <primary-key-join-column name=\"admin_id\"
referenced-column-"
+"name=\"id\"/>\n"
+" <unique-constraint>\n"
+"
<column-name>address</column-name>\n"
+" </unique-constraint>\n"
+" </secondary-table>\n"
+" <id-class class=\"SocialSecurityNumber\"/>\n"
+" <inheritance strategy=\"JOINED\"/>\n"
+" <sequence-generator name=\"seqhilo\"
sequence-name=\"seqhilo\"/"
+">\n"
+" <table-generator name=\"table\"
table=\"tablehilo\"/>\n"
+" ...\n"
+" </entity>\n"
+"\n"
+" <entity class=\"PostalAdministration\">\n"
+" <primary-key-join-column name=\"id\"/>\n"
+" ...\n"
+" </entity>\n"
+"</entity-mappings></programlisting> <calloutlist>
<callout arearefs="
+"\"aa1\"> <para><literal>entity-mappings</literal>:
entity-mappings is the "
+"root element for all XML files. You must declare the xml schema, the schema "
+"file is included in the hibernate-annotations.jar file, no internet access "
+"will be processed by Hibernate Annotations.</para> </callout>
<callout "
+"arearefs=\"aa2\"> <para><literal>package</literal>
(optional): default "
+"package used for all non qualified class names in the given deployment "
+"descriptor file.</para> </callout> <callout
arearefs=\"aa3\"> "
+"<para><literal>entity</literal>: desribes an entity.</para>
"
+"<para><literal>metadata-complete</literal> defines whether the
metadata "
+"description for this element is complete or not (in other words, if "
+"annotations present at the class level should be considered or not).</para>
"
+"<para>An entity has to have a <literal>class</literal> attribute
refering "
+"the java class the metadata applies on.</para> <para>You can overrides
"
+"entity name through the <literal>name</literal> attribute, if none is
"
+"defined and if an <literal>(a)Entity.name</literal> is present, then it
is "
+"used (provided that metadata complete is not set).</para> <para>For
metadata "
+"complete (see below) element, you can define an
<literal>access</literal> "
+"(either <literal>FIELD</literal> or
<literal>PROPERTY</literal> (default)). "
+"For non medatada complete element, if <literal>access</literal> is not
"
+"defined, the @Id position will lead position, if
<literal>access</literal> "
+"is defined, the value is used.</para> </callout> <callout
arearefs=\"aa4\"> "
+"<para><literal>table</literal>: you can declare table properties
(name, "
+"schema, catalog), if none is defined, the java annotation is used.</para>
"
+"<para>You can define one or several unique constraints as seen in the "
+"example</para> </callout> <callout arearefs=\"aa5\">
"
+"<para><literal>secondary-table</literal>: defines a secondary
table very "
+"much like a regular table except that you can define the primary key / "
+"foreign key column(s) through the
<literal>primary-key-join-column</literal> "
+"element. On non metadata complete, annotation secondary tables are used only
"
+"if there is no <literal>secondary-table</literal> definition,
annotations "
+"are ignored otherwise.</para> </callout> <callout
arearefs=\"aa6\"> "
+"<para><literal>id-class</literal>: defines the id class in a
similar way "
+"<literal>@IdClass</literal> does</para> </callout>
<callout arearefs=\"aa7"
+"\"> <para><literal>inheritance</literal>: defines the
inheritance strategy "
+"(<literal>JOINED</literal>,
<literal>TABLE_PER_CLASS</literal>, "
+"<literal>SINGLE_TABLE</literal>), Available only at the root entity
level</"
+"para> </callout> <callout arearefs=\"aa8\">
<para><literal>sequence-"
+"generator</literal>: defines a sequence generator</para>
</callout> <callout "
+"arearefs=\"aa9\">
<para><literal>table-generator</literal>: defines a table "
+"generator</para> </callout> <callout arearefs=\"aa10\">
"
+"<para><literal><literal>primary-key-join-column</literal></literal>:
defines "
+"the primary key join column for sub entities when JOINED inheritance "
+"strategy is used</para> </callout> </calloutlist>
</programlistingco> "
+"<programlistingco> <areaspec> <area coords=\"11 85\"
id=\"ab1\"/> <area "
+"coords=\"18 85\" id=\"ab2\"/> <area coords=\"22
85\" id=\"ab3\"/> <area "
+"coords=\"28 85\" id=\"ab4\"/> <area coords=\"34
85\" id=\"ab5\"/> </"
+"areaspec> <programlisting><?xml version=\"1.0\"
encoding=\"UTF-8\"?>\n"
+"\n"
+"<entity-mappings \n"
+"
xmlns=\"http://java.sun.com/xml/ns/persistence/orm\"\n"
+"
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
+"
xsi:schemaLocation=\"http://java.sun.com/xml/ns/persistence/orm
orm_1_0.xsd"
+"\"\n"
+" version=\"1.0\">\n"
+"\n"
+"
<package>org.hibernate.test.annotations.reflection</"
+"package>\n"
+" <entity class=\"Music\" access=\"PROPERTY\"
metadata-complete=\"true"
+"\">\n"
+"
<discriminator-value>Generic</discriminator-value>\n"
+" <discriminator-column length=\"34\"/>\n"
+" ...\n"
+" </entity>\n"
+"\n"
+" <entity class=\"PostalAdministration\">\n"
+" <primary-key-join-column name=\"id\"/>\n"
+" <named-query name=\"adminById\">\n"
+" <query>select m from Administration m where m.id =
:id</"
+"query>\n"
+" <hint name=\"org.hibernate.timeout\"
value=\"200\"/>\n"
+" </named-query>\n"
+" <named-native-query name=\"allAdmin\"
result-set-mapping=\"adminrs"
+"\">\n"
+" <query>select *, count(taxpayer_id) as taxPayerNumber
\n"
+" from Administration, TaxPayer\n"
+" where taxpayer_admin_id = admin_id group by
...</query>\n"
+" <hint name=\"org.hibernate.timeout\"
value=\"200\"/>\n"
+" </named-native-query>\n"
+" <sql-result-set-mapping name=\"adminrs\">\n"
+" <entity-result
entity-class=\"Administration\">\n"
+" <field-result name=\"name\"
column=\"fld_name\"/>\n"
+" </entity-result>\n"
+" <column-result
name=\"taxPayerNumber\"/>\n"
+" </sql-result-set-mapping>\n"
+" <attribute-override name=\"ground\">\n"
+" <column name=\"fld_ground\" unique=\"true\"
scale=\"2\"/>\n"
+" </attribute-override>\n"
+" <association-override name=\"referer\">\n"
+" <join-column name=\"referer_id\"
referenced-column-name=\"id"
+"\"/>\n"
+" </association-override>\n"
+" ...\n"
+" </entity>\n"
+"</entity-mappings></programlisting> <calloutlist>
<callout arearefs="
+"\"ab1\"> <para><literal>discriminator-value /
discriminator-column</"
+"literal>: defines the discriminator value and the column holding it when the
"
+"SINGLE_TABLE inheritance strategy is chosen</para> </callout>
<callout "
+"arearefs=\"ab2\">
<para><literal>named-query</literal>: defines named "
+"queries and possibly the hints associated to them. Those definitions are "
+"additive to the one defined in annotations, if two definitions have the same
"
+"name, the XML one has priority.</para> </callout> <callout
arearefs=\"ab3\"> "
+"<para><literal>named-native-query</literal>: defines an named
native query "
+"and its sql result set mapping. Alternatively, you can define the "
+"<literal>result-class</literal>. Those definitions are additive to the
one "
+"defined in annotations, if two definitions have the same name, the XML one "
+"has priority.</para> </callout> <callout
arearefs=\"ab4\"> "
+"<para><literal>sql-result-set-mapping</literal>: describes the
result set "
+"mapping structure. You can define both entity and column mappings. Those "
+"definitions are additive to the one defined in annotations, if two "
+"definitions have the same name, the XML one has priority</para>
</callout> "
+"<callout arearefs=\"ab5\">
<para><literal>attribute-override / association-"
+"override</literal>: defines a column or join column overriding. This "
+"overriding is additive to the one defined in annotations</para>
</callout> </"
+"calloutlist> </programlistingco>"
+msgstr ""
+
+#. Tag: para
+#: xml-overriding.xml:246
+#, no-c-format
+msgid ""
+"Same applies for <literal><embeddable></literal> and
<literal><"
+"mapped-superclass></literal>."
+msgstr ""
+
+#. Tag: title
+#: xml-overriding.xml:251
+#, no-c-format
+msgid "Property level metadata"
+msgstr ""
+
+#. Tag: para
+#: xml-overriding.xml:253
+#, no-c-format
+msgid ""
+"You can of course defines XML overriding for properties. If metadata "
+"complete is defined, then additional properties (ie at the Java level) will "
+"be ignored. Otherwise, once you start overriding a property, all annotations
"
+"on the given property are ignored. All property level metadata behave in "
+"<literal>entity/attributes</literal>,
<literal>mapped-superclass/attributes</"
+"literal> or <literal>embeddable/attributes</literal>."
+msgstr ""
+
+#. Tag: programlisting
+#: xml-overriding.xml:261
+#, no-c-format
+msgid ""
+"<attributes>\n"
+" <id name=\"id\">\n"
+" <column name=\"fld_id\"/>\n"
+" <generated-value generator=\"generator\"
strategy=\"SEQUENCE"
+"\"/>\n"
+" <temporal>DATE</temporal>\n"
+" <sequence-generator name=\"generator\"
sequence-name=\"seq\"/"
+">\n"
+" </id>\n"
+" <version name=\"version\"/>\n"
+" <embedded name=\"embeddedObject\">\n"
+" <attribute-override
name\"subproperty\">\n"
+" <column name=\"my_column\"/>\n"
+" </attribute-override>\n"
+" </embedded>\n"
+" <basic name=\"status\"
optional=\"false\">\n"
+" <enumerated>STRING</enumerated>\n"
+" </basic>\n"
+" <basic name=\"serial\"
optional=\"true\">\n"
+" <column name=\"serialbytes\"/>\n"
+" <lob/>\n"
+" </basic>\n"
+" <basic name=\"terminusTime\"
fetch=\"LAZY\">\n"
+" <temporal>TIMESTAMP</temporal>\n"
+" </basic>\n"
+" </attributes>"
+msgstr ""
+
+#. Tag: para
+#: xml-overriding.xml:263
+#, no-c-format
+msgid ""
+"You can override a property through <literal>id</literal>,
<literal>embedded-"
+"id</literal>, <literal>version</literal>,
<literal>embedded</literal> and "
+"<literal>basic</literal>. Each of these elements can have subelements
"
+"accordingly: <literal>lob</literal>,
<literal>temporal</literal>, "
+"<literal>enumerated</literal>,
<literal>column</literal>."
+msgstr ""
+
+#. Tag: title
+#: xml-overriding.xml:272
+#, no-c-format
+msgid "Association level metadata"
+msgstr ""
+
+#. Tag: para
+#: xml-overriding.xml:274
+#, no-c-format
+msgid ""
+"You can define XML overriding for associations. All association level "
+"metadata behave in <literal>entity/attributes</literal>,
<literal>mapped-"
+"superclass/attributes</literal> or
<literal>embeddable/attributes</literal>."
+msgstr ""
+
+#. Tag: programlisting
+#: xml-overriding.xml:279
+#, no-c-format
+msgid ""
+"<attributes>\n"
+" <one-to-many name=\"players\"
fetch=\"EAGER\">\n"
+" <map-key name=\"name\"/>\n"
+" <join-column name=\"driver\"/>\n"
+" <join-column name=\"number\"/>\n"
+" </one-to-many>\n"
+" <many-to-many name=\"roads\"
target-entity=\"Administration"
+"\">\n"
+" <order-by>maxSpeed</order-by>\n"
+" <join-table name=\"bus_road\">\n"
+" <join-column name=\"driver\"/>\n"
+" <join-column name=\"number\"/>\n"
+" <inverse-join-column
name=\"road_id\"/>\n"
+" <unique-constraint>\n"
+"
<column-name>driver</column-name>\n"
+"
<column-name>number</column-name>\n"
+" </unique-constraint>\n"
+" </join-table>\n"
+" </many-to-many>\n"
+" <many-to-many name=\"allTimeDrivers\"
mapped-by=\"drivenBuses"
+"\">\n"
+" </attributes>"
+msgstr ""
+
+#. Tag: para
+#: xml-overriding.xml:281
+#, no-c-format
+msgid ""
+"You can override an association through <literal>one-to-many</literal>,
"
+"<literal>one-to-one</literal>,
<literal>many-to-one</literal>, and "
+"<literal>many-to-many</literal>. Each of these elements can have
subelements "
+"accordingly: <literal>join-table</literal> (which can have
<literal>join-"
+"column</literal>s and <literal>inverse-join-column</literal>s),
"
+"<literal><literal>join-column</literal>s</literal>,
<literal>map-key</"
+"literal>, and <literal>order-by</literal>.
<literal>mapped-by</literal> and "
+"<literal>target-entity</literal> can be defined as attributes when it
makes "
+"sense. Once again the structure is reflects the annotations structure. You "
+"can find all semantic informations in the chapter describing annotations."
+msgstr ""
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/Author_Group.xml
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/Author_Group.xml
(rev 0)
+++ annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/Author_Group.xml 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,12 @@
+<?xml version='1.0'?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+<!ENTITY % BOOK_ENTITIES SYSTEM
"Hibernate_Annotations_Reference_Guide.ent">
+%BOOK_ENTITIES;
+]>
+
+<authorgroup>
+<author>
+ <firstname>The JBoss Community Group</firstname>
+ <surname></surname>
+ </author>
+</authorgroup>
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/Book_Info.xml
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/Book_Info.xml
(rev 0)
+++ annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/Book_Info.xml 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,63 @@
+<?xml version='1.0'?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+<!ENTITY % BOOK_ENTITIES SYSTEM
"Hibernate_Annotations_Reference_Guide.ent">
+%BOOK_ENTITIES;
+]>
+
+<bookinfo id="Hibernate_Annotations_Reference_Guide">
+ <title>Hibernate Annotations Reference Guide</title>
+<!-- restoreCommunity: subtitle>for Use with JBoss Enterprise Application Platform
5.0</subtitle> -->
+ <subtitle></subtitle>
+ <edition>1.0</edition>
+ <pubsnumber>1</pubsnumber>
+
+<!-- restoreCommunity: <productname>JBoss Enterprise Application
Platform</productname> -->
+ <productname></productname>
+ <productnumber>3.4.0</productnumber>
+ <pubdate>2009</pubdate>
+ <isbn>N/A</isbn>
+<!-- restoreCommunity: <abstract><para>The JBoss Enterprise Application
Platform Edition of the Hibernate Annotations Reference Guide</para>
+ </abstract> -->
+<!-- restoreCommunity: <corpauthor>
+ <inlinemediaobject>
+ <imageobject>
+ <imagedata fileref="Common_Content/images/redhat-logo.svg" />
+ </imageobject>
+ </inlinemediaobject>
+ </corpauthor>
+-->
+ <corpauthor>
+ <inlinemediaobject>
+ <imageobject>
+ <imagedata fileref="images/hibernate_logo_a_small.png" />
+ </imageobject>
+ </inlinemediaobject>
+ </corpauthor>
+
+
+ <copyright>
+ <year>&YEAR;</year>
+ <holder>&HOLDER;</holder>
+ </copyright>
+<!-- <xi:include href="Common_Content/Legal_Notice.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" /> -->
+ <xi:include href="Author_Group.xml"
xmlns:xi="http://www.w3.org/2001/XInclude">
+ <!--FOR JDOCBOOK:-->
+ <xi:fallback
xmlns:xi="http://www.w3.org/2001/XInclude"/>
+ </xi:include>
+
+ <!--LEGAL NOTICE INCLUSION FOR PUBLICAN -->
+ <!-- No legal Notice in Community docs so commenting out -->
+ <!-- <xi:include
xmlns:xi="http://www.w3.org/2001/XInclude"
+ href="Common_Content/Legal_Notice.xml">
+ LEGAL NOTICE INCLUSION FOR JDOCBOOK:
+ <xi:fallback
xmlns:xi="http://www.w3.org/2001/XInclude">
+ <xi:include href="fallback_content/Legal_Notice.xml"
+
xmlns:xi="http://www.w3.org/2001/XInclude"></xi:include>
+ </xi:fallback>
+ </xi:include> -->
+
+
+
+
+
+</bookinfo>
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/Feedback.xml
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/Feedback.xml
(rev 0)
+++ annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/Feedback.xml 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,14 @@
+<?xml version='1.0'?>
+<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+<!ENTITY % BOOK_ENTITIES SYSTEM
"Hibernate_Annotations_Reference_Guide.ent">
+%BOOK_ENTITIES;
+]>
+
+<section id="Feedback">
+ <title>Feedback</title>
+ <para>
+ If you spot a typo in this guide, or if you have thought of a way to make this manual
better, we would love to hear from you! Submit a report in <ulink
url="http://jira.jboss.com/jira/browse/JBPAPP">JIRA</ulin... against the
Product: JBoss Enterprise Application Platform, Version:
<replaceable><version></replaceable>, Component:
<emphasis>Doc</emphasis>. If you have a suggestion for improving the
documentation, try to be as specific as possible. If you have found an error, include the
section number and some of the surrounding text so we can find it easily.
+ </para>
+
+</section>
+
Added:
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/Hibernate_Annotations_Reference_Guide.ent
===================================================================
---
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/Hibernate_Annotations_Reference_Guide.ent
(rev 0)
+++
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/Hibernate_Annotations_Reference_Guide.ent 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,4 @@
+<!ENTITY HOLDER "Red Hat, Inc">
+<!ENTITY YEAR "2009">
+<!ENTITY JBPAPP "JBoss Enterprise Application Platform">
+<!ENTITY VER "5.0">
Added:
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/Hibernate_Annotations_Reference_Guide.xml
===================================================================
---
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/Hibernate_Annotations_Reference_Guide.xml
(rev 0)
+++
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/Hibernate_Annotations_Reference_Guide.xml 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,16 @@
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+<!ENTITY % BOOK_ENTITIES SYSTEM
"Hibernate_Annotations_Reference_Guide.ent">
+%BOOK_ENTITIES;
+]>
+
+<book>
+
+ <xi:include href="Book_Info.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="Preface.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="modules/setup.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="modules/entity.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="modules/xml-overriding.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="modules/additionalmodules.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="Revision_History.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+
+</book>
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/Preface.xml
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/Preface.xml
(rev 0)
+++ annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/Preface.xml 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,71 @@
+<?xml version='1.0' encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+<!ENTITY % BOOK_ENTITIES SYSTEM
"Hibernate_Annotations_Reference_Guide.ent">
+%BOOK_ENTITIES;
+]>
+
+ <preface id="preface" >
+ <title>Preface</title>
+
+ <para>Hibernate, like all other object/relational mapping tools, requires
+ metadata that governs the transformation of data from one representation
+ to the other. In Hibernate 2.x, mapping metadata is mostly declared in XML
+ text files. Alternatively, XDoclet can be used which utilizes Javadoc source
+ code annotations together with a compile time preprocessor.
+ </para>
+
+ <para>The same kind of annotation support is now available in the standard
+ JDK, although more powerful and with better tools support. IntelliJ IDEA
+ and Eclipse for example, support auto-completion and syntax highlighting
+ of JDK 5.0 annotations which are compiled into bytecode and read at
+ runtime using reflection. External XML files are not needed in this
+ instance.</para>
+
+ <para>The EJB3 specification recognizes the interest generated by the
+ transparent object/relational mapping paradigm and its the ultimate
+ success. It standardizes the basic APIs and the metadata neededed for
+ any object/relational persistence mechanism.
+ Hibernate EntityManager implements the
+ programming interfaces and lifecycle rules as defined by the EJB3
+ persistence specification and together with Hibernate
+ Annotations offers a complete (and standalone) EJB3 persistence
+ solution on top of the mature Hibernate core. You may use a combination of
+ all three together, annotations without EJB3 programming interfaces and
+ lifecycle, or even pure native Hibernate, depending on the business and
+ technical needs of your project. At any time you can fall back to
+ Hibernate native APIs, or if required, to native JDBC and SQL.</para>
+
+ <para>
+ This release of Hibernate Annotations is based on the final release of
+ the EJB 3.0 / JPA specification (aka JSR-220
+ <ulink
url="http://jcp.org/en/jsr/detail?id=220" />)
+ and supports all of its features
+ (including the optional ones). Hibernate specific features and
+ extensions are also available through unstandardized, Hibernate specific
+ annotations. While the Hibernate feature coverage is high, some can not
+ yet be expressed via annotations. The eventual goal is to cover all of
+ them. See the JIRA road map section for more information.
+
+ If you are moving from previous Hibernate Annotations versions, please
+ have a look at the Java Persistence migration guide
+ <ulink
url="http://www.hibernate.org/398.html" />.
+</para>
+
+ <!--CONVENTIONS FOR PUBLICAN -->
+ <xi:include
xmlns:xi="http://www.w3.org/2001/XInclude"
href="Common_Content/Conventions.xml">
+ <!-- CONVENTIONS FOR JDOCBOOK:-->
+ <xi:fallback
xmlns:xi="http://www.w3.org/2001/XInclude">
+ <xi:include
href="fallback_content/Conventions.xml"
xmlns:xi="http://www.w3.org/2001/XInclude"></xi:include>
+ </xi:fallback>
+ </xi:include>
+
+ <!--FEEDBACK FOR PUBLICAN -->
+ <xi:include
xmlns:xi="http://www.w3.org/2001/XInclude"
href="Feedback.xml">
+ <!--FEEDBACK FOR JDOCBOOK:-->
+ <xi:fallback
xmlns:xi="http://www.w3.org/2001/XInclude">
+ <xi:include href="fallback_content/Feedback.xml"
xmlns:xi="http://www.w3.org/2001/XInclude"></xi:include>
+ </xi:fallback>
+ </xi:include>
+
+ </preface>
+
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/Revision_History.xml
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/Revision_History.xml
(rev 0)
+++
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/Revision_History.xml 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,28 @@
+<?xml version='1.0'?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+<!ENTITY % BOOK_ENTITIES SYSTEM
"Hibernate_Annotations_Reference_Guide.ent">
+%BOOK_ENTITIES;
+]>
+
+<appendix id="appe-Publican-Revision_History">
+ <title>Revision History</title>
+ <simpara>
+ <revhistory>
+ <revision>
+ <revnumber>1.0</revnumber>
+ <date>Thu Oct 21 2009</date>
+ <author>
+ <firstname>Laura</firstname>
+ <surname>Bailey</surname>
+ <email>lbailey(a)redhat.com</email>
+ </author>
+ <revdescription>
+ <simplelist>
+ <member>Initial draft.</member>
+ </simplelist>
+ </revdescription>
+ </revision>
+ </revhistory>
+ </simpara>
+</appendix>
+
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/A320.java
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/A320.java
(rev 0)
+++ annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/A320.java 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,3 @@
+@Entity
+@DiscriminatorValue("A320")
+public class A320 extends Plane { ... }
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/Address.java
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/Address.java
(rev 0)
+++
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/Address.java 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,5 @@
+@Embeddable
+public class Address implements Serializable {
+ String city;
+ Country nationality; //no overriding here
+}
Added:
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/AmericaCupClass.java
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/AmericaCupClass.java
(rev 0)
+++
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/AmericaCupClass.java 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,3 @@
+@Entity
+@PrimaryKeyJoinColumn(name="BOAT_ID")
+public class AmericaCupClass extends Boat { ... }
Added:
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/AnnotatedClassesandPackages.java
===================================================================
---
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/AnnotatedClassesandPackages.java
(rev 0)
+++
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/AnnotatedClassesandPackages.java 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,8 @@
+sessionFactory = new AnnotationConfiguration()
+ .addPackage("test.animals") //the fully qualified package name
+ .addAnnotatedClass(Flight.class)
+ .addAnnotatedClass(Sky.class)
+ .addAnnotatedClass(Person.class)
+ .addAnnotatedClass(Dog.class)
+ .addResource("test/animals/orm.xml")
+ configure()..buildSessionFactory();
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/BaseEntity.java
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/BaseEntity.java
(rev 0)
+++
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/BaseEntity.java 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,9 @@
+@MappedSuperclass
+public class BaseEntity {
+ @Basic
+ @Temporal(TemporalType.TIMESTAMP)
+ public Date getLastUpdate() { ... }
+ public String getLastUpdater() { ... }
+ ...
+}
+
Added:
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/Basic_Annotation.java
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/Basic_Annotation.java
(rev 0)
+++
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/Basic_Annotation.java 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,20 @@
+public transient int counter; //transient property
+
+private String firstname; //persistent property
+
+@Transient
+String getLengthInMeter() { ... } //transient property
+
+String getName() {... } // persistent property
+
+@Basic
+int getLength() { ... } // persistent property
+
+@Basic(fetch = FetchType.LAZY)
+String getDetailedComment() { ... } // persistent property
+
+(a)Temporal(TemporalType.TIME)
+java.util.Date getDepartureTime() { ... } // persistent property
+
+(a)Enumerated(EnumType.STRING)
+Starred getNote() { ... } //enum persisted as String in database
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/Boat.java
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/Boat.java
(rev 0)
+++ annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/Boat.java 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,4 @@
+@Entity
+(a)Inheritance(strategy=InheritanceType.JOINED)
+public class Boat implements Serializable { ... }
+
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/Country.java
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/Country.java
(rev 0)
+++
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/Country.java 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,13 @@
+@Embeddable
+public class Country implements Serializable {
+ private String iso2;
+ @Column(name="countryName") private String name;
+
+ public String getIso2() { return iso2; }
+ public void setIso2(String iso2) { this.iso2 = iso2; }
+
+
+ public String getName() { return name; }
+ public void setName(String name) { this.name = name; }
+ ...
+}
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/Ferry.java
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/Ferry.java
(rev 0)
+++ annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/Ferry.java 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,3 @@
+@Entity
+public class Ferry extends Boat { ... }
+
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/Flight.java
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/Flight.java
(rev 0)
+++ annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/Flight.java 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,9 @@
+@Entity
+public class Flight implements Serializable {
+ Long id;
+
+ @Id
+ public Long getId() { return id; }
+
+ public void setId(Long id) { this.id = id; }
+}
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/Flight_a.java
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/Flight_a.java
(rev 0)
+++
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/Flight_a.java 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,7 @@
+@Entity
+public class Flight implements Serializable {
+...
+ @Version
+ @Column(name="OPTLOCK")
+ public Integer getVersion() { ... }
+}
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/Flight_c.java
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/Flight_c.java
(rev 0)
+++
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/Flight_c.java 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,5 @@
+@Entity
+public class Flight implements Serializable {
+...
+@Column(updatable = false, name = "flight_name", nullable = false, length=50)
+public String getName() { ... }
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/FlyingObject.java
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/FlyingObject.java
(rev 0)
+++
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/FlyingObject.java 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,20 @@
+@MappedSuperclass
+public class FlyingObject implements Serializable {
+
+ public int getAltitude() {
+ return altitude;
+ }
+
+ @Transient
+ public int getMetricAltitude() {
+ return metricAltitude;
+ }
+
+ @ManyToOne
+ public PropulsionType getPropulsion() {
+ return metricAltitude;
+ }
+ ...
+}
+
+
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/Footballer.java
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/Footballer.java
(rev 0)
+++
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/Footballer.java 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,33 @@
+@Entity
+(a)IdClass(FootballerPk.class)
+public class Footballer {
+ //part of the id key
+ @Id public String getFirstname() {
+ return firstname;
+ }
+
+ public void setFirstname(String firstname) {
+ this.firstname = firstname;
+ }
+
+ //part of the id key
+ @Id public String getLastname() {
+ return lastname;
+ }
+
+ public void setLastname(String lastname) {
+ this.lastname = lastname;
+ }
+
+ public String getClub() {
+ return club;
+ }
+
+ public void setClub(String club) {
+ this.club = club;
+ }
+
+ //appropriate equals() and hashCode() implementation
+}
+
+
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/FootballerPk.java
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/FootballerPk.java
(rev 0)
+++
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/FootballerPk.java 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,22 @@
+@Embeddable
+public class FootballerPk implements Serializable {
+ //same name and type as in Footballer
+ public String getFirstname() {
+ return firstname;
+ }
+
+ public void setFirstname(String firstname) {
+ this.firstname = firstname;
+ }
+
+ //same name and type as in Footballer
+ public String getLastname() {
+ return lastname;
+ }
+
+ public void setLastname(String lastname) {
+ this.lastname = lastname;
+ }
+
+ //appropriate equals() and hashCode() implementation
+}
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/HibernateUtil.java
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/HibernateUtil.java
(rev 0)
+++
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/HibernateUtil.java 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,27 @@
+package hello;
+
+import org.hibernate.*;
+import org.hibernate.cfg.*;
+import test.*;
+import test.animals.Dog;
+
+public class HibernateUtil {
+
+private static final SessionFactory sessionFactory;
+
+ static {
+ try {
+
+ sessionFactory = new AnnotationConfiguration().
+ configure().buildSessionFactory();
+ } catch (Throwable ex) {
+ // Log exception!
+ throw new ExceptionInInitializerError(ex);
+ }
+ }
+
+ public static Session getSession()
+ throws HibernateException {
+ return sessionFactory.openSession();
+ }
+}
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/Lob_Ex.java
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/Lob_Ex.java
(rev 0)
+++ annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/Lob_Ex.java 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,9 @@
+@Lob
+public String getFullText() {
+ return fullText;
+}
+
+@Lob
+public byte[] getFullCode() {
+ return fullCode;
+}
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/Order.java
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/Order.java
(rev 0)
+++ annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/Order.java 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,4 @@
+@Entity class Order extends BaseEntity {
+ @Id public Integer getId() { ... }
+ ...
+}
Added:
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/Override_Attributes.java
===================================================================
---
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/Override_Attributes.java
(rev 0)
+++
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/Override_Attributes.java 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,8 @@
+@Embedded
+@AttributeOverrides( {
+@AttributeOverride(name="city", column = @Column(name="fld_city") ),
+@AttributeOverride(name="<emphasis
role="bold">nationality.iso2</emphasis>", column =
@Column(name="nat_Iso2") ),
+@AttributeOverride(name="<emphasis
role="bold">nationality.name</emphasis>", column =
@Column(name="nat_CountryName") )
+ //nationality columns in homeAddress are overridden
+} )
+Address homeAddress;
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/Person.java
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/Person.java
(rev 0)
+++ annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/Person.java 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,14 @@
+@Entity
+public class Person implements Serializable {
+
+ // Persistent component using defaults
+ Address homeAddress;
+
+ @Embedded
+ @AttributeOverrides( {
+ @AttributeOverride(name="iso2", column =
@Column(name="bornIso2") ),
+ @AttributeOverride(name="name", column =
@Column(name="bornCountryName") )
+ } )
+ Country bornIn;
+ ...
+}
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/Plane.java
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/Plane.java
(rev 0)
+++ annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/Plane.java 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,8 @@
+@Entity
+(a)Inheritance(strategy=InheritanceType.SINGLE_TABLE)
+@DiscriminatorColumn(
+ name="planetype",
+ discriminatorType=DiscriminatorType.STRING
+)
+@DiscriminatorValue("Plane")
+public class Plane { ... }
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/Plane_a.java
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/Plane_a.java
(rev 0)
+++
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/Plane_a.java 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,6 @@
+@Entity
+@AttributeOverride( name="altitude", column =
@Column(name="fld_altitude") )
+@AssociationOverride( name="propulsion", joinColumns =
@JoinColumn(name="fld_propulsion_fk") )
+public class Plane extends FlyingObject {
+ ...
+}
Added:
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/Sequence_Generator.java
===================================================================
---
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/Sequence_Generator.java
(rev 0)
+++
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/Sequence_Generator.java 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,5 @@
+(a)javax.persistence.SequenceGenerator(
+ name="SEQ_GEN",
+ sequenceName="my_sequence",
+ allocationSize=20
+)
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/Store.java
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/Store.java
(rev 0)
+++ annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/Store.java 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,11 @@
+@Entity
+(a)javax.persistence.SequenceGenerator(
+ name="SEQ_STORE",
+ sequenceName="my_sequence"
+)
+public class Store implements Serializable {
+ private Long id;
+
+ @Id @GeneratedValue(strategy=GenerationType.SEQUENCE,
generator="SEQ_STORE")
+ public Long getId() { return id; }
+}
Added:
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/Table_Generator.java
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/Table_Generator.java
(rev 0)
+++
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/Table_Generator.java 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,8 @@
+(a)javax.persistence.TableGenerator(
+ name="EMP_GEN",
+ table="GENERATOR_TABLE",
+ pkColumnName = "key",
+ valueColumnName = "hi"
+ pkColumnValue="EMP",
+ allocationSize=20
+)
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/TvMagazin.java
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/TvMagazin.java
(rev 0)
+++
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/TvMagazin.java 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,15 @@
+@Entity
+@AssociationOverride( name="id.channel", joinColumns =
@JoinColumn(name="chan_id") )
+public class TvMagazin {
+ @EmbeddedId public TvMagazinPk id;
+ @Temporal(TemporalType.TIME) Date time;
+}
+
+@Embeddable
+public class TvMagazinPk implements Serializable {
+ @ManyToOne
+ public Channel channel;
+ public String name;
+ @ManyToOne
+ public Presenter presenter;
+}
Added:
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/cache_concurrency_strategy.java
===================================================================
---
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/cache_concurrency_strategy.java
(rev 0)
+++
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/cache_concurrency_strategy.java 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,4 @@
+@Cache(
+ CacheConcurrencyStrategy usage();
+ String region() default "";
+ String include() default "all";
Added:
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/column_properties.java
===================================================================
---
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/column_properties.java
(rev 0)
+++
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/column_properties.java 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,11 @@
+@Column(
+ name="columnName";
+ boolean unique() default false;
+ boolean nullable() default true;
+ boolean insertable() default true;
+ boolean updatable() default true;
+ String columnDefinition() default "";
+ String table() default "";
+ int length() default 255;
+ int precision() default 0; // decimal precision
+ int scale() default 0; // decimal scale
Added:
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/hibernate.cfg.xml_sample
===================================================================
---
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/hibernate.cfg.xml_sample
(rev 0)
+++
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/hibernate.cfg.xml_sample 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,14 @@
+<!DOCTYPE hibernate-configuration PUBLIC
+ "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
+
+ <hibernate-configuration>
+ <session-factory>
+ <mapping package="test.animals"/>
+ <mapping class="test.Flight"/>
+ <mapping class="test.Sky"/>
+ <mapping class="test.Person"/>
+ <mapping class="test.animals.Dog"/>
+ <mapping resource="test/animals/orm.xml"/>
+ </session-factory>
+ </hibernate-configuration>
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/hibernate.cfg.xmlt
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/hibernate.cfg.xmlt
(rev 0)
+++
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/hibernate.cfg.xmlt 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,14 @@
+<!DOCTYPE hibernate-configuration PUBLIC
+ "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
+
+ <hibernate-configuration>
+ <session-factory>
+ <mapping package="test.animals"/>
+ <mapping class="test.Flight"/>
+ <mapping class="test.Sky"/>
+ <mapping class="test.Person"/>
+ <mapping class="test.animals.Dog"/>
+ <mapping resource="test/animals/orm.xml"/>
+ </session-factory>
+ </hibernate-configuration>
Added:
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/override_metadata_1.xml_sample
===================================================================
---
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/override_metadata_1.xml_sample
(rev 0)
+++
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/override_metadata_1.xml_sample 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<entity-mappings
+
xmlns="http://java.sun.com/xml/ns/persistence/orm"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm orm_1_0.xsd"
+ version="1.0">
+
+ <package>org.hibernate.test.annotations.reflection</package>
+ <entity class="Administration" access="PROPERTY"
metadata-complete="true">
+ <table name="tbl_admin">
+ <unique-constraint>
+ <column-name>firstname</column-name>
+ <column-name>lastname</column-name>
+ </unique-constraint>
+ </table>
+ <secondary-table name="admin2">
+ <primary-key-join-column name="admin_id"
referenced-column-name="id"/>
+ <unique-constraint>
+ <column-name>address</column-name>
+ </unique-constraint>
+ </secondary-table>
+ <id-class class="SocialSecurityNumber"/>
+ <inheritance strategy="JOINED"/>
+ <sequence-generator name="seqhilo"
sequence-name="seqhilo"/>
+ <table-generator name="table" table="tablehilo"/>
+ ...
+ </entity>
+
+ <entity class="PostalAdministration">
+ <primary-key-join-column name="id"/>
+ ...
+ </entity>
+</entity-mappings>
Added:
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/override_metadata_1.xmlt
===================================================================
---
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/override_metadata_1.xmlt
(rev 0)
+++
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/override_metadata_1.xmlt 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,32 @@
+<entity-mappings
+
xmlns="http://java.sun.com/xml/ns/persistence/orm"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm orm_1_0.xsd"
+ version="1.0">
+
+ <package>org.hibernate.test.annotations.reflection</package>
+ <entity class="Administration" access="PROPERTY"
metadata-complete="true">
+ <table name="tbl_admin">
+ <unique-constraint>
+ <column-name>firstname</column-name>
+ <column-name>lastname</column-name>
+ </unique-constraint>
+ </table>
+ <secondary-table name="admin2">
+ <primary-key-join-column name="admin_id"
referenced-column-name="id"/>
+ <unique-constraint>
+ <column-name>address</column-name>
+ </unique-constraint>
+ </secondary-table>
+ <id-class class="SocialSecurityNumber"/>
+ <inheritance strategy="JOINED"/>
+ <sequence-generator name="seqhilo"
sequence-name="seqhilo"/>
+ <table-generator name="table" table="tablehilo"/>
+ ...
+ </entity>
+
+ <entity class="PostalAdministration">
+ <primary-key-join-column name="id"/>
+ ...
+ </entity>
+</entity-mappings>
Added:
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/override_metadata_2.xml_sample
===================================================================
---
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/override_metadata_2.xml_sample
(rev 0)
+++
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/override_metadata_2.xml_sample 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<entity-mappings
+
xmlns="http://java.sun.com/xml/ns/persistence/orm"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm orm_1_0.xsd"
+ version="1.0">
+
+ <package>org.hibernate.test.annotations.reflection</package>
+ <entity class="Music" access="PROPERTY"
metadata-complete="true">
+ <discriminator-value>Generic</discriminator-value>
+ <discriminator-column length="34"/>
+ ...
+ </entity>
+
+ <entity class="PostalAdministration">
+ <primary-key-join-column name="id"/>
+ <named-query name="adminById">
+ <query>select m from Administration m where m.id = :id</query>
+ <hint name="org.hibernate.timeout" value="200"/>
+ </named-query>
+ <named-native-query name="allAdmin"
result-set-mapping="adminrs">
+ <query>select *, count(taxpayer_id) as taxPayerNumber
+ from Administration, TaxPayer
+ where taxpayer_admin_id = admin_id group by ...</query>
+ <hint name="org.hibernate.timeout" value="200"/>
+ </named-native-query>
+ <sql-result-set-mapping name="adminrs">
+ <entity-result entity-class="Administration">
+ <field-result name="name" column="fld_name"/>
+ </entity-result>
+ <column-result name="taxPayerNumber"/>
+ </sql-result-set-mapping>
+ <attribute-override name="ground">
+ <column name="fld_ground" unique="true"
scale="2"/>
+ </attribute-override>
+ <association-override name="referer">
+ <join-column name="referer_id"
referenced-column-name="id"/>
+ </association-override>
+ ...
+ </entity>
+</entity-mappings>
Added:
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/override_metadata_2.xmlt
===================================================================
---
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/override_metadata_2.xmlt
(rev 0)
+++
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/override_metadata_2.xmlt 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<entity-mappings
+
xmlns="http://java.sun.com/xml/ns/persistence/orm"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm orm_1_0.xsd"
+ version="1.0">
+
+ <package>org.hibernate.test.annotations.reflection</package>
+ <entity class="Music" access="PROPERTY"
metadata-complete="true">
+ <discriminator-value>Generic</discriminator-value>
+ <discriminator-column length="34"/>
+ ...
+ </entity>
+
+ <entity class="PostalAdministration">
+ <primary-key-join-column name="id"/>
+ <named-query name="adminById">
+ <query>select m from Administration m where m.id = :id</query>
+ <hint name="org.hibernate.timeout" value="200"/>
+ </named-query>
+ <named-native-query name="allAdmin"
result-set-mapping="adminrs">
+ <query>select *, count(taxpayer_id) as taxPayerNumber
+ from Administration, TaxPayer
+ where taxpayer_admin_id = admin_id group by ...</query>
+ <hint name="org.hibernate.timeout" value="200"/>
+ </named-native-query>
+ <sql-result-set-mapping name="adminrs">
+ <entity-result entity-class="Administration">
+ <field-result name="name" column="fld_name"/>
+ </entity-result>
+ <column-result name="taxPayerNumber"/>
+ </sql-result-set-mapping>
+ <attribute-override name="ground">
+ <column name="fld_ground" unique="true"
scale="2"/>
+ </attribute-override>
+ <association-override name="referer">
+ <join-column name="referer_id"
referenced-column-name="id"/>
+ </association-override>
+ ...
+ </entity>
+</entity-mappings>
Added:
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/sequence_generator.xml_sample
===================================================================
---
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/sequence_generator.xml_sample
(rev 0)
+++
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/sequence_generator.xml_sample 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,3 @@
+<sequence-generator name="SEQ_GEN"
+ sequence-name="my_sequence"
+ allocation-size="20"/>
Added:
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/table_generator.xml_sample
===================================================================
---
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/table_generator.xml_sample
(rev 0)
+++
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/extras/table_generator.xml_sample 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,6 @@
+<table-generator name="EMP_GEN"
+ table="GENERATOR_TABLE"
+ pk-column-name="key"
+ value-column-name="hi"
+ pk-column-value="EMP"
+ allocation-size="20"/>
Added:
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/fallback_content/Conventions.xml
===================================================================
---
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/fallback_content/Conventions.xml
(rev 0)
+++
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/fallback_content/Conventions.xml 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,168 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<section>
+ <title>Document Conventions</title>
+ <para>
+ This manual uses several conventions to highlight certain words and phrases and draw
attention to specific pieces of information.
+ </para>
+ <para>
+ In PDF and paper editions, this manual uses typefaces drawn from the <ulink
url="https://fedorahosted.org/liberation-fonts/">Liberation
Fonts</ulink> set. The Liberation Fonts set is also used in HTML editions if the set
is installed on your system. If not, alternative but equivalent typefaces are displayed.
Note: Red Hat Enterprise Linux 5 and later includes the Liberation Fonts set by default.
+ </para>
+ <section>
+ <title>Typographic Conventions</title>
+ <para>
+ Four typographic conventions are used to call attention to specific words and phrases.
These conventions, and the circumstances they apply to, are as follows.
+ </para>
+ <para>
+ <literal>Mono-spaced Bold</literal>
+ </para>
+ <para>
+ Used to highlight system input, including shell commands, file names and paths. Also
used to highlight keycaps and key combinations. For example:
+ </para>
+ <blockquote>
+ <para>
+ To see the contents of the file
<filename>my_next_bestselling_novel</filename> in your current working
directory, enter the <command>cat my_next_bestselling_novel</command> command
at the shell prompt and press <keycap>Enter</keycap> to execute the command.
+ </para>
+ </blockquote>
+ <para>
+ The above includes a file name, a shell command and a keycap, all presented in
mono-spaced bold and all distinguishable thanks to context.
+ </para>
+ <para>
+ Key combinations can be distinguished from keycaps by the hyphen connecting each part
of a key combination. For example:
+ </para>
+ <blockquote>
+ <para>
+ Press <keycap>Enter</keycap> to execute the command.
+ </para>
+ <para>
+ Press
<keycombo><keycap>Ctrl</keycap><keycap>Alt</keycap><keycap>F1</keycap></keycombo>
to switch to the first virtual terminal. Press
<keycombo><keycap>Ctrl</keycap><keycap>Alt</keycap><keycap>F7</keycap></keycombo>
to return to your X-Windows session.
+ </para>
+ </blockquote>
+ <para>
+ The first paragraph highlights the particular keycap to press. The second highlights
two key combinations (each a set of three keycaps with each set pressed simultaneously).
+ </para>
+ <para>
+ If source code is discussed, class names, methods, functions, variable names and
returned values mentioned within a paragraph will be presented as above, in
<literal>mono-spaced bold</literal>. For example:
+ </para>
+ <blockquote>
+ <para>
+ File-related classes include <classname>filesystem</classname> for file
systems, <classname>file</classname> for files, and
<classname>dir</classname> for directories. Each class has its own associated
set of permissions.
+ </para>
+ </blockquote>
+ <para>
+ <application>Proportional Bold</application>
+ </para>
+ <para>
+ This denotes words or phrases encountered on a system, including application names;
dialog box text; labeled buttons; check-box and radio button labels; menu titles and
sub-menu titles. For example:
+ </para>
+ <blockquote>
+ <para>
+ Choose <guimenu>System > Preferences > Mouse</guimenu> from
the main menu bar to launch <application>Mouse Preferences</application>. In
the <guilabel>Buttons</guilabel> tab, click the <guilabel>Left-handed
mouse</guilabel> check box and click <guibutton>Close</guibutton> to
switch the primary mouse button from the left to the right (making the mouse suitable for
use in the left hand).
+ </para>
+ <para>
+ To insert a special character into a <application>gedit</application>
file, choose <guimenu>Applications > Accessories > Character
Map</guimenu> from the main menu bar. Next, choose <guimenu>Search >
Find…</guimenu> from the <application>Character
Map</application> menu bar, type the name of the character in the
<guilabel>Search</guilabel> field and click
<guibutton>Next</guibutton>. The character you sought will be highlighted in
the <guilabel>Character Table</guilabel>. Double-click this highlighted
character to place it in the <guilabel>Text to copy</guilabel> field and then
click the <guibutton>Copy</guibutton> button. Now switch back to your document
and choose <guimenu>Edit > Paste</guimenu> from the
<application>gedit</application> menu bar.
+ </para>
+ </blockquote>
+ <para>
+ The above text includes application names; system-wide menu names and items;
application-specific menu names; and buttons and text found within a GUI interface, all
presented in proportional bold and all distinguishable by context.
+ </para>
+ <para>
+ Note the <guimenu>></guimenu> shorthand used to indicate traversal
through a menu and its sub-menus. This avoids difficult-to-follow phrasing such as
'Select <guimenuitem>Mouse</guimenuitem> from the
<guimenu>Preferences</guimenu> sub-menu in the
<guimenu>System</guimenu> menu of the main menu bar'.
+ </para>
+ <para>
+ <command><replaceable>Mono-spaced Bold
Italic</replaceable></command> or
<application><replaceable>Proportional Bold
Italic</replaceable></application>
+ </para>
+ <para>
+ Whether mono-spaced bold or proportional bold, the addition of italics indicates
replaceable or variable text. Italics denotes text you do not input literally or displayed
text that changes depending on circumstance. For example:
+ </para>
+ <blockquote>
+ <para>
+ To connect to a remote machine using ssh, type <command>ssh
<replaceable>username</replaceable>(a)<replaceable>domain.name</replaceable></command>
at a shell prompt. If the remote machine is <filename>example.com</filename>
and your username on that machine is john, type <command>ssh
john(a)example.com</command>.
+ </para>
+ <para>
+ The <command>mount -o remount
<replaceable>file-system</replaceable></command> command remounts the
named file system. For example, to remount the <filename>/home</filename> file
system, the command is <command>mount -o remount /home</command>.
+ </para>
+ <para>
+ To see the version of a currently installed package, use the <command>rpm -q
<replaceable>package</replaceable></command> command. It will return a
result as follows:
<command><replaceable>package-version-release</replaceable></command>.
+ </para>
+ </blockquote>
+ <para>
+ Note the words in bold italics above — username, domain.name, file-system,
package, version and release. Each word is a placeholder, either for text you enter when
issuing a command or for text displayed by the system.
+ </para>
+ <para>
+ Aside from standard usage for presenting the title of a work, italics denotes the
first use of a new and important term. For example:
+ </para>
+ <blockquote>
+ <para>
+ When the Apache HTTP Server accepts requests, it dispatches child processes or
threads to handle them. This group of child processes or threads is known as a
<firstterm>server-pool</firstterm>. Under Apache HTTP Server 2.0, the
responsibility for creating and maintaining these server-pools has been abstracted to a
group of modules called <firstterm>Multi-Processing Modules</firstterm>
(<firstterm>MPMs</firstterm>). Unlike other modules, only one module from the
MPM group can be loaded by the Apache HTTP Server.
+ </para>
+ </blockquote>
+ </section>
+
+ <section>
+ <title>Pull-quote Conventions</title>
+ <para>
+ Terminal output and source code listings are set off visually from the surrounding
text.
+ </para>
+ <para>
+ Output sent to a terminal is set in <computeroutput>mono-spaced
roman</computeroutput> and presented thus:
+ </para>
+
+<screen>books Desktop documentation drafts mss photos stuff svn
+books_tests Desktop1 downloads images notes scripts svgs
+</screen>
+ <para>
+ Source-code listings are also set in <computeroutput>mono-spaced
roman</computeroutput> but add syntax highlighting as follows:
+ </para>
+
+<programlisting language="Java">package org.jboss.book.jca.ex1;
+
+import javax.naming.InitialContext;
+
+public class ExClient
+{
+ public static void main(String args[])
+ throws Exception
+ {
+ InitialContext iniCtx = new InitialContext();
+ Object ref = iniCtx.lookup("EchoBean");
+ EchoHome home = (EchoHome) ref;
+ Echo echo = home.create();
+
+ System.out.println("Created Echo");
+
+ System.out.println("Echo.echo('Hello') = " +
echo.echo("Hello"));
+ }
+}
+</programlisting>
+ </section>
+
+ <section>
+ <title>Notes and Warnings</title>
+ <para>
+ Finally, we use three visual styles to draw attention to information that might
otherwise be overlooked.
+ </para>
+ <note>
+ <title>Note</title>
+ <para>
+ Notes are tips, shortcuts or alternative approaches to the task at hand. Ignoring a
note should have no negative consequences, but you might miss out on a trick that makes
your life easier.
+ </para>
+ </note>
+ <important>
+ <title>Important</title>
+ <para>
+ Important boxes detail things that are easily missed: configuration changes that only
apply to the current session, or services that need restarting before an update will
apply. Ignoring a box labeled 'Important' won't cause data loss but may cause
irritation and frustration.
+ </para>
+ </important>
+ <warning>
+ <title>Warning</title>
+ <para>
+ Warnings should not be ignored. Ignoring warnings will most likely cause data loss.
+ </para>
+ </warning>
+ </section>
+
+</section>
+
+
Added:
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/fallback_content/Feedback.xml
===================================================================
---
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/fallback_content/Feedback.xml
(rev 0)
+++
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/fallback_content/Feedback.xml 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,13 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<section>
+ <title>We Need Feedback!</title>
+ <indexterm>
+ <primary>feedback</primary>
+ <secondary>contact information for this manual</secondary>
+ </indexterm>
+ <para>
+ You should over ride this by creating your own local Feedback.xml file.
+ </para>
+</section>
\ No newline at end of file
Added:
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/fallback_content/Legal_Notice.xml
===================================================================
---
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/fallback_content/Legal_Notice.xml
(rev 0)
+++
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/fallback_content/Legal_Notice.xml 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,9 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!DOCTYPE legalnotice PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<legalnotice>
+ <para>
+ Copyright <trademark class="copyright"></trademark> &YEAR;
&HOLDER; This material may only be distributed subject to the terms and conditions set
forth in the GNU Free Documentation License (GFDL), V1.2 or later (the latest version is
presently available at <ulink
url="http://www.gnu.org/licenses/fdl.txt">http://www.gnu.org...>).
+ </para>
+</legalnotice>
+
Added:
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/images/hibernate_logo_a.png
===================================================================
(Binary files differ)
Property changes on:
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/images/hibernate_logo_a.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/images/hibernate_logo_a_small.png
===================================================================
(Binary files differ)
Property changes on:
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/images/hibernate_logo_a_small.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/modules/additionalmodules.xml
===================================================================
---
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/modules/additionalmodules.xml
(rev 0)
+++
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/modules/additionalmodules.xml 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,148 @@
+<?xml version='1.0' encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+<!ENTITY % BOOK_ENTITIES SYSTEM
"../Hibernate_Annotations_Reference_Guide.ent">
+%BOOK_ENTITIES;
+]>
+<!--
+ ~ Hibernate, Relational Persistence for Idiomatic Java
+ ~
+ ~ Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ ~ indicated by the @author tags or express copyright attribution
+ ~ statements applied by the authors. All third-party contributions are
+ ~ distributed under license by Red Hat Middleware LLC.
+ ~
+ ~ This copyrighted material is made available to anyone wishing to use, modify,
+ ~ copy, or redistribute it subject to the terms and conditions of the GNU
+ ~ Lesser General Public License, as published by the Free Software Foundation.
+ ~
+ ~ This program is distributed in the hope that it will be useful,
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ ~ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ ~ for more details.
+ ~
+ ~ You should have received a copy of the GNU Lesser General Public License
+ ~ along with this distribution; if not, write to:
+ ~ Free Software Foundation, Inc.
+ ~ 51 Franklin Street, Fifth Floor
+ ~ Boston, MA 02110-1301 USA
+ -->
+
+<chapter id="additionalmodules">
+ <title>Additional modules</title>
+
+ <para>Hibernate Annotations mainly focus on persistence metadata. The
+ project also have a nice integration with two Hibernate modules.</para>
+
+ <section>
+ <title>Hibernate Validator</title>
+
+ <section>
+ <title>Description</title>
+
+ <para>Annotations are a very convenient and elegant way to specify
+ invariant constraints for a domain model. You can, for example, express
+ that a property should never be null, that the account balance should be
+ strictly positive, etc. These domain model constraints are declared in
+ the bean itself by annotating its properties. A validator can then read
+ them and check for constraint violations. The validation mechanism can
+ be executed in different layers in your application without having to
+ duplicate any of these rules (presentation layer, data access layer).
+ Following the DRY principle, Hibernate Validator has been designed for
+ that purpose.</para>
+
+ <para>Hibernate Validator works at two levels. First, it is able to
+ check in-memory instances of a class for constraint violations. Second,
+ it can apply the constraints to the Hibernate metamodel and incorporate
+ them into the generated database schema.</para>
+
+ <para>Each constraint annotation is associated to a validator
+ implementation responsible for checking the constraint on the entity
+ instance. A validator can also (optionally) apply the constraint to the
+ Hibernate metamodel, allowing Hibernate to generate DDL that expresses
+ the constraint. With the appropriate event listener, you can execute the
+ checking operation on inserts and updates done by Hibernate. Hibernate
+ Validator is not limited to use with Hibernate. You can easily use it
+ anywhere in your application.</para>
+
+ <para>When checking instances at runtime, Hibernate Validator returns
+ information about constraint violations in an array of
+ <classname>InvalidValue</classname> s. Among other information, the
+ <classname>InvalidValue</classname> contains an error description
+ message that can embed the parameter values bundle with the annotation
+ (eg. length limit), and message strings that may be externalized to a
+ <classname>ResourceBundle</classname> .</para>
+ </section>
+
+ <section>
+ <title>Integration with Hibernate Annotations</title>
+
+ <para>If Hibernate Validator
+ (<filename>hibernate-validator.jar</filename>) is available in the
+ classpath, Hibernate Annotations will integrate in two ways:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>Constraints will be applied to the Data Definition Language.
+ In other words, the database schema will reflect the constraints
+ (provided that you use the hbm2ddl tool).</para>
+ </listitem>
+
+ <listitem>
+ <para>Before an entity change is applied to the database (insert or
+ update), the entity is validated. Validation errors, if any, will be
+ carried over through an
+ <classname>InvalidStateException</classname>.</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>For entities free of validation rules, the runtime performance
+ cost is null.</para>
+
+ <para>To disable constraint propagation to DDL, set up
+ <literal>hibernate.validator.apply_to_ddl</literal> to false in the
+ configuration file. Such a need is very uncommon and not
+ recommended.</para>
+
+ <para>To disable pre-entity change validation, set up
+ <literal>hibernate.validator.autoregister_listeners</literal> to false
+ in the configuration file. Such a need is very uncommon and not
+ recommended.</para>
+
+ <para>Check the Hibernate Validator reference documentation for more
+ information.</para>
+ </section>
+ </section>
+
+ <section>
+ <title>Hibernate Search</title>
+
+ <section>
+ <title>Description</title>
+
+ <para>Full text search engines like <productname>Apache
+ Lucene</productname> are a very powerful technology to bring free
+ text/efficient queries to applications. If suffers several mismatches
+ when dealing with a object domain model (keeping the index up to date,
+ mismatch between the index structure and the domain model, querying
+ mismatch...) Hibernate Search indexes your domain model thanks to a few
+ annotations, takes care of the database / index synchronization and
+ brings you back regular managed objects from free text queries.
+ Hibernate Search is using <ulink
url="http://lucene.apache.org">Apache
+ Lucene</ulink> under the cover.</para>
+ </section>
+
+ <section>
+ <title>Integration with Hibernate Annotations</title>
+
+ <para>Hibernate Search integrates with Hibernate Annotations
+ transparently provided that hibernate-search.jar is present in the
+ classpath. If you do not wish to automatically register Hibernate Search
+ event listeners, you can set
+ <literal>hibernate.search.autoregister_listeners</literal> to false.
+ Such a need is very uncommon and not recommended.</para>
+
+ <para>Check the Hibernate Search reference documentation for more
+ information.</para>
+ </section>
+ </section>
+</chapter>
\ No newline at end of file
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/modules/entity.xml
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/modules/entity.xml
(rev 0)
+++ annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/modules/entity.xml 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,3825 @@
+<?xml version='1.0' encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+<!ENTITY % BOOK_ENTITIES SYSTEM
"../Hibernate_Annotations_Reference_Guide.ent">
+%BOOK_ENTITIES;
+]>
+<!--
+ ~ Hibernate, Relational Persistence for Idiomatic Java
+ ~
+ ~ Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ ~ indicated by the @author tags or express copyright attribution
+ ~ statements applied by the authors. All third-party contributions are
+ ~ distributed under license by Red Hat Middleware LLC.
+ ~
+ ~ This copyrighted material is made available to anyone wishing to use, modify,
+ ~ copy, or redistribute it subject to the terms and conditions of the GNU
+ ~ Lesser General Public License, as published by the Free Software Foundation.
+ ~
+ ~ This program is distributed in the hope that it will be useful,
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ ~ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ ~ for more details.
+ ~
+ ~ You should have received a copy of the GNU Lesser General Public License
+ ~ along with this distribution; if not, write to:
+ ~ Free Software Foundation, Inc.
+ ~ 51 Franklin Street, Fifth Floor
+ ~ Boston, MA 02110-1301 USA
+ -->
+
+<chapter id="entity">
+ <title>Entity Beans</title>
+
+ <section id="entity-overview" revision="2">
+ <title>Intro</title>
+
+ <para>This section covers EJB 3.0 (aka Java Persistence) entity
+ annotations and Hibernate-specific extensions.</para>
+ </section>
+
+ <section id="entity-mapping" revision="2">
+ <title>Mapping with EJB3/JPA Annotations</title>
+
+ <para>EJB3 entities are plain POJOs. Actually they represent the exact
+ same concept as the Hibernate persistent entities. Their mappings are
+ defined through JDK 5.0 annotations (an XML descriptor syntax for
+ overriding is defined in the EJB3 specification). Annotations can be split
+ in two categories, the logical mapping annotations (allowing you to
+ describe the object model, the class associations, etc.) and the physical
+ mapping annotations (describing the physical schema, tables, columns,
+ indexes, etc). We will mix annotations from both categories in the
+ following code examples.</para>
+
+ <para>EJB3 annotations are in the
<literal>javax.persistence.*</literal>
+ package. Most JDK 5 compliant IDE (like Eclipse, IntelliJ IDEA and
+ Netbeans) can autocomplete annotation interfaces and attributes for you
+ (even without a specific "EJB3" module, since EJB3 annotations are plain
+ JDK 5 annotations).</para>
+
+ <para>For more and runnable concrete examples read the JBoss EJB 3.0
+ tutorial or review the Hibernate Annotations test suite. Most of the unit
+ tests have been designed to represent a concrete example and be a
+ inspiration source.</para>
+
+ <section id="entity-mapping-entity">
+ <title>Declaring an entity bean</title>
+
+ <para>Every bound persistent POJO class is an entity bean and is
+ declared using the <literal>@Entity</literal> annotation (at the class
+ level):</para>
+<programlisting language="Java" role="Java">
+<xi:include parse="text" href="../extras/Flight.java"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+
+ <para><literal>@Entity</literal> declares the class as an entity
bean
+ (i.e. a persistent POJO class), <literal>@Id</literal> declares the
+ identifier property of this entity bean. The other mapping declarations
+ are implicit. This configuration by exception concept is central to the
+ new EJB3 specification and a major improvement. The class Flight is
+ mapped to the Flight table, using the column id as its primary key
+ column.</para>
+
+ <para>Depending on whether you annotate fields or methods, the access
+ type used by Hibernate will be <literal>field</literal> or
+ <literal>property</literal>. The EJB3 spec requires that you declare
+ annotations on the element type that will be accessed, i.e. the getter
+ method if you use <literal>property</literal> access, the field if you
+ use <literal>field</literal> access. Mixing EJB3 annotations in both
+ fields and methods should be avoided. Hibernate will guess the access
+ type from the position of <literal>@Id</literal> or
+ <literal>(a)EmbeddedId</literal>.</para>
+
+ <section>
+ <title>Defining the table</title>
+
+ <para><literal>@Table</literal> is set at the class level; it
allows
+ you to define the table, catalog, and schema names for your entity
+ bean mapping. If no <literal>@Table</literal> is defined the default
+ values are used: the unqualified class name of the entity.</para>
+
+ <programlisting language="Java" role="Java">@Entity
+@Table(name="tbl_sky")
+public class Sky implements Serializable {
+...</programlisting>
+
+ <para>The <literal>@Table</literal> element also contains a
+ <literal>schema</literal> and a
<literal>catalog</literal> attributes,
+ if they need to be defined. You can also define unique constraints to
+ the table using the <literal>@UniqueConstraint</literal> annotation
in
+ conjunction with <literal>@Table</literal> (for a unique constraint
+ bound to a single column, refer to
<literal>(a)Column</literal>).</para>
+
+ <programlisting language="Java"
role="Java">@Table(name="tbl_sky",
+ uniqueConstraints = {@UniqueConstraint(columnNames={"month",
"day"})}
+)</programlisting>
+
+ <para>A unique constraint is applied to the tuple month, day. Note
+ that the <literal>columnNames</literal> array refers to the logical
+ column names.</para>
+
+<!-- restoreCommunity:removing as remark is "colourful" in publican
+ <remark>The logical column name is defined by the Hibernate
+ NamingStrategy implementation. The default EJB3 naming strategy use
+ the physical column name as the logical column name. Note that this
+ may be different than the property name (if the column name is
+ explicit). Unless you override the NamingStrategy, you shouldn't worry
+ about that.</remark>
+-->
+ <para>
+ The logical column name is defined by the Hibernate
+ NamingStrategy implementation. The default EJB3 naming strategy use
+ the physical column name as the logical column name. Note that this
+ may be different than the property name (if the column name is
+ explicit). Unless you override the NamingStrategy, you shouldn't worry
+ about that.
+ </para>
+ </section>
+
+ <section id="entity-mapping-entity-version"
revision="1">
+ <title>Versioning for optimistic locking</title>
+
+ <para>You can add optimistic locking capability to an entity bean
+ using the <literal>@Version</literal> annotation:</para>
+
+<programlisting language="Java" role="Java">
+<xi:include parse="text" href="../extras/Flight_a.java"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+
+ <para>The version property will be mapped to the
+ <literal>OPTLOCK</literal> column, and the entity manager will use
it
+ to detect conflicting updates (preventing lost updates you might
+ otherwise see with the last-commit-wins strategy).</para>
+
+ <para>The version column may be a numeric (the recommended solution)
+ or a timestamp as per the EJB3 spec. Hibernate support any kind of
+ type provided that you define and implement the appropriate
+ <classname>UserVersionType</classname>.</para>
+
+ <para>The application must not alter the version number set up by
+ Hibernate in any way. To artificially increase the version number,
+ check in Hibernate Entity Manager's reference documentation
+ <literal>LockMode.WRITE</literal></para>
+ </section>
+ </section>
+
+ <section id="entity-mapping-property" revision="1">
+ <title>Mapping simple properties</title>
+
+ <section>
+ <title>Declaring basic property mappings</title>
+
+ <para>Every non static non transient property (field or method) of an
+ entity bean is considered persistent, unless you annotate it as
+ <literal>@Transient</literal>. Not having an annotation for your
+ property is equivalent to the appropriate <literal>@Basic</literal>
+ annotation. The <literal>@Basic</literal> annotation allows you to
+ declare the fetching strategy for a property:</para>
+
+<programlisting language="Java" role="Java">
+<xi:include parse="text" href="../extras/Basic_Annotation.java"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+
+ <para><literal>counter</literal>, a transient field, and
+ <literal>lengthInMeter</literal>, a method annotated as
+ <literal>@Transient</literal>, and will be ignored by the entity
+ manager. <literal>name</literal>,
<literal>length</literal>, and
+ <literal>firstname</literal> properties are mapped persistent and
+ eagerly fetched (the default for simple properties). The
+ <literal>detailedComment</literal> property value will be lazily
+ fetched from the database once a lazy property of the entity is
+ accessed for the first time. Usually you don't need to lazy simple
+ properties (not to be confused with lazy association fetching).</para>
+
+ <note>
+ <para>To enable property level lazy fetching, your classes have to
+ be instrumented: bytecode is added to the original one to enable
+ such feature, please refer to the Hibernate reference documentation.
+ If your classes are not instrumented, property level lazy loading is
+ silently ignored.</para>
+ </note>
+
+ <para>The recommended alternative is to use the projection capability
+ of EJB-QL or Criteria queries.</para>
+
+ <para>EJB3 support property mapping of all basic types supported by
+ Hibernate (all basic Java types , their respective wrappers and
+ serializable classes). Hibernate Annotations support out of the box
+ Enum type mapping either into a ordinal column (saving the enum
+ ordinal) or a string based column (saving the enum string
+ representation): the persistence representation, defaulted to ordinal,
+ can be overriden through the <literal>@Enumerated</literal>
annotation
+ as shown in the <literal>note</literal> property
example.</para>
+
+ <para>In core Java APIs, the temporal precision is not defined. When
+ dealing with temporal data you might want to describe the expected
+ precision in database. Temporal data can have
<literal>DATE</literal>,
+ <literal>TIME</literal>, or <literal>TIMESTAMP</literal>
precision (ie
+ the actual date, only the time, or both). Use the
+ <literal>@Temporal</literal> annotation to fine tune
that.</para>
+
+ <para><literal>@Lob</literal> indicates that the property
should be
+ persisted in a Blob or a Clob depending on the property type:
+ <classname>java.sql.Clob</classname>,
+ <classname>Character[]</classname>,
<classname>char[]</classname> and
+ java.lang.<classname>String</classname> will be persisted in a Clob.
+ <classname>java.sql.Blob</classname>,
<classname>Byte[]</classname>,
+ <classname>byte[] </classname>and serializable type will be
persisted
+ in a Blob.</para>
+
+<programlisting language="Java" role="Java">
+<xi:include parse="text" href="../extras/Lob_Ex.java"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+
+ <para>If the property type implements
+ <classname>java.io.Serializable</classname> and is not a basic type,
+ and if the property is not annotated with <literal>@Lob</literal>,
+ then the Hibernate <literal>serializable</literal> type is
+ used.</para>
+ </section>
+
+ <section id="entity-mapping-property-column"
revision="1">
+ <title>Declaring column attributes</title>
+
+ <para>The column(s) used for a property mapping can be defined using
+ the <literal>@Column</literal> annotation. Use it to override
default
+ values (see the EJB3 specification for more information on the
+ defaults). You can use this annotation at the property level for
+ properties that are:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>not annotated at all</para>
+ </listitem>
+
+ <listitem>
+ <para>annotated with
<literal>@Basic</literal></para>
+ </listitem>
+
+ <listitem>
+ <para>annotated with
<literal>@Version</literal></para>
+ </listitem>
+
+ <listitem>
+ <para>annotated with <literal>@Lob</literal></para>
+ </listitem>
+
+ <listitem>
+ <para>annotated with
<literal>@Temporal</literal></para>
+ </listitem>
+
+ <listitem>
+ <para>annotated with
+
<literal>(a)org.hibernate.annotations.CollectionOfElements</literal>
+ (for Hibernate only)</para>
+ </listitem>
+ </itemizedlist>
+
+<programlisting language="Java" role="Java">
+<xi:include parse="text" href="../extras/Flight_c.java"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+
+ <para>The <literal>name</literal> property is mapped to the
+ <literal>flight_name</literal> column, which is not nullable, has a
+ length of 50 and is not updatable (making the property
+ immutable).</para>
+
+ <para>This annotation can be applied to regular properties as well as
+ <literal>@Id</literal> or <literal>@Version</literal>
+ properties.</para>
+<!--
+ <programlistingco>
+ <areaspec>
+ <area coords="2 55" id="hm1" />
+
+ <area coords="3 55" id="hm2" />
+
+ <area coords="4 55" id="hm3" />
+
+ <area coords="5 55" id="hm4" />
+
+ <area coords="6 55" id="hm5" />
+
+ <area coords="7 55" id="hm6" />
+
+ <area coords="8 55" id="hm7" />
+
+ <area coords="9 55" id="hm8" />
+
+ <area coords="10 55" id="hm9" />
+
+ <area coords="11 55" id="hm10" />
+ </areaspec>
+
+ <calloutlist>
+ <callout arearefs="hm1">
+ <para><literal>name</literal> (optional): the column
name
+ (default to the property name)</para>
+ </callout>
+
+ <callout arearefs="hm2">
+ <para><literal>unique</literal> (optional): set a unique
+ constraint on this column or not (default false)</para>
+ </callout>
+
+ <callout arearefs="hm3">
+ <para><literal>nullable</literal> (optional): set the
column as
+ nullable (default true).</para>
+ </callout>
+
+ <callout arearefs="hm4">
+ <para><literal>insertable</literal> (optional): whether
or not
+ the column will be part of the insert statement (default
+ true)</para>
+ </callout>
+
+ <callout arearefs="hm5">
+ <para><literal>updatable</literal> (optional): whether or
not
+ the column will be part of the update statement (default
+ true)</para>
+ </callout>
+
+ <callout arearefs="hm6">
+ <para><literal>columnDefinition</literal> (optional):
override
+ the sql DDL fragment for this particular column (non
+ portable)</para>
+ </callout>
+
+ <callout arearefs="hm7">
+ <para><literal>table</literal> (optional): define the
targeted
+ table (default primary table)</para>
+ </callout>
+
+ <callout arearefs="hm8">
+
<para><literal><literal>length</literal></literal>
(optional):
+ column length (default 255)</para>
+ </callout>
+
+ <callout arearefs="hm8">
+
<para><literal><literal>precision</literal></literal>
+ (optional): column decimal precision (default 0)</para>
+ </callout>
+
+ <callout arearefs="hm10">
+
<para><literal><literal>scale</literal></literal>
(optional):
+ column decimal scale if useful (default 0)</para>
+ </callout>
+ </calloutlist>
+
+ </programlistingco>
+-->
+
+
+<programlisting language="Java" role="Java">
+<xi:include parse="text" href="../extras/column_properties.java"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+ <itemizedlist>
+ <listitem>
+ <para><literal>name</literal> (optional): the column
name
+ (default to the property name)</para>
+ </listitem>
+
+ <listitem>
+ <para><literal>unique</literal> (optional): set a unique
+ constraint on this column or not (default false)</para>
+ </listitem>
+
+ <listitem>
+ <para><literal>nullable</literal> (optional): set the
column as
+ nullable (default true).</para>
+ </listitem>
+
+ <listitem>
+ <para><literal>insertable</literal> (optional): whether
or not
+ the column will be part of the insert statement (default
+ true)</para>
+ </listitem>
+
+ <listitem>
+ <para><literal>updatable</literal> (optional): whether or
not
+ the column will be part of the update statement (default
+ true)</para>
+ </listitem>
+
+ <listitem>
+ <para><literal>columnDefinition</literal> (optional):
override
+ the sql DDL fragment for this particular column (non
+ portable)</para>
+ </listitem>
+
+ <listitem>
+ <para><literal>table</literal> (optional): define the
targeted
+ table (default primary table)</para>
+ </listitem>
+
+ <listitem>
+
<para><literal><literal>length</literal></literal>
(optional):
+ column length (default 255)</para>
+ </listitem>
+
+ <listitem>
+
<para><literal><literal>precision</literal></literal>
+ (optional): column decimal precision (default 0)</para>
+ </listitem>
+
+ <listitem>
+
<para><literal><literal>scale</literal></literal>
(optional):
+ column decimal scale if useful (default 0)</para>
+ </listitem>
+ </itemizedlist>
+ </section>
+
+ <section>
+ <title>Embedded objects (aka components)</title>
+
+ <para>It is possible to declare an embedded component inside an entity
+ and even override its column mapping. Component classes have to be
+ annotated at the class level with the <literal>@Embeddable</literal>
+ annotation. It is possible to override the column mapping of an
+ embedded object for a particular entity using the
+ <literal>@Embedded</literal> and
<literal>@AttributeOverride</literal>
+ annotation in the associated property:</para>
+
+<programlisting language="Java" role="Java">
+<xi:include parse="text" href="../extras/Person.java"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+
+<programlisting language="Java" role="Java">
+<xi:include parse="text" href="../extras/Address.java"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+
+<programlisting language="Java" role="Java">
+<xi:include parse="text" href="../extras/Country.java"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+
+ <para>A embeddable object inherit the access type of its owning entity
+ (note that you can override that using the Hibernate specific
+ <literal>@AccessType</literal> annotations (see <xref
+ linkend="entity-hibspec" />).</para>
+
+ <para>The <literal>Person</literal> entity bean has two
component
+ properties, <literal>homeAddress</literal> and
+ <literal>bornIn</literal>. <literal>homeAddress</literal>
property has
+ not been annotated, but Hibernate will guess that it is a persistent
+ component by looking for the <literal>@Embeddable</literal>
annotation
+ in the Address class. We also override the mapping of a column name
+ (to <literal>bornCountryName</literal>) with the
+ <literal>@Embedded</literal> and <literal>@AttributeOverride
+ </literal>annotations for each mapped attribute of
+ <literal>Country</literal>. As you can see, <literal>Country
+ </literal>is also a nested component of
<literal>Address</literal>,
+ again using auto-detection by Hibernate and EJB3 defaults. Overriding
+ columns of embedded objects of embedded objects is currently not
+ supported in the EJB3 spec, however, Hibernate Annotations supports it
+ through dotted expressions.</para>
+
+
+<programlisting language="Java" role="Java">
+<xi:include parse="text" href="../extras/Override_Attributes.java"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+
+ <para>
+ Hibernate Annotations supports one
+ more feature that is not explicitly supported by the EJB3
+ specification. You can annotate a embedded object with the
+ <literal>@MappedSuperclass</literal> annotation to make the
superclass
+ properties persistent (see <literal>@MappedSuperclass</literal> for
+ more information).</para>
+
+ <para>While not supported by the EJB3 specification, Hibernate
+ Annotations allows you to use association annotations in an embeddable
+ object (ie <literal>@*ToOne</literal> nor
+ <literal>@*ToMany</literal>). To override the association columns
you
+ can use <literal>(a)AssociationOverride</literal>.</para>
+
+ <para>If you want to have the same embeddable object type twice in the
+ same entity, the column name defaulting will not work: at least one of
+ the columns will have to be explicit. Hibernate goes beyond the EJB3
+ spec and allows you to enhance the defaulting mechanism through the
+ <classname>NamingStrategy</classname>.
+ <classname>DefaultComponentSafeNamingStrategy</classname> is a small
+ improvement over the default EJB3NamingStrategy that allows embedded
+ objects to be defaulted even if used twice in the same entity.</para>
+ </section>
+
+ <section>
+ <title>Non-annotated property defaults</title>
+
+ <para>If a property is not annotated, the following rules
+ apply:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>
+ If the property is of a single type, it is mapped as @Basic
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Otherwise, if the type of the property is annotated as @Embeddable, it is
mapped as @Embedded
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Otherwise, if the type of the property is Serializable, it is mapped as
@Basic in a column holding the object in its serialized version
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Otherwise, if the type of the property is java.sql.Clob or java.sql.Blob, it
is mapped as @Lob with the appropriate LobType
+ </para>
+ </listitem>
+ </itemizedlist>
+ </section>
+ </section>
+
+ <section id="entity-mapping-identifier">
+ <title>Mapping identifier properties</title>
+
+ <para>The <literal>@Id</literal> annotation lets you define
which
+ property is the identifier of your entity bean. This property can be set
+ by the application itself or be generated by Hibernate (preferred). You
+ can define the identifier generation strategy thanks to the
+ <literal>@GeneratedValue</literal> annotation:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>
+ AUTO - either identity column, sequence or table depending on the underlying
DB
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ TABLE - table holding the id
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ IDENTITY - identity column
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ SEQUENCE - sequence
+ </para>
+ </listitem>
+ </itemizedlist>
+
+ <para>Hibernate provides more id generators than the basic EJB3 ones.
+ Check <xref linkend="entity-hibspec" /> for more
information.</para>
+
+ <para>The following example shows a sequence generator using the
+ SEQ_STORE configuration (see below)</para>
+
+ <programlisting role="Java" language="Java">
+@Id @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="SEQ_STORE")
+public Integer getId() { ... }
+ </programlisting>
+
+ <para>The next example uses the identity generator:</para>
+
+ <programlisting role="Java" language="Java">
+@Id @GeneratedValue(strategy=GenerationType.IDENTITY)
+public Long getId() { ... }
+ </programlisting>
+
+ <para>The <literal>AUTO</literal> generator is the preferred type
for
+ portable applications (across several DB vendors). The identifier
+ generation configuration can be shared for several
+ <literal>@Id</literal> mappings with the generator attribute. There
are
+ several configurations available through
+ <literal>@SequenceGenerator</literal> and
+ <literal>@TableGenerator</literal>. The scope of a generator can be
the
+ application or the class. Class-defined generators are not visible
+ outside the class and can override application level generators.
+ Application level generators are defined at XML level (see <xref
+ linkend="xml-overriding" />):</para>
+
+ <programlisting language="XML" role="XML">
+<xi:include parse="text"
href="../extras/table_generator.xml_sample"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+ <para>
+ and the annotation equivalent:
+ </para>
+
+ <programlisting language="Java" role="Java">
+<xi:include parse="text" href="../extras/Table_Generator.java"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+
+<programlisting language="XML" role="XML">
+<xi:include parse="text"
href="../extras/sequence_generator.xml_sample"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+ <para>
+ and the annotation equivalent:
+ </para>
+
+ <programlisting language="Java" role="Java">
+<xi:include parse="text" href="../extras/Sequence_Generator.java"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+
+
+ <para>If JPA XML (like <filename>META-INF/orm.xml</filename>) is
used to
+ define thegenerators, <literal>EMP_GEN</literal> and
+ <literal>SEQ_GEN</literal> are application level generators.
+ <literal>EMP_GEN</literal> defines a table based id generator using
the
+ hilo algorithm with a <literal>max_lo</literal> of 20. The hi value is
+ kept in a <literal>table</literal>
"<literal>GENERATOR_TABLE</literal>".
+ The information is kept in a row where <literal>pkColumnName</literal>
+ "key" is equals to <literal>pkColumnValue</literal>
+ "<literal>EMP</literal>" and column
<literal>valueColumnName</literal>
+ "<literal>hi</literal>" contains the the next high value
used.</para>
+
+ <para><literal>SEQ_GEN</literal> defines a sequence generator
using a
+ sequence named <literal>my_sequence</literal>. The allocation size
used
+ for this sequence based hilo algorithm is 20. Note that this version of
+ Hibernate Annotations does not handle <literal>initialValue</literal>
in
+ the sequence generator. The default allocation size is 50, so if you
+ want to use a sequence and pickup the value each time, you must set the
+ allocation size to 1.</para>
+
+ <note>
+ <para>Package level definition is no longer supported by the EJB 3.0
+ specification. However, you can use the
+ <literal>@GenericGenerator</literal> at the package level (see
<xref
+ linkend="entity-hibspec-identifier" />).</para>
+ </note>
+
+ <para>The next example shows the definition of a sequence generator in a
+ class scope:</para>
+
+ <programlisting language="Java" role="Java">
+<xi:include parse="text" href="../extras/Store.java"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+
+ <para>This class will use a sequence named my_sequence and the SEQ_STORE
+ generator is not visible in other classes. Note that you can check the
+ Hibernate Annotations tests in the
+ <package>org.hibernate.test.annotations.id</package> package for more
+ examples.</para>
+
+ <para>You can define a composite primary key through several
+ syntaxes:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>
+ annotate the component property as @Id and make the component class
@Embeddable
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ annotate the component property as @EmbeddedId
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ annotate the class as @IdClass and annotate each property of the entity
involved in the primary key with @Id
+ </para>
+ </listitem>
+ </itemizedlist>
+
+ <para>While quite common to the EJB2 developer,
+ <literal>@IdClass</literal> is likely new for Hibernate users. The
+ composite primary key class corresponds to multiple fields or properties
+ of the entity class, and the names of primary key fields or properties
+ in the primary key class and those of the entity class must match and
+ their types must be the same. Let's look at an example:</para>
+
+<programlisting language="Java" role="Java">
+<xi:include parse="text" href="../extras/Footballer.java"
xmlns:xi="http://www.w3.org/2001/XInclude" /></programlisting>
+
+<programlisting language="Java" role="Java">
+<xi:include parse="text" href="../extras/FootballerPk.java"
xmlns:xi="http://www.w3.org/2001/XInclude" /></programlisting>
+
+ <para>As you may have seen, <literal>@IdClass</literal> points to
the
+ corresponding primary key class.</para>
+
+ <para>While not supported by the EJB3 specification, Hibernate allows
+ you to define associations inside a composite identifier. Simply use the
+ regular annotations for that</para>
+
+ <programlisting language="Java" role="Java">
+<xi:include parse="text" href="../extras/TvMagazin.java"
xmlns:xi="http://www.w3.org/2001/XInclude" /></programlisting>
+ </section>
+
+ <section>
+ <title>Mapping inheritance</title>
+
+ <para>EJB3 supports the three types of inheritance:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>
+ Table per Class Strategy: the <union-class> element in Hibernate
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Single Table per Class Hierarchy Strategy: the <subclass>
element in Hibernate
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Joined Subclass Strategy: the <joined-subclass> element in Hibernate
</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>The chosen strategy is declared at the class level of the top
+ level entity in the hierarchy using the
<literal>@Inheritance</literal>
+ annotation.</para>
+
+ <note>
+ <para>Annotating interfaces is currently not supported.</para>
+ </note>
+
+ <section>
+ <title>Table per class</title>
+
+ <para>This strategy has many drawbacks (esp. with polymorphic queries
+ and associations) explained in the EJB3 spec, the Hibernate reference
+ documentation, Hibernate in Action, and many other places. Hibernate
+ work around most of them implementing this strategy using <literal>SQL
+ UNION</literal> queries. It is commonly used for the top level of an
+ inheritance hierarchy:</para>
+
+ <programlisting role="Java" language="Java">@Entity
+@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
+public class Flight implements Serializable {</programlisting>
+
+ <para>This strategy support one to many associations provided that
+ they are bidirectional. This strategy does not support the
+ <literal>IDENTITY</literal> generator strategy: the id has to be
+ shared across several tables. Consequently, when using this strategy,
+ you should not use <literal>AUTO </literal>nor
+ <literal>IDENTITY</literal>.</para>
+ </section>
+
+ <section>
+ <title>Single table per class hierarchy</title>
+
+ <para>All properties of all super- and subclasses are mapped into the
+ same table, instances are distinguished by a special discriminator
+ column:</para>
+
+<programlisting language="Java" role="Java">
+<xi:include parse="text" href="../extras/Plane.java"
xmlns:xi="http://www.w3.org/2001/XInclude" /></programlisting>
+
+<programlisting language="Java" role="Java">
+<xi:include parse="text" href="../extras/A320.java"
xmlns:xi="http://www.w3.org/2001/XInclude" /></programlisting>
+
+ <para><classname>Plane</classname> is the superclass, it
defines the
+ inheritance strategy
<literal>InheritanceType.SINGLE_TABLE</literal>.
+ It also defines the discriminator column through the
+ <literal>@DiscriminatorColumn</literal> annotation, a discriminator
+ column can also define the discriminator type. Finally, the
+ <literal>@DiscriminatorValue</literal> annotation defines the value
+ used to differentiate a class in the hierarchy. All of these
+ attributes have sensible default values. The default name of the
+ discriminator column is <literal>DTYPE</literal>. The default
+ discriminator value is the entity name (as defined in
+ <literal>(a)Entity.name</literal>) for DiscriminatorType.STRING.
+ <classname>A320</classname> is a subclass; you only have to define
+ discriminator value if you don't want to use the default value. The
+ strategy and the discriminator type are implicit.</para>
+
+ <para><literal>@Inheritance</literal> and
+ <literal>@DiscriminatorColumn</literal> should only be defined at
the
+ top of the entity hierarchy.</para>
+ </section>
+
+ <section>
+ <title>Joined subclasses</title>
+
+ <para>The<literal> @PrimaryKeyJoinColumn</literal> and
+ <literal>@PrimaryKeyJoinColumns</literal> annotations define the
+ primary key(s) of the joined subclass table:</para>
+
+<programlisting language="Java" role="Java">
+<xi:include parse="text" href="../extras/Boat.java"
xmlns:xi="http://www.w3.org/2001/XInclude" /></programlisting>
+
+<programlisting language="Java" role="Java">
+<xi:include parse="text" href="../extras/Ferry.java"
xmlns:xi="http://www.w3.org/2001/XInclude" /></programlisting>
+
+<programlisting language="Java" role="Java">
+<xi:include parse="text" href="../extras/AmericaCupClass.java"
xmlns:xi="http://www.w3.org/2001/XInclude" /></programlisting>
+
+ <para>All of the above entities use the
<literal>JOINED</literal>
+ strategy, the <literal>Ferry</literal> table is joined with the
+ <literal>Boat</literal> table using the same primary key names. The
+ <literal>AmericaCupClass</literal> table is joined with
+ <literal>Boat</literal> using the join condition <code>Boat.id
=
+ AmericaCupClass.BOAT_ID</code>.</para>
+ </section>
+
+ <section>
+ <title>Inherit properties from superclasses</title>
+
+ <para>This is sometimes useful to share common properties through a
+ technical or a business superclass without including it as a regular
+ mapped entity (ie no specific table for this entity). For that purpose
+ you can map them as
<literal>(a)MappedSuperclass</literal>.</para>
+
+<programlisting language="Java" role="Java">
+<xi:include parse="text" href="../extras/BaseEntity.java"
xmlns:xi="http://www.w3.org/2001/XInclude" /></programlisting>
+
+<programlisting language="Java" role="Java">
+<xi:include parse="text" href="../extras/Order.java"
xmlns:xi="http://www.w3.org/2001/XInclude" /></programlisting>
+
+ <para>In database, this hierarchy will be represented as an
+ <literal>Order</literal> table having the
<literal>id</literal>,
+ <literal>lastUpdate</literal> and
<literal>lastUpdater</literal>
+ columns. The embedded superclass property mappings are copied into
+ their entity subclasses. Remember that the embeddable superclass is
+ not the root of the hierarchy though.</para>
+
+ <note>
+ <para>Properties from superclasses not mapped as
+ <literal>@MappedSuperclass</literal> are ignored.</para>
+ </note>
+
+ <note>
+ <para>The access type (field or methods), is inherited from the root
+ entity, unless you use the Hibernate annotation
+ <literal>@AccessType</literal></para>
+ </note>
+
+ <note>
+ <para>The same notion can be applied to
+ <literal>@Embeddable</literal> objects to persist properties from
+ their superclasses. You also need to use
+ <literal>@MappedSuperclass</literal> to do that (this should not
be
+ considered as a standard EJB3 feature though)</para>
+ </note>
+
+ <note>
+ <para>It is allowed to mark a class as
+ <literal>@MappedSuperclass</literal> in the middle of the mapped
+ inheritance hierarchy.</para>
+ </note>
+
+ <note>
+ <para>Any class in the hierarchy non annotated with
+ <literal>@MappedSuperclass</literal> nor
<literal>@Entity</literal>
+ will be ignored.</para>
+ </note>
+
+ <para>You can override columns defined in entity superclasses at the
+ root entity level using the <literal>@AttributeOverride</literal>
+ annotation.</para>
+
+<programlisting language="Java" role="Java"><xi:include
parse="text" href="../extras/FlyingObject.java"
xmlns:xi="http://www.w3.org/2001/XInclude" /></programlisting>
+
+<programlisting language="Java" role="Java"><xi:include
parse="text" href="../extras/Plane_a.java"
xmlns:xi="http://www.w3.org/2001/XInclude" /></programlisting>
+
+ <para>The <literal>altitude</literal> property will be
persisted in an
+ <literal>fld_altitude</literal> column of table
+ <literal>Plane</literal> and the propulsion association will be
+ materialized in a <literal>fld_propulsion_fk</literal> foreign key
+ column.</para>
+
+ <para>You can define <literal>@AttributeOverride</literal>(s)
and
+ <literal>@AssociationOverride</literal>(s) on
+ <literal>@Entity</literal> classes,
+ <literal>@MappedSuperclass</literal> classes and properties pointing
+ to an <literal>@Embeddable</literal> object.</para>
+ </section>
+ </section>
+
+ <section id="entity-mapping-association">
+ <title>Mapping entity bean associations/relationships</title>
+
+ <section>
+ <title>One-to-one</title>
+
+ <para>You can associate entity beans through a one-to-one relationship
+ using <literal>@OneToOne</literal>. There are three cases for
+ one-to-one associations: either the associated entities share the same
+ primary keys values, a foreign key is held by one of the entities
+ (note that this FK column in the database should be constrained unique
+ to simulate one-to-one multiplicity), or a association table is used
+ to store the link between the 2 entities (a unique constraint has to
+ be defined on each fk to ensure the one to one multiplicity)</para>
+
+ <para>First, we map a real one-to-one association using shared primary
+ keys:</para>
+
+ <programlisting>
+@Entity
+public class Body {
+ @Id
+ public Long getId() { return id; }
+
+ @OneToOne(cascade = CascadeType.ALL)
+ @PrimaryKeyJoinColumn
+ public Heart getHeart() {
+ return heart;
+ }
+ ...
+}
+ </programlisting>
+
+ <programlisting>
+@Entity
+public class Heart {
+ @Id
+ public Long getId() { ...}
+}
+ </programlisting>
+
+ <para>The one to one is marked as true by using the
+ <literal>@PrimaryKeyJoinColumn</literal> annotation.</para>
+
+ <para>In the following example, the associated entities are linked
+ through a foreign key column:</para>
+
+ <programlisting>
+@Entity
+public class Customer implements Serializable {
+ @OneToOne(cascade = CascadeType.ALL)
+ @JoinColumn(name="passport_fk")
+ public Passport getPassport() {
+ ...
+ }
+
+@Entity
+public class Passport implements Serializable {
+ @OneToOne(mappedBy = "passport")
+ public Customer getOwner() {
+ ...
+}
+ </programlisting>
+
+ <para>A <classname>Customer</classname> is linked to a
+ <classname>Passport</classname>, with a foreign key column named
+ <literal>passport_fk</literal> in the
<literal>Customer</literal>
+ table. The join column is declared with the
+ <literal>@JoinColumn</literal> annotation which looks like the
+ <literal>@Column</literal> annotation. It has one more parameters
+ named <literal>referencedColumnName</literal>. This parameter
declares
+ the column in the targeted entity that will be used to the join. Note
+ that when using
+
<literal><literal>referencedColumnName</literal></literal> to a
non
+ primary key column, the associated class has to be
+ <classname>Serializable</classname>. Also note that the
+
<literal><literal>referencedColumnName</literal></literal> to a
non
+ primary key column has to be mapped to a property having a single
+ column (other cases might not work).</para>
+
+ <para>The association may be bidirectional. In a bidirectional
+ relationship, one of the sides (and only one) has to be the owner: the
+ owner is responsible for the association column(s) update. To declare
+ a side as not responsible for the relationship,
+ the attribute <literal>mappedBy</literal> is used.
+ <literal>mappedBy</literal> refers to the property name of the
+ association on the owner side. In our case, this is
+ <literal>passport</literal>. As you can see, you don't have to
(must
+ not) declare the join column since it has already been declared on the
+ owners side.</para>
+
+ <para>If no <literal>@JoinColumn</literal> is declared on the
owner
+ side, the defaults apply. A join column(s) will be created in the
+ owner table and its name will be the concatenation of the name of the
+ relationship in the owner side, <keycap>_</keycap> (underscore), and
+ the name of the primary key column(s) in the owned side. In this
+ example <literal>passport_id</literal> because the property name is
+ <literal>passport</literal> and the column id of
<literal>Passport
+ </literal>is <literal>id</literal>.</para>
+
+ <para>The third possibility (using an association table) is very
+ exotic.</para>
+
+ <programlisting>
+@Entity
+public class Customer implements Serializable {
+ @OneToOne(cascade = CascadeType.ALL)
+ @JoinTable(name = "CustomerPassports",
+ joinColumns = @JoinColumn(name="customer_fk"),
+ inverseJoinColumns = @JoinColumn(name="passport_fk")
+ )
+ public Passport getPassport() {
+ ...
+ }
+
+@Entity
+public class Passport implements Serializable {
+ @OneToOne(mappedBy = "passport")
+ public Customer getOwner() {
+ ...
+}
+ </programlisting>
+
+ <para>A <classname>Customer</classname> is linked to a
+ <classname>Passport</classname> through a association table named
+ <literal>CustomerPassports</literal> ; this association table has a
+ foreign key column named <literal>passport_fk</literal> pointing to
+ the <literal>Passport</literal> table (materialized by the
+ <literal>inverseJoinColumn</literal>, and a foreign key column named
+ <literal>customer_fk</literal> pointing to the
+ <literal>Customer</literal> table materialized by the
+ <literal>joinColumns</literal> attribute.</para>
+
+ <para>You must declare the join table name and the join columns
+ explicitly in such a mapping.</para>
+ </section>
+
+ <section>
+ <title>Many-to-one</title>
+
+ <para>Many-to-one associations are declared at the property level with
+ the annotation <literal>@ManyToOne</literal>:</para>
+
+ <programlisting>
+@Entity()
+public class Flight implements Serializable {
+ @ManyToOne( cascade = {CascadeType.PERSIST, CascadeType.MERGE} )
+ @JoinColumn(name="COMP_ID")
+ public Company getCompany() {
+ return company;
+ }
+ ...
+}
+ </programlisting>
+
+ <para>The <literal>@JoinColumn</literal> attribute is optional,
the
+ default value(s) is like in one to one, the concatenation of the name
+ of the relationship in the owner side, <keycap>_</keycap>
+ (underscore), and the name of the primary key column in the owned
+ side. In this example <literal>company_id</literal> because the
+ property name is <literal>company</literal> and the column id of
+ Company is <literal>id</literal>.</para>
+
+ <para><literal>@ManyToOne</literal> has a parameter named
+ <literal>targetEntity</literal> which describes the target entity
+ name. You usually don't need this parameter since the default value
+ (the type of the property that stores the association) is good in
+ almost all cases. However this is useful when you want to use
+ interfaces as the return type instead of the regular entity.</para>
+
+ <programlisting>
+@Entity()
+public class Flight implements Serializable {
+ @ManyToOne( cascade = {CascadeType.PERSIST, CascadeType.MERGE},
targetEntity=CompanyImpl.class )
+ @JoinColumn(name="COMP_ID")
+ public Company getCompany() {
+ return company;
+ }
+ ...
+}
+
+public interface Company {
+ ...
+ </programlisting>
+
+ <para>You can alse map a many to one association through an
+ association table. This association table described by the
+ <literal>@JoinTable</literal> annotation will contains a foreign key
+ referencing back the entity table (through
+ <literal>(a)JoinTable.joinColumns</literal>) and a a foreign key
+ referencing the target entity table (through
+ <literal>(a)JoinTable.inverseJoinColumns</literal>).</para>
+
+ <programlisting>
+@Entity()
+public class Flight implements Serializable {
+ @ManyToOne( cascade = {CascadeType.PERSIST, CascadeType.MERGE} )
+ @JoinTable(name="Flight_Company",
+ joinColumns = @JoinColumn(name="FLIGHT_ID"),
+ inverseJoinColumns = @JoinColumn(name="COMP_ID")
+ )
+ public Company getCompany() {
+ return company;
+ }
+ ...
+}
+ </programlisting>
+ </section>
+
+ <section id="entity-mapping-association-collections"
revision="1">
+ <title>Collections</title>
+
+ <section id="entity-mapping-association-collections-overview"
+ revision="1">
+ <title>Overview</title>
+
+ <para>You can map <classname>Collection</classname>,
+ <literal>List</literal> (ie ordered lists, not indexed lists),
+ <literal>Map</literal> and <classname>Set</classname>.
The EJB3
+ specification describes how to map an ordered list (ie a list
+ ordered at load time) using
+ <literal>(a)javax.persistence.OrderBy</literal> annotation: this
+ annotation takes into parameter a list of comma separated (target
+ entity) properties to order the collection by (eg <code>firstname
+ asc, age desc</code>), if the string is empty, the collection will
+ be ordered by id. For true indexed collections, please refer to the
+ <xref linkend="entity-hibspec" />. EJB3 allows you to map Maps
using
+ as a key one of the target entity property using
+ <literal>@MapKey(name="myProperty")</literal> (myProperty
is a
+ property name in the target entity). When using
+ <literal>@MapKey</literal> (without property name), the target
+ entity primary key is used. The map key uses the same column as the
+ property pointed out: there is no additional column defined to hold
+ the map key, and it does make sense since the map key actually
+ represent a target property. Be aware that once loaded, the key is
+ no longer kept in sync with the property, in other words, if you
+ change the property value, the key will not change automatically in
+ your Java model (for true map support please refers to <xref
+ linkend="entity-hibspec" />). Many people confuse
+ <literal><map></literal> capabilities and
+ <literal>@MapKey</literal> ones. These are two different features.
+ <literal>@MapKey</literal> still has some limitations, please
check
+ the forum or the JIRA tracking system for more information.</para>
+
+ <para>Hibernate has several notions of collections.</para>
+
+ <para></para>
+
+ <table>
+ <title>Collections semantics</title>
+
+ <tgroup cols="3" align="left">
+ <colspec colname="c1" colwidth="1*"/>
+
+ <colspec colname="c2" colwidth="1*"/>
+
+ <colspec colname="c3" colnum="2"
colwidth="2*"/>
+
+ <thead>
+ <row>
+ <entry>Semantic</entry>
+
+ <entry>java representation</entry>
+
+ <entry>annotations</entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry>Bag semantic</entry>
+
+
<entry><para>java.util.List</para><para>java.util.Collection</para></entry>
+
+ <entry>
+ <para>
+ @org.hibernate.
+ annotations.
+ CollectionOfElements
+ </para>
+ <para>or @OneToMany</para>
+ <para>or @ManyToMany</para></entry>
+ </row>
+
+ <row>
+ <entry>Bag semantic with primary key (withtout the
+ limitations of Bag semantic)</entry>
+
+ <entry>java.util.List, java.util.Collection</entry>
+
+ <entry>
+ <para>
+ (@org.hibernate.
+ annotations.
+ CollectionOfElements
+ </para>
+ <para>or @OneToMany</para>
+ <para>or @ManyToMany)</para>
+ <para>and @CollectionId</para>
+ </entry>
+ </row>
+
+ <row>
+ <entry>List semantic</entry>
+ <entry>java.util.List</entry>
+
+ <entry>
+ (@org.hibernate.
+ annotations.
+ CollectionOfElements
+ <para>or @OneToMany</para>
+ <para>or @ManyToMany)</para>
+ <para>
+ and
+ </para>
+ @org.hibernate.
+ annotations.
+ IndexColumn
+ </entry>
+ </row>
+
+ <row>
+ <entry>Set semantic</entry>
+
+ <entry>java.util.Set</entry>
+
+ <entry>
+ @org.hibernate.
+ annotations.
+ CollectionOfElements
+
+ <para>or @OneToMany </para>
+ <para>or @ManyToMany</para>
+ </entry>
+ </row>
+
+ <row>
+ <entry>Map semantic</entry>
+
+ <entry>java.util.Map</entry>
+
+ <entry>
+ (@org.hibernate.
+ annotations.
+ CollectionOfElements
+ <para>or @OneToMany</para>
+ <para>or @ManyToMany)</para>
+ <para>and</para>
+ (nothing or
+ @org.hibernate.
+ annotations.MapKey
+ /MapKeyManyToMany
+ for true map support,
+ OR @javax.persistence.
+ MapKey
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+<!-- restoreCommunity:removing as remark is "colourful" in publican
+ <remark>So specifically, java.util.List collections without
+ @org.hibernate.annotations.IndexColumn are going to be considered as
+ bags.</remark>
+-->
+ <para>So specifically, java.util.List collections without
+ @org.hibernate.annotations.IndexColumn are going to be considered as
+ bags.
+ </para>
+
+ <para>Collection of primitive, core type or embedded objects is not
+ supported by the EJB3 specification. Hibernate Annotations allows
+ them however (see <xref linkend="entity-hibspec"
/>).</para>
+
+ <programlisting>@Entity public class City {
+ @OneToMany(mappedBy="city")
+ @OrderBy("streetName")
+ public List<Street> getStreets() {
+ return streets;
+ }
+...
+}
+
+@Entity public class Street {
+ public String getStreetName() {
+ return streetName;
+ }
+
+ @ManyToOne
+ public City getCity() {
+ return city;
+ }
+ ...
+}
+
+
+@Entity
+public class Software {
+ @OneToMany(mappedBy="software")
+ @MapKey(name="codeName")
+ public Map<String, Version> getVersions() {
+ return versions;
+ }
+...
+}
+
+@Entity
+@Table(name="tbl_version")
+public class Version {
+ public String getCodeName() {...}
+
+ @ManyToOne
+ public Software getSoftware() { ... }
+...
+}</programlisting>
+
+ <para>So <literal>City</literal> has a collection of
+ <literal>Street</literal>s that are ordered by
+ <literal>streetName</literal> (of
<literal>Street</literal>) when
+ the collection is loaded. <literal>Software</literal> has a map of
+ <literal>Version</literal>s which key is the
+ <literal>Version</literal>
<literal>codeName</literal>.</para>
+
+ <para>Unless the collection is a generic, you will have to define
+ <literal>targetEntity</literal>. This is a annotation attribute
that
+ take the target entity class as a value.</para>
+ </section>
+
+ <section id="entity-mapping-association-collection-onetomany"
+ revision="2">
+ <title>One-to-many</title>
+
+ <para>One-to-many associations are declared at the property level
+ with the annotation <literal>@OneToMany</literal>. One to many
+ associations may be bidirectional.</para>
+
+ <section>
+ <title>Bidirectional</title>
+
+ <para>Since many to one are (almost) always the owner side of a
+ bidirectional relationship in the EJB3 spec, the one to many
+ association is annotated by <literal>@OneToMany( mappedBy=...
+ )</literal></para>
+
+ <programlisting>@Entity
+public class Troop {
+ @OneToMany(mappedBy="troop")
+ public Set<Soldier> getSoldiers() {
+ ...
+}
+
+@Entity
+public class Soldier {
+ @ManyToOne
+ @JoinColumn(name="troop_fk")
+ public Troop getTroop() {
+ ...
+} </programlisting>
+
+ <para><classname>Troop</classname> has a bidirectional one
to many
+ relationship with <literal>Soldier</literal> through the
+ <literal>troop</literal> property. You don't have to (must
not)
+ define any physical mapping in the <literal>mappedBy</literal>
+ side.</para>
+
+ <para>To map a bidirectional one to many, with the one-to-many
+ side as the owning side, you have to remove the
+ <literal>mappedBy</literal> element and set the many to one
+ <literal>@JoinColumn</literal> as insertable and updatable to
+ false. This solution is obviously not optimized and will produce
+ some additional UPDATE statements.</para>
+
+ <programlisting>@Entity
+public class Troop {
+ @OneToMany
+ @JoinColumn(name="troop_fk") //we need to duplicate the physical
information
+ public Set<Soldier> getSoldiers() {
+ ...
+}
+
+@Entity
+public class Soldier {
+ @ManyToOne
+ @JoinColumn(name="troop_fk", insertable=false, updatable=false)
+ public Troop getTroop() {
+ ...
+}</programlisting>
+ </section>
+
+ <section>
+ <title>Unidirectional</title>
+
+ <para>A unidirectional one to many using a foreign key column in
+ the owned entity is not that common and not really recommended. We
+ strongly advise you to use a join table for this kind of
+ association (as explained in the next section). This kind of
+ association is described through a
+ <literal>@JoinColumn</literal></para>
+
+ <programlisting>
+@Entity
+public class Customer implements Serializable {
+ @OneToMany(cascade=CascadeType.ALL, fetch=FetchType.EAGER)
+ @JoinColumn(name="CUST_ID")
+ public Set<Ticket> getTickets() {
+ ...
+}
+
+@Entity
+public class Ticket implements Serializable {
+ ... //no bidir
+}
+ </programlisting>
+
+ <para><literal>Customer</literal> describes a
unidirectional
+ relationship with <literal>Ticket</literal> using the join
column
+ <literal>CUST_ID</literal>.</para>
+ </section>
+
+ <section>
+ <title>Unidirectional with join table</title>
+
+ <para>A unidirectional one to many with join table is much
+ preferred. This association is described through an
+ <literal>(a)JoinTable</literal>.</para>
+
+ <programlisting>
+@Entity
+public class Trainer {
+ @OneToMany
+ @JoinTable(
+ name="TrainedMonkeys",
+ joinColumns = @JoinColumn( name="trainer_id"),
+ inverseJoinColumns = @JoinColumn( name="monkey_id")
+ )
+ public Set<Monkey> getTrainedMonkeys() {
+ ...
+}
+
+@Entity
+public class Monkey {
+ ... //no bidir
+}
+ </programlisting>
+
+ <para><literal>Trainer</literal> describes a
unidirectional
+ relationship with <classname>Monkey</classname> using the join
+ table <classname>TrainedMonkeys</classname>, with a foreign key
+ <literal>trainer_id</literal> to
<literal>Trainer</literal>
+ (<literal>joinColumns</literal>) and a foreign key
+ <literal>monkey_id</literal> to
<literal>Monkey</literal>
+ (<literal>inversejoinColumns</literal>).</para>
+ </section>
+
+ <section
id="entity-mapping-association-collection-manytomany-default"
+ revision="1">
+ <title>Defaults</title>
+
+ <para>Without describing any physical mapping, a unidirectional
+ one to many with join table is used. The table name is the
+ concatenation of the owner table name, <keycap>_</keycap>, and
the
+ other side table name. The foreign key name(s) referencing the
+ owner table is the concatenation of the owner table,
+ <keycap>_</keycap>, and the owner primary key column(s) name.
The
+ foreign key name(s) referencing the other side is the
+ concatenation of the owner property name, <keycap>_</keycap>,
and
+ the other side primary key column(s) name. A unique constraint is
+ added to the foreign key referencing the other side table to
+ reflect the one to many.</para>
+
+ <programlisting>
+@Entity
+public class Trainer {
+ @OneToMany
+ public Set<Tiger> getTrainedTigers() {
+ ...
+}
+
+@Entity
+public class Tiger {
+ ... //no bidir
+}
+ </programlisting>
+
+ <para><classname>Trainer</classname> describes a
unidirectional
+ relationship with <classname>Tiger</classname> using the join
+ table <literal>Trainer_Tiger</literal>, with a foreign key
+ <literal>trainer_id</literal> to
<literal>Trainer</literal> (table
+ name, <keycap>_</keycap>, trainer id) and a foreign key
+ <literal>trainedTigers_id</literal> to
<literal>Monkey</literal>
+ (property name, <keycap>_</keycap>, Tiger primary
column).</para>
+ </section>
+ </section>
+
+ <section id="eentity-mapping-association-collection-manytomany"
+ revision="">
+ <title>Many-to-many</title>
+
+ <section>
+ <title>Definition</title>
+
+ <para>A many-to-many association is defined logically using the
+ <literal>@ManyToMany</literal> annotation. You also have to
+ describe the association table and the join conditions using the
+ <literal>@JoinTable</literal> annotation. If the association is
+ bidirectional, one side has to be the owner and one side has to be
+ the inverse end (ie. it will be ignored when updating the
+ relationship values in the association table):</para>
+
+ <programlisting>
+@Entity
+public class Employer implements Serializable {
+ @ManyToMany(
+ targetEntity=org.hibernate.test.metadata.manytomany.Employee.class,
+ cascade={CascadeType.PERSIST, CascadeType.MERGE}
+ )
+ @JoinTable(
+ name="EMPLOYER_EMPLOYEE",
+ joinColumns=@JoinColumn(name="EMPER_ID"),
+ inverseJoinColumns=@JoinColumn(name="EMPEE_ID")
+ )
+ public Collection getEmployees() {
+ return employees;
+ }
+ ...
+}
+ </programlisting>
+
+ <programlisting>
+@Entity
+public class Employee implements Serializable {
+ @ManyToMany(
+ cascade = {CascadeType.PERSIST, CascadeType.MERGE},
+ mappedBy = "employees",
+ targetEntity = Employer.class
+ )
+ public Collection getEmployers() {
+ return employers;
+ }
+}
+ </programlisting>
+
+ <para>We've already shown the many declarations and the detailed
+ attributes for associations. We'll go deeper in the
+ <literal>@JoinTable</literal> description, it defines a
+ <literal>name</literal>, an array of join columns (an array in
+ annotation is defined using { A, B, C }), and an array of inverse
+ join columns. The latter ones are the columns of the association
+ table which refer to the <classname>Employee</classname> primary
+ key (the "other side").</para>
+
+ <para>As seen previously, the other side don't have to (must not)
+ describe the physical mapping: a simple
+ <literal>mappedBy</literal> argument containing the owner side
+ property name bind the two.</para>
+ </section>
+
+ <section>
+ <title>Default values</title>
+
+ <para>As any other annotations, most values are guessed in a many
+ to many relationship. Without describing any physical mapping in a
+ unidirectional many to many the following rules applied. The table
+ name is the concatenation of the owner table name,
+ <keycap>_</keycap> and the other side table name. The foreign
key
+ name(s) referencing the owner table is the concatenation of the
+ owner table name, <keycap>_</keycap> and the owner primary key
+ column(s). The foreign key name(s) referencing the other side is
+ the concatenation of the owner property name,
<keycap>_</keycap>,
+ and the other side primary key column(s). These are the same rules
+ used for a unidirectional one to many relationship.</para>
+
+ <programlisting>
+@Entity
+public class Store {
+ @ManyToMany(cascade = CascadeType.PERSIST)
+ public Set<City> getImplantedIn() {
+ ...
+ }
+}
+
+@Entity
+public class City {
+ ... //no bidirectional relationship
+}
+ </programlisting>
+
+ <para>A <literal>Store_City</literal> is used as the join
table.
+ The <literal>Store_id</literal> column is a foreign key to the
+ <literal>Store</literal> table. The
+ <literal>implantedIn_id</literal> column is a foreign key to the
+ <literal>City</literal> table.</para>
+
+ <para>Without describing any physical mapping in a bidirectional
+ many to many the following rules applied. The table name is the
+ concatenation of the owner table name, <keycap>_</keycap> and
the
+ other side table name. The foreign key name(s) referencing the
+ owner table is the concatenation of the other side property name,
+ <keycap>_</keycap>, and the owner primary key column(s). The
+ foreign key name(s) referencing the other side is the
+ concatenation of the owner property name, <keycap>_</keycap>,
and
+ the other side primary key column(s). These are the same rules
+ used for a unidirectional one to many relationship.</para>
+
+ <programlisting>
+@Entity
+public class Store {
+ @ManyToMany(cascade = {CascadeType.PERSIST, CascadeType.MERGE})
+ public Set<Customer> getCustomers() {
+ ...
+ }
+}
+
+@Entity
+public class Customer {
+ @ManyToMany(mappedBy="customers")
+ public Set<Store> getStores() {
+ ...
+ }
+}
+ </programlisting>
+
+ <para>A <literal>Store_Customer</literal> is used as the
join
+ table. The <literal>stores_id</literal> column is a foreign key
to
+ the <literal>Store</literal> table. The
+ <literal>customers_id</literal> column is a foreign key to the
+ <literal>Customer</literal> table.</para>
+ </section>
+ </section>
+ </section>
+
+ <section id="entity-mapping-association-cascade">
+ <title>Transitive persistence with cascading</title>
+
+ <para>You probably have noticed the <literal>cascade</literal>
+ attribute taking an array of <classname>CascadeType</classname> as a
+ value. The cascade concept in EJB3 is very is similar to the
+ transitive persistence and cascading of operations in Hibernate, but
+ with slightly different semantics and cascading types:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>
+ CascadeType.PERSIST: cascades the persist (create) operation to associated entities
persist() is called or if the entity is managed </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ CascadeType.MERGE: cascades the merge operation to associated entities if merge() is
called or if the entity is managed </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ CascadeType.REMOVE: cascades the remove operation to associated entities if delete()
is called </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ CascadeType.REFRESH: cascades the refresh operation to associated entities if
refresh() is called </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ CascadeType.ALL: all of the above </para>
+ </listitem>
+ </itemizedlist>
+
+ <note>
+ <para>CascadeType.ALL also covers Hibernate specific operations like
+ save-update, lock etc... Check <xref
+ linkend="entity-hibspec-cascade" /> for more
information</para>
+ </note>
+
+ <para>Please refer to the chapter 6.3 of the EJB3 specification for
+ more information on cascading and create/merge semantics.</para>
+ </section>
+
+ <section id="entity-mapping-association-fetching"
revision="1">
+ <title>Association fetching</title>
+
+ <para>You have the ability to either eagerly or lazily fetch
+ associated entities. The <literal>fetch</literal> parameter can be
set
+ to <literal>FetchType.LAZY</literal> or
+ <literal>FetchType.EAGER</literal>.
<literal>EAGER</literal> will try
+ to use an outer join select to retrieve the associated object, while
+ <literal>LAZY</literal> will only trigger a select when the
associated
+ object is accessed for the first time. <literal>@OneToMany</literal>
+ and <literal>@ManyToMany</literal> associations are defaulted to
+ <literal>LAZY</literal> and <literal>@OneToOne</literal>
and
+ <literal>@ManyToOne</literal> are defaulted to
+ <literal>EAGER</literal>. For more information about static
fetching,
+ check <xref linkend="entity-hibspec-singleassoc-fetching"
/>.</para>
+
+ <para>The recommanded approach is to use
<literal>LAZY</literal> onn
+ all static fetching definitions and override this choice dynamically
+ through JPA-QL. JPA-QL has a <literal>fetch</literal> keyword that
+ allows you to override laziness when doing a particular query. This is
+ very useful to improve performance and is decided on a use case to use
+ case basis.</para>
+ </section>
+ </section>
+
+ <section>
+ <title>Mapping composite primary and foreign keys</title>
+
+ <para>Composite primary keys use a embedded class as the primary key
+ representation, so you'd use the <literal>@Id</literal> and
+ <literal>@Embeddable</literal> annotations. Alternatively, you can use
+ the <literal>@EmbeddedId</literal> annotation. Note that the dependent
+ class has to be serializable and implements
+
<methodname>equals()</methodname>/<methodname>hashCode()</methodname>.
+ You can also use <literal>@IdClass</literal> as described in <xref
+ linkend="entity-mapping-identifier" />.</para>
+
+ <programlisting>
+@Entity
+public class RegionalArticle implements Serializable {
+
+ @Id
+ public RegionalArticlePk getPk() { ... }
+}
+
+@Embeddable
+public class RegionalArticlePk implements Serializable { ... }
+ </programlisting>
+
+ <para>or alternatively</para>
+
+ <programlisting>
+@Entity
+public class RegionalArticle implements Serializable {
+
+ @EmbeddedId
+ public RegionalArticlePk getPk() { ... }
+}
+
+public class RegionalArticlePk implements Serializable { ... }
+ </programlisting>
+
+ <para><literal>@Embeddable</literal> inherit the access type of
its
+ owning entity unless the Hibernate specific annotation
+ <literal>@AccessType</literal> is used. Composite foreign keys (if not
+ using the default sensitive values) are defined on associations using
+ the <literal>@JoinColumns</literal> element, which is basically an
array
+ of <literal>@JoinColumn</literal>. It is considered a good practice to
+ express <literal>referencedColumnNames</literal> explicitly.
Otherwise,
+ Hibernate will suppose that you use the same order of columns as in the
+ primary key declaration.</para>
+
+ <programlisting>
+@Entity
+public class Parent implements Serializable {
+ @Id
+ public ParentPk id;
+ public int age;
+
+ @OneToMany(cascade=CascadeType.ALL)
+ @JoinColumns ({
+ @JoinColumn(name="parentCivility", referencedColumnName =
"isMale"),
+ @JoinColumn(name="parentLastName", referencedColumnName =
"lastName"),
+ @JoinColumn(name="parentFirstName", referencedColumnName =
"firstName")
+ })
+ public Set<Child> children; //unidirectional
+ ...
+}
+ </programlisting>
+
+ <programlisting>
+@Entity
+public class Child implements Serializable {
+ @Id @GeneratedValue
+ public Integer id;
+
+ @ManyToOne
+ @JoinColumns ({
+ @JoinColumn(name="parentCivility", referencedColumnName =
"isMale"),
+ @JoinColumn(name="parentLastName", referencedColumnName =
"lastName"),
+ @JoinColumn(name="parentFirstName", referencedColumnName =
"firstName")
+ })
+ public Parent parent; //unidirectional
+}
+ </programlisting>
+
+ <programlisting>
+@Embeddable
+public class ParentPk implements Serializable {
+ String firstName;
+ String lastName;
+ ...
+}
+ </programlisting>
+
+ <para>Note the explicit usage of the
+ <literal>referencedColumnName</literal>.</para>
+ </section>
+
+ <section>
+ <title>Mapping secondary tables</title>
+
+ <para>You can map a single entity bean to several tables using the
+ <literal>@SecondaryTable</literal> or
+ <literal>@SecondaryTables</literal> class level annotations. To
express
+ that a column is in a particular table, use the
<literal>table</literal>
+ parameter of <literal>@Column</literal> or
+ <literal>(a)JoinColumn</literal>.</para>
+
+ <programlisting>
+@Entity
+@Table(name="MainCat")
+@SecondaryTables({
+ @SecondaryTable(name="Cat1", pkJoinColumns={
+ @PrimaryKeyJoinColumn(name="cat_id",
referencedColumnName="id")
+ ),
+ @SecondaryTable(name="Cat2",
uniqueConstraints={@UniqueConstraint(columnNames={"storyPart2"})})
+})
+public class Cat implements Serializable {
+
+ private Integer id;
+ private String name;
+ private String storyPart1;
+ private String storyPart2;
+
+ @Id @GeneratedValue
+ public Integer getId() {
+ return id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ @Column(table="Cat1")
+ public String getStoryPart1() {
+ return storyPart1;
+ }
+
+ @Column(table="Cat2")
+ public String getStoryPart2() {
+ return storyPart2;
+ }
+</programlisting>
+
+ <para>In this example, <literal>name</literal> will be in
+ <literal>MainCat</literal>. <literal>storyPart1</literal>
will be in
+ <literal>Cat1</literal> and <literal>storyPart2</literal>
will be in
+ <literal>Cat2</literal>. <literal>Cat1</literal> will be
joined to
+ <literal>MainCat</literal> using the
<literal>cat_id</literal> as a
+ foreign key, and <literal>Cat2</literal> using
<literal>id</literal> (ie
+ the same column name, the <literal>MainCat</literal> id column has).
+ Plus a unique constraint on <literal>storyPart2</literal> has been
+ set.</para>
+
+ <para>Check out the JBoss EJB 3 tutorial or the Hibernate Annotations
+ unit test suite for more examples.</para>
+ </section>
+ </section>
+
+ <section id="entity-mapping-query">
+ <title>Mapping Queries</title>
+
+ <section id="entity-mapping-query-hql" label="Mapping JPAQL/HQL
queries"
+ revision="1">
+ <title>Mapping JPAQL/HQL queries</title>
+
+ <para>You can map EJBQL/HQL queries using annotations.
+ <literal>@NamedQuery</literal> and
<literal>@NamedQueries</literal> can
+ be defined at the class level or in a JPA XML file. However their
+ definitions are global to the session factory/entity manager factory
+ scope. A named query is defined by its name and the actual query
+ string.</para>
+
+ <programlisting><entity-mappings>
+ <named-query name="plane.getAll">
+ <query>select p from Plane p</query>
+ </named-query>
+ ...
+</entity-mappings>
+...
+
+@Entity
+(a)NamedQuery(name="night.moreRecentThan", query="select n from Night n
where n.date >= :date")
+public class Night {
+ ...
+}
+
+public class MyDao {
+ doStuff() {
+ Query q = s.getNamedQuery("night.moreRecentThan");
+ q.setDate( "date", aMonthAgo );
+ List results = q.list();
+ ...
+ }
+ ...
+}
+ </programlisting>
+
+ <para>You can also provide some hints to a query through an array of
+ <literal>QueryHint</literal> through a
<literal>hints</literal>
+ attribute.</para>
+
+ <para>The availabe Hibernate hints are</para>
+
+ <para></para>
+
+ <table>
+ <title>Query hints</title>
+
+ <tgroup cols="2">
+ <thead>
+ <colspec colname="c1" />
+
+ <colspec colname="c2" colnum="2" />
+
+ <row>
+ <entry>hint</entry>
+
+ <entry colname="c2">description</entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry>org.hibernate.cacheable</entry>
+
+ <entry>Whether the query should interact with the second level
+ cache (defualt to false)</entry>
+ </row>
+
+ <row>
+ <entry>org.hibernate.cacheRegion</entry>
+
+ <entry>Cache region name (default used otherwise)</entry>
+ </row>
+
+ <row>
+ <entry>org.hibernate.timeout</entry>
+
+ <entry>Query timeout</entry>
+ </row>
+
+ <row>
+ <entry>org.hibernate.fetchSize</entry>
+
+ <entry>resultset fetch size</entry>
+ </row>
+
+ <row>
+ <entry>org.hibernate.flushMode</entry>
+
+ <entry>Flush mode used for this query</entry>
+ </row>
+
+ <row>
+ <entry>org.hibernate.cacheMode</entry>
+
+ <entry>Cache mode used for this query</entry>
+ </row>
+
+ <row>
+ <entry>org.hibernate.readOnly</entry>
+
+ <entry>Entities loaded by this query should be in read only mode
+ or not (default to false)</entry>
+ </row>
+
+ <row>
+ <entry>org.hibernate.comment</entry>
+
+ <entry>Query comment added to the generated SQL</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </section>
+
+ <section id="entity-mapping-query-native" revision="2">
+ <title>Mapping native queries</title>
+
+ <para>You can also map a native query (ie a plain SQL query). To achieve
+ that, you need to describe the SQL resultset structure using
+ <literal>@SqlResultSetMapping</literal> (or
+ <literal>@SqlResultSetMappings</literal> if you plan to define several
+ resulset mappings). Like <literal>@NamedQuery</literal>, a
+ <literal>@SqlResultSetMapping</literal> can be defined at class level
or
+ in a JPA XML file. However its scope is global to the
+ application.</para>
+
+ <para>As we will see, a <literal>resultSetMapping</literal>
parameter is
+ defined in <literal>@NamedNativeQuery</literal>, it represents the
name
+ of a defined <literal>@SqlResultSetMapping</literal>. The resultset
+ mapping declares the entities retrieved by this native query. Each field
+ of the entity is bound to an SQL alias (or column name). All fields of
+ the entity including the ones of subclasses and the foreign key columns
+ of related entities have to be present in the SQL query. Field
+ definitions are optional provided that they map to the same column name
+ as the one declared on the class property.</para>
+
+
<para><programlisting>@NamedNativeQuery(name="night&area",
query="select night.id nid, night.night_duration, "
+ + " night.night_date, area.id aid, night.area_id, area.name "
+ + "from Night night, Area area where night.area_id = area.id",
resultSetMapping="joinMapping")
+@SqlResultSetMapping(name="joinMapping", entities={
+ @EntityResult(entityClass=org.hibernate.test.annotations.query.Night.class, fields =
{
+ @FieldResult(name="id", column="nid"),
+ @FieldResult(name="duration", column="night_duration"),
+ @FieldResult(name="date", column="night_date"),
+ @FieldResult(name="area", column="area_id"),
+ discriminatorColumn="disc"
+ }),
+ @EntityResult(entityClass=org.hibernate.test.annotations.query.Area.class, fields =
{
+ @FieldResult(name="id", column="aid"),
+ @FieldResult(name="name", column="name")
+ })
+ }
+)</programlisting></para>
+
+ <para>In the above example, the
<literal>night&area</literal> named
+ query use the <literal>joinMapping</literal> result set mapping. This
+ mapping returns 2 entities, <literal>Night</literal> and
+ <literal>Area</literal>, each property is declared and associated to a
+ column name, actually the column name retrieved by the query. Let's now
+ see an implicit declaration of the property / column.</para>
+
+ <programlisting>@Entity
+@SqlResultSetMapping(name="implicit",
entities=(a)EntityResult(entityClass=org.hibernate.test.annotations.query.SpaceShip.class))
+@NamedNativeQuery(name="implicitSample", query="select * from
SpaceShip", resultSetMapping="implicit")
+public class SpaceShip {
+ private String name;
+ private String model;
+ private double speed;
+
+ @Id
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ @Column(name="model_txt")
+ public String getModel() {
+ return model;
+ }
+
+ public void setModel(String model) {
+ this.model = model;
+ }
+
+ public double getSpeed() {
+ return speed;
+ }
+
+ public void setSpeed(double speed) {
+ this.speed = speed;
+ }
+}</programlisting>
+
+ <para>In this example, we only describe the entity member of the result
+ set mapping. The property / column mappings is done using the entity
+ mapping values. In this case the <literal>model</literal> property is
+ bound to the <literal>model_txt </literal>column. If the association
to
+ a related entity involve a composite primary key, a
+ <literal>@FieldResult</literal> element should be used for each
foreign
+ key column. The <literal>@FieldResult</literal> name is composed of
the
+ property name for the relationship, followed by a dot ("."), followed by
+ the name or the field or property of the primary key.</para>
+
+ <programlisting>@Entity
+@SqlResultSetMapping(name="compositekey",
+
entities=(a)EntityResult(entityClass=org.hibernate.test.annotations.query.SpaceShip.class,
+ fields = {
+ @FieldResult(name="name", column = "name"),
+ @FieldResult(name="model", column = "model"),
+ @FieldResult(name="speed", column = "speed"),
+ @FieldResult(name="captain.firstname", column =
"firstn"),
+ @FieldResult(name="captain.lastname", column =
"lastn"),
+ @FieldResult(name="dimensions.length", column =
"length"),
+ @FieldResult(name="dimensions.width", column =
"width")
+ }),
+ columns = { @ColumnResult(name = "surface"),
+ @ColumnResult(name = "volume") } )
+
+@NamedNativeQuery(name="compositekey",
+ query="select name, model, speed, lname as lastn, fname as firstn, length,
width, length * width as surface from SpaceShip",
+ resultSetMapping="compositekey")
+} )
+public class SpaceShip {
+ private String name;
+ private String model;
+ private double speed;
+ private Captain captain;
+ private Dimensions dimensions;
+
+ @Id
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ @ManyToOne(fetch= FetchType.LAZY)
+ @JoinColumns( {
+ @JoinColumn(name="fname", referencedColumnName =
"firstname"),
+ @JoinColumn(name="lname", referencedColumnName =
"lastname")
+ } )
+ public Captain getCaptain() {
+ return captain;
+ }
+
+ public void setCaptain(Captain captain) {
+ this.captain = captain;
+ }
+
+ public String getModel() {
+ return model;
+ }
+
+ public void setModel(String model) {
+ this.model = model;
+ }
+
+ public double getSpeed() {
+ return speed;
+ }
+
+ public void setSpeed(double speed) {
+ this.speed = speed;
+ }
+
+ public Dimensions getDimensions() {
+ return dimensions;
+ }
+
+ public void setDimensions(Dimensions dimensions) {
+ this.dimensions = dimensions;
+ }
+}
+
+@Entity
+(a)IdClass(Identity.class)
+public class Captain implements Serializable {
+ private String firstname;
+ private String lastname;
+
+ @Id
+ public String getFirstname() {
+ return firstname;
+ }
+
+ public void setFirstname(String firstname) {
+ this.firstname = firstname;
+ }
+
+ @Id
+ public String getLastname() {
+ return lastname;
+ }
+
+ public void setLastname(String lastname) {
+ this.lastname = lastname;
+ }
+}
+</programlisting>
+
+ <note>
+ <para>If you look at the dimension property, you'll see that Hibernate
+ supports the dotted notation for embedded objects (you can even have
+ nested embedded objects). EJB3 implementations do not have to support
+ this feature, we do :-)</para>
+ </note>
+
+ <para>If you retrieve a single entity and if you use the default
+ mapping, you can use the <literal>resultClass</literal> attribute
+ instead of <literal>resultSetMapping</literal>:</para>
+
+ <programlisting>@NamedNativeQuery(name="implicitSample",
query="select * from SpaceShip",
+ resultClass=SpaceShip.class)
+public class SpaceShip {</programlisting>
+
+ <para>In some of your native queries, you'll have to return scalar
+ values, for example when building report queries. You can map them in
+ the <literal>@SqlResultsetMapping</literal> through
+ <literal>@ColumnResult</literal>. You actually can even mix, entities
+ and scalar returns in the same native query (this is probably not that
+ common though).</para>
+
+ <programlisting>@SqlResultSetMapping(name="scalar",
columns=@ColumnResult(name="dimension"))
+@NamedNativeQuery(name="scalar", query="select length*width as dimension
from SpaceShip", resultSetMapping="scalar")</programlisting>
+
+ <para>An other query hint specific to native queries has been
+ introduced: <literal>org.hibernate.callable</literal> which can be
true
+ or false depending on whether the query is a stored procedure or
+ not.</para>
+ </section>
+ </section>
+
+ <section id="entity-hibspec">
+ <title>Hibernate Annotation Extensions</title>
+
+ <para>Hibernate 3.1 offers a variety of additional annotations that you
+ can mix/match with your EJB 3 entities. They have been designed as a
+ natural extension of EJB3 annotations.</para>
+
+ <para>To empower the EJB3 capabilities, hibernate provides specific
+ annotations that match hibernate features. The
+ <classname>org.hibernate.annotations</classname> package contains all
+ these annotations extensions.</para>
+
+ <section id="entity-hibspec-entity" revision="4">
+ <title>Entity</title>
+
+ <para>You can fine tune some of the actions done by Hibernate on
+ entities beyond what the EJB3 spec offers.</para>
+
+ <para><classname>(a)org.hibernate.annotations.Entity</classname>
adds
+ additional metadata that may be needed beyond what is defined in the
+ standard <literal>@Entity</literal> <itemizedlist>
+ <listitem>
+ <para>
+ mutable: whether this entity is mutable or not </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ dynamicInsert: allow dynamic SQL for inserts </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ dynamicUpdate: allow dynamic SQL for updates </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ selectBeforeUpdate: Specifies that Hibernate should never perform an SQL UPDATE
unless it is certain that an object is actually modified. </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ polymorphism: whether the entity polymorphism is of PolymorphismType.IMPLICIT
(default) or PolymorphismType.EXPLICIT </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ optimisticLock: optimistic locking strategy (OptimisticLockType.VERSION,
OptimisticLockType.NONE, OptimisticLockType.DIRTY or OptimisticLockType.ALL)
</para>
+ </listitem>
+ </itemizedlist></para>
+
+ <para><note>
+ <para>(a)javax.persistence.Entity is still mandatory,
+ @org.hibernate.annotations.Entity is not a replacement.</para>
+ </note></para>
+
+ <para>Here are some additional Hibernate annotation extensions</para>
+
+ <para><literal>(a)org.hibernate.annotations.BatchSize</literal>
allows you
+ to define the batch size when fetching instances of this entity ( eg.
+ <literal>@BatchSize(size=4)</literal> ). When loading a given entity,
+ Hibernate will then load all the uninitialized entities of the same type
+ in the persistence context up to the batch size.</para>
+
+ <para><literal>(a)org.hibernate.annotations.Proxy</literal> defines
the
+ laziness attributes of the entity. lazy (default to true) define whether
+ the class is lazy or not. proxyClassName is the interface used to
+ generate the proxy (default is the class itself).</para>
+
+ <para><literal>(a)org.hibernate.annotations.Where</literal> defines
an
+ optional SQL WHERE clause used when instances of this class is
+ retrieved.</para>
+
+ <para><literal>(a)org.hibernate.annotations.Check</literal> defines
an
+ optional check constraints defined in the DDL statetement.</para>
+
+ <para><literal>(a)OnDelete(action=OnDeleteAction.CASCADE)</literal>
on
+ joined subclasses: use a SQL cascade delete on deletion instead of the
+ regular Hibernate mechanism.</para>
+
+ <para><literal>@Table(appliesTo="tableName", indexes = {
+ @Index(name="index1", columnNames={"column1",
"column2"} ) } )</literal>
+ creates the defined indexes on the columns of table
+ <literal>tableName</literal>. This can be applied on the primary table
+ or any secondary table. The <literal>@Tables</literal> annotation
allows
+ your to apply indexes on different tables. This annotation is expected
+ where <literal>(a)javax.persistence.Table</literal> or
+ <literal>(a)javax.persistence.SecondaryTable</literal>(s)
occurs.</para>
+
+ <note>
+ <para><literal>(a)org.hibernate.annotations.Table</literal> is a
+ complement, not a replacement to
+ <literal>(a)javax.persistence.Table</literal>. Especially, if you want
+ to change the default name of a table, you must use
+ <literal>(a)javax.persistence.Table</literal>, not
+ <literal>(a)org.hibernate.annotations.Table</literal>.</para>
+ </note>
+
+ <para><literal>(a)org.hibernate.annotations.Table</literal> can
also be
+ used to define the following elements of secondary tables:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para><literal>fetch</literal>: If set to JOIN, the default,
+ Hibernate will use an inner join to retrieve a secondary table
+ defined by a class or its superclasses and an outer join for a
+ secondary table defined by a subclass. If set to select then
+ Hibernate will use a sequential select for a secondary table defined
+ on a subclass, which will be issued only if a row turns out to
+ represent an instance of the subclass. Inner joins will still be
+ used to retrieve a secondary defined by the class and its
+ superclasses.</para>
+ </listitem>
+
+ <listitem>
+ <para><literal>inverse</literal>: If true, Hibernate will not
try to
+ insert or update the properties defined by this join. Default to
+ false.</para>
+ </listitem>
+
+ <listitem>
+ <para><literal>optional</literal>: If enabled (the default),
+ Hibernate will insert a row only if the properties defined by this
+ join are non-null and will always use an outer join to retrieve the
+ properties.</para>
+ </listitem>
+
+ <listitem>
+ <para><literal>foreignKey</literal>: defines the Foreign Key
name of
+ a secondary table pointing back to the primary table.</para>
+ </listitem>
+ </itemizedlist>
+
+ <para><literal>@Immutable</literal> marks an entity or collection
as
+ immutable. An immutable entity may not be updated by the application.
+ This allows Hibernate to make some minor performance optimizations.
+ Updates to an immutable entity will be ignored, but no exception is
+ thrown. <literal>@Immutable</literal> must be used on root entities
+ only. <literal>@Immutable</literal> placed on a collection makes the
+ collection immutable, meaning additions and deletions to and from the
+ collection are not allowed. A <literal>HibernateException</literal> is
+ thrown in this case.</para>
+
+ <para><literal>@Persister</literal> lets you define your own
custom
+ persistence strategy. You may, for example, specify your own subclass of
+ <classname>org.hibernate.persister.EntityPersister</classname> or you
+ might even provide a completely new implementation of the interface
+ <literal>org.hibernate.persister.ClassPersister</literal> that
+ implements persistence via, for example, stored procedure calls,
+ serialization to flat files or LDAP.</para>
+
+ <para><programlisting>@Entity
+@BatchSize(size=5)
+(a)org.hibernate.annotations.Entity(
+ selectBeforeUpdate = true,
+ dynamicInsert = true, dynamicUpdate = true,
+ optimisticLock = OptimisticLockType.ALL,
+ polymorphism = PolymorphismType.EXPLICIT)
+@Where(clause="1=1")
+(a)org.hibernate.annotations.Table(name="Forest", indexes = {
@Index(name="idx", columnNames = { "name", "length" } ) } )
+(a)Persister(impl=MyEntityPersister.class)
+public class Forest { ... }</programlisting><programlisting>@Entity
+@Inheritance(
+ strategy=InheritanceType.JOINED
+)
+public class Vegetable { ... }
+
+@Entity
+(a)OnDelete(action=OnDeleteAction.CASCADE)
+public class Carrot extends Vegetable { ... }</programlisting></para>
+ </section>
+
+ <section id="entity-hibspec-identifier" label="Identifier"
revision="2">
+ <title>Identifier</title>
+
+ <para>Hibernate Annotations goes beyond the Java Persistence
+ specification when defining identifiers.</para>
+
+ <section>
+ <title>Generators</title>
+
+
<para><literal><literal>(a)org.hibernate.annotations.GenericGenerator</literal>
+ and <literal>(a)org.hibernate.annotations.GenericGenerators</literal>
+ allows you to define an Hibernate specific id
+ generator.</literal></para>
+
+ <para><programlisting>@Id
@GeneratedValue(generator="system-uuid")
+@GenericGenerator(name="system-uuid", strategy = "uuid")
+public String getId() {
+
+@Id @GeneratedValue(generator="hibseq")
+@GenericGenerator(name="hibseq", strategy = "seqhilo",
+ parameters = {
+ @Parameter(name="max_lo", value = "5"),
+ @Parameter(name="sequence", value="heybabyhey")
+ }
+)
+public Integer getId() {</programlisting></para>
+
+ <para><literal>strategy</literal> is the short name of an
Hibernate3
+ generator strategy or the fully qualified class name of an
+ <classname>IdentifierGenerator</classname> implementation. You can
add
+ some parameters through the <literal>parameters</literal>
+ attribute.</para>
+
+ <para>Contrary to their standard counterpart,
+ <literal>@GenericGenerator</literal> and
+ <literal>@GenericGenerators</literal> can be used in package level
+ annotations, making them application level generators (just like if
+ they were in a JPA XML file).</para>
+
+ <programlisting>@GenericGenerators(
+ {
+ @GenericGenerator(
+ name="hibseq",
+ strategy = "seqhilo",
+ parameters = {
+ @Parameter(name="max_lo", value = "5"),
+ @Parameter(name="sequence", value="heybabyhey")
+ }
+ ),
+ @GenericGenerator(...)
+ }
+)
+package org.hibernate.test.model</programlisting>
+ </section>
+
+ <section>
+ <title>@NaturalId</title>
+
+ <para>While not used as identifier property, some (group of)
+ properties represent natural identifier of an entity. This is
+ especially true when the schema uses the recommended approach of using
+ surrogate primary key even if a natural business key exists. Hibernate
+ allows to map such natural properties and reuse them in a
+ <classname>Criteria</classname> query. The natural identifier is
+ composed of all the properties marked
+ <classname>(a)NaturalId</classname>.</para>
+
+ <programlisting>@Entity
+public class Citizen {
+ @Id
+ @GeneratedValue
+ private Integer id;
+ private String firstname;
+ private String lastname;
+
+ @NaturalId
+ @ManyToOne
+ private State state;
+
+ @NaturalId
+ private String ssn;
+ ...
+}
+
+
+
+//and later on query
+List results = s.createCriteria( Citizen.class )
+ .add( Restrictions.naturalId().set( "ssn", "1234"
).set( "state", ste ) )
+ .list();</programlisting>
+
+ <para>Note that the group of properties representing the natural
+ identifier have to be unique (Hibernate will generate a unique
+ constraint if the database schema is generated).</para>
+ </section>
+ </section>
+
+ <section id="entity-hibspec-property" revision="2">
+ <title>Property</title>
+
+ <section>
+ <title>Access type</title>
+
+ <para>The access type is guessed from the position of
+ <literal>@Id</literal> or <literal>@EmbeddedId</literal>
in the entity
+ hierarchy. Sub-entities, embedded objects and mapped superclass
+ inherit the access type from the root entity.</para>
+
+ <para>In Hibernate, you can override the access type to:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>use a custom access type strategy</para>
+ </listitem>
+
+ <listitem>
+ <para>fine tune the access type at the class level or at the
+ property level</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>An @AccessType annotation has been introduced to support this
+ behavior. You can define the access type on</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>an entity</para>
+ </listitem>
+
+ <listitem>
+ <para>a superclass</para>
+ </listitem>
+
+ <listitem>
+ <para>an embeddable object</para>
+ </listitem>
+
+ <listitem>
+ <para>a property</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>The access type is overriden for the annotated element, if
+ overriden on a class, all the properties of the given class inherit
+ the access type. For root entities, the access type is considered to
+ be the default one for the whole hierarchy (overridable at class or
+ property level).</para>
+
+ <para>If the access type is marked as "property", the getters
are
+ scanned for annotations, if the access type is marked as "field", the
+ fields are scanned for annotations. Otherwise the elements marked with
+ @Id or @embeddedId are scanned.</para>
+
+ <para>You can override an access type for a property, but the element
+ to annotate will not be influenced: for example an entity having
+ access type <literal>field</literal>, can annotate a field with
+ <literal>@AccessType("property")</literal>, the access type
will then
+ be property for this attribute, the the annotations still have to be
+ carried on the field.</para>
+
+ <para>If a superclass or an embeddable object is not annotated, the
+ root entity access type is used (even if an access type has been
+ define on an intermediate superclass or embeddable object). The
+ russian doll principle does not apply.</para>
+
+ <programlisting>@Entity
+public class Person implements Serializable {
+ @Id @GeneratedValue //access type field
+ Integer id;
+
+ @Embedded
+ @AttributeOverrides({
+ @AttributeOverride(name = "iso2", column = @Column(name =
"bornIso2")),
+ @AttributeOverride(name = "name", column = @Column(name =
"bornCountryName"))
+ })
+ Country bornIn;
+}
+
+@Embeddable
+@AccessType("property") //override access type for all properties in Country
+public class Country implements Serializable {
+ private String iso2;
+ private String name;
+
+ public String getIso2() {
+ return iso2;
+ }
+
+ public void setIso2(String iso2) {
+ this.iso2 = iso2;
+ }
+
+ @Column(name = "countryName")
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+}
+</programlisting>
+ </section>
+
+ <section>
+ <title>Formula</title>
+
+ <para>Sometimes, you want the Database to do some computation for you
+ rather than in the JVM, you might also create some kind of virtual
+ column. You can use a SQL fragment (aka formula) instead of mapping a
+ property into a column. This kind of property is read only (its value
+ is calculated by your formula fragment).</para>
+
+ <programlisting>@Formula("obj_length * obj_height * obj_width")
+public long getObjectVolume()</programlisting>
+
+ <para>The SQL fragment can be as complex as you want and even include
+ subselects.</para>
+ </section>
+
+ <section>
+ <title>Type</title>
+
+ <para><literal>(a)org.hibernate.annotations.Type</literal>
overrides the
+ default hibernate type used: this is generally not necessary since the
+ type is correctly inferred by Hibernate. Please refer to the Hibernate
+ reference guide for more informations on the Hibernate types.</para>
+
+ <para><literal>(a)org.hibernate.annotations.TypeDef</literal>
and
+ <literal>(a)org.hibernate.annotations.TypeDefs</literal> allows you
+ to declare type definitions. These annotations are placed at the
+ class or package level. Note that these definitions will be global
+ for the session factory (even at the class level) and that type
+ definition has to be defined before any usage.
+ </para>
+
+ <!-- commenting out as restoring to community content (restoreToCommunity:)
+
+ .. allows you to
+ declare type definitions. These annotations can be placed at the class or
+ package level. Note that these definitions are be global for the
+ session factory (even when defined at the class level). Type definitions have
+ to be defined before any usage. If the type is used on a single entity, you
+ can plance the definition on the entity itself. Otherwise, it is recommended
+ to place the definition a the package level since the entity processing order
+ is not guaranteed.</para>
+
+<note><para>Package level annotations are placed in a file named
<filename>package-info.java</filename>
+ in the appropriate package. Place your annotations before the package
declaration.</para></note>
+-->
+ <programlisting><!-- restoreToCommunity: //in
org/hibernate/test/annotations/entity/package-info.java -->
+@TypeDefs(
+ {
+ @TypeDef(
+ name="caster",
+ typeClass = CasterStringType.class,
+ parameters = {
+ @Parameter(name="cast", value="lower")
+ }
+ )
+ }
+)
+package org.hibernate.test.annotations.entity;
+
+<!-- restoreToCommunity: //in org/hibernate/test/annotations/entity/Forest.java
-->
+public class Forest {
+ @Type(type="caster")
+ public String getSmallText() {
+ ...
+}
+ </programlisting>
+
+ <para>When using composite user type, you will have to express column
+ definitions. The <literal>@Columns</literal> has been introduced for
+ that purpose.</para>
+
+
<programlisting>(a)Type(type="org.hibernate.test.annotations.entity.MonetaryAmountUserType")
+@Columns(columns = {
+ @Column(name="r_amount"),
+ @Column(name="r_currency")
+})
+public MonetaryAmount getAmount() {
+ return amount;
+}
+
+
+public class MonetaryAmount implements Serializable {
+ private BigDecimal amount;
+ private Currency currency;
+ ...
+}</programlisting>
+ </section>
+
+ <section>
+ <title>Index</title>
+
+ <para>You can define an index on a particular column using the
+ <literal>@Index</literal> annotation on a one column property, the
+ columnNames attribute will then be ignored</para>
+
+ <programlisting>@Column(secondaryTable="Cat1")
+@Index(name="story1index")
+public String getStoryPart1() {
+ return storyPart1;
+}</programlisting>
+ </section>
+
+ <section>
+ <title>@Parent</title>
+
+ <para>When inside an embeddable object, you can define one of the
+ properties as a pointer back to the owner element.</para>
+
+ <programlisting>@Entity
+public class Person {
+ @Embeddable public Address address;
+ ...
+}
+
+@Embeddable
+public class Address {
+ @Parent public Person owner;
+ ...
+}
+
+
+person == person.address.owner</programlisting>
+ </section>
+
+ <section>
+ <title>Generated properties</title>
+
+ <para>Some properties are generated at insert or update time by your
+ database. Hibernate can deal with such properties and triggers a
+ subsequent select to read these properties.</para>
+
+ <programlisting>@Entity
+public class Antenna {
+ @Id public Integer id;
+ @Generated(GenerationTime.ALWAYS) @Column(insertable = false, updatable = false)
+ public String longitude;
+
+ @Generated(GenerationTime.INSERT) @Column(insertable = false)
+ public String latitude;
+}</programlisting>
+
+ <para>Annotate your property as <literal>@Generated</literal>
You have
+ to make sure your insertability or updatability does not conflict with
+ the generation strategy you have chosen. When GenerationTime.INSERT is
+ chosen, the property must not contains insertable columns, when
+ GenerationTime.ALWAYS is chosen, the property must not contains
+ insertable nor updatable columns.</para>
+
+ <para><literal>@Version</literal> properties cannot be
+ <literal>@Generated(INSERT)</literal> by design, it has to be either
+ <literal>NEVER</literal> or
<literal>ALWAYS</literal>.</para>
+ </section>
+
+ <section>
+ <title>@Target</title>
+
+ <para>Sometimes, the type guessed by reflection is not the one you
+ want Hibernate to use. This is especially true on components when an
+ interface is used. You can use <literal>@Target</literal> to by pass
+ the reflection guessing mechanism (very much like the
+ <literal>targetEntity</literal> attribute available on
+ associations.</para>
+
+ <programlisting> @Embedded
+ @Target(OwnerImpl.class)
+ public Owner getOwner() {
+ return owner;
+ }</programlisting>
+
+ <para></para>
+ </section>
+
+ <section>
+ <title>Optimistic lock</title>
+
+ <para>It is sometimes useful to avoid increasing the version number
+ even if a given property is dirty (particularly collections). You can
+ do that by annotating the property (or collection) with
+ <literal>(a)OptimisticLock(excluded=true)</literal>.</para>
+
+ <para>More formally, specifies that updates to this property do not
+ require acquisition of the optimistic lock.</para>
+ </section>
+ </section>
+
+ <section id="entity-hibspec-inheritance" revision="3">
+ <title>Inheritance</title>
+
+ <para>SINGLE_TABLE is a very powerful strategy but sometimes, and
+ especially for legacy systems, you cannot add an additional
+ discriminator column. For that purpose Hibernate has introduced the
+ notion of discriminator formula:
+ <literal>@DiscriminatorFormula</literal> is a replacement of
+ <literal>@DiscriminatorColumn</literal> and use a SQL fragment as a
+ formula for discriminator resolution (no need to have a dedicated
+ column).</para>
+
+ <programlisting>@Entity
+@DiscriminatorFormula("case when forest_type is null then 0 else forest_type
end")
+public class Forest { ... }</programlisting>
+
+ <para>By default, when querying the top entities, Hibernate does not put
+ a restriction clause on the discriminator column. This can be
+ inconvenient if this column contains values not mapped in your hierarchy
+ (through <literal>@DiscriminatorValue</literal>). To work around that
+ you can use <literal>@ForceDiscriminator</literal> (at the class
level,
+ next to <literal>@DiscriminatorColumn</literal>). Hibernate will then
+ list the available values when loading the entities.</para>
+
+ <para>You can define the foreign key name generated by Hibernate for
+ subclass tables in the JOINED inheritance strategy.</para>
+
+ <programlisting>@Entity
+@Inheritance(strategy = InheritanceType.JOINED)
+public abstract class File { ... }
+
+@Entity
+@ForeignKey(name = "FK_DOCU_FILE")
+public class Document extends File {</programlisting>
+
+ <para>The foreign key from the <literal>Document</literal> table
to the
+ <literal>File</literal> table will be named
+ <literal>FK_DOCU_FILE</literal>.</para>
+ </section>
+
+ <section id="entity-hibspec-singleassoc">
+ <title>Single Association related annotations</title>
+
+ <para>By default, when Hibernate cannot resolve the association because
+ the expected associated element is not in database (wrong id on the
+ association column), an exception is raised by Hibernate. This might be
+ inconvenient for legacy and badly maintained schemas. You can ask
+ Hibernate to ignore such elements instead of raising an exception using
+ the <literal>@NotFound</literal> annotation. This annotation can be
used
+ on a <literal>@OneToOne</literal> (with FK),
+ <literal>@ManyToOne</literal>,
<literal>@OneToMany</literal> or
+ <literal>@ManyToMany</literal> association.</para>
+
+ <programlisting>@Entity
+public class Child {
+ ...
+ @ManyToOne
+ @NotFound(action=NotFoundAction.IGNORE)
+ public Parent getParent() { ... }
+ ...
+}</programlisting>
+
+ <para>Sometimes you want to delegate to your database the deletion of
+ cascade when a given entity is deleted.</para>
+
+ <programlisting>@Entity
+public class Child {
+ ...
+ @ManyToOne
+ @OnDelete(action=OnDeleteAction.CASCADE)
+ public Parent getParent() { ... }
+ ...
+}</programlisting>
+
+ <para>In this case Hibernate generates a cascade delete constraint at
+ the database level.</para>
+
+ <para>Foreign key constraints, while generated by Hibernate, have a
+ fairly unreadable name. You can override the constraint name by use
+ <literal>(a)ForeignKey</literal>.</para>
+
+ <programlisting>@Entity
+public class Child {
+ ...
+ @ManyToOne
+ @ForeignKey(name="FK_PARENT")
+ public Parent getParent() { ... }
+ ...
+}
+
+alter table Child add constraint FK_PARENT foreign key (parent_id) references
Parent</programlisting>
+
+ <section id="entity-hibspec-singleassoc-fetching">
+ <title>Lazy options and fetching modes</title>
+
+ <para>EJB3 comes with the <literal>fetch</literal> option to
define
+ lazy loading and fetching modes, however Hibernate has a much more
+ option set in this area. To fine tune the lazy loading and fetching
+ strategies, some additional annotations have been introduced:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para><literal>@LazyToOne</literal>: defines the lazyness
option
+ on <literal>@ManyToOne</literal> and
<literal>@OneToOne</literal>
+ associations. <literal>LazyToOneOption</literal> can be
+ <literal>PROXY</literal> (ie use a proxy based lazy loading),
+ <literal>NO_PROXY</literal> (use a bytecode enhancement based
lazy
+ loading - note that build time bytecode processing is necessary)
+ and <literal>FALSE</literal> (association not lazy)</para>
+ </listitem>
+
+ <listitem>
+ <para><literal>@LazyCollection</literal>: defines the
lazyness
+ option on <literal>@ManyTo</literal>Many and
+ <literal>@OneToMany</literal> associations. LazyCollectionOption
+ can be <literal>TRUE</literal> (the collection is lazy and will
be
+ loaded when its state is accessed), <literal>EXTRA</literal>
(the
+ collection is lazy and all operations will try to avoid the
+ collection loading, this is especially useful for huge collections
+ when loading all the elements is not necessary) and FALSE
+ (association not lazy)</para>
+ </listitem>
+
+ <listitem>
+ <para><literal>@Fetch</literal>: defines the fetching
strategy
+ used to load the association. <literal>FetchMode</literal> can
be
+ <literal>SELECT</literal> (a select is triggered when the
+ association needs to be loaded), <literal>SUBSELECT</literal>
+ (only available for collections, use a subselect strategy - please
+ refers to the Hibernate Reference Documentation for more
+ information) or <literal>JOIN</literal> (use a SQL JOIN to load
+ the association while loading the owner entity).
+ <literal>JOIN</literal> overrides any lazy attribute (an
+ association loaded through a <literal>JOIN</literal> strategy
+ cannot be lazy).</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>The Hibernate annotations overrides the EJB3 fetching
+ options.</para>
+
+ <table>
+ <title>Lazy and fetch options equivalent</title>
+
+ <tgroup cols="3">
+ <thead>
+ <row>
+ <entry>Annotations</entry>
+
+ <entry>Lazy</entry>
+
+ <entry>Fetch</entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry>(a)[One|Many]ToOne](fetch=FetchType.LAZY)</entry>
+
+ <entry>@LazyToOne(PROXY)</entry>
+
+ <entry>@Fetch(SELECT)</entry>
+ </row>
+
+ <row>
+ <entry>(a)[One|Many]ToOne](fetch=FetchType.EAGER)</entry>
+
+ <entry>@LazyToOne(FALSE)</entry>
+
+ <entry>@Fetch(JOIN)</entry>
+ </row>
+
+ <row>
+ <entry>(a)ManyTo[One|Many](fetch=FetchType.LAZY)</entry>
+
+ <entry>@LazyCollection(TRUE)</entry>
+
+ <entry>@Fetch(SELECT)</entry>
+ </row>
+
+ <row>
+ <entry>(a)ManyTo[One|Many](fetch=FetchType.EAGER)</entry>
+
+ <entry>@LazyCollection(FALSE)</entry>
+
+ <entry>@Fetch(JOIN)</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </section>
+
+ <section id="entity-hibspec-singleassoc-any">
+ <title>@Any</title>
+
+ <para>The <classname>@Any</classname> annotation defines a
polymorphic
+ association to classes from multiple tables. This type of mapping
+ always requires more than one column. The first column holds the type
+ of the associated entity. The remaining columns hold the identifier.
+ It is impossible to specify a foreign key constraint for this kind of
+ association, so this is most certainly not meant as the usual way of
+ mapping (polymorphic) associations. You should use this only in very
+ special cases (eg. audit logs, user session data, etc).</para>
+
+ <para>The @Any annotation describes the column holding the metadata
+ information. To link the value of the metadata information and an
+ actual entity type, The <classname>@AnyDef</classname> and
+ <classname>@AnyDefs</classname> annotations are used.</para>
+
+ <programlisting> @Any( metaColumn = @Column( name =
"property_type" ), fetch=FetchType.EAGER )
+ @AnyMetaDef(
+ idType = "integer",
+ metaType = "string",
+ metaValues = {
+ @MetaValue( value = "S", targetEntity = StringProperty.class ),
+ @MetaValue( value = "I", targetEntity = IntegerProperty.class )
+ } )
+ @JoinColumn( name = "property_id" )
+ public Property getMainProperty() {
+ return mainProperty;
+ }</programlisting>
+
+ <para><methodname>idType</methodname> represents the target
entities
+ identifier property type and <methodname>metaType</methodname> the
+ metadata type (usually String).</para>
+
+ <para>Note that <classname>@AnyDef</classname> can be
mutualized and
+ reused. It is recommended to place it as a package metadata in this
+ case.</para>
+
+ <programlisting>//on a package
+@AnyMetaDef( name="property"
+ idType = "integer",
+ metaType = "string",
+ metaValues = {
+ @MetaValue( value = "S", targetEntity = StringProperty.class ),
+ @MetaValue( value = "I", targetEntity = IntegerProperty.class )
+ } )
+package org.hibernate.test.annotations.any;
+
+
+//in a class
+ @Any( metaDef="property", metaColumn = @Column( name =
"property_type" ), fetch=FetchType.EAGER )
+ @JoinColumn( name = "property_id" )
+ public Property getMainProperty() {
+ return mainProperty;
+ }</programlisting>
+ </section>
+ </section>
+
+ <section id="entity-hibspec-collection" revision="2">
+ <title>Collection related annotations</title>
+
+ <section id="entity-hibspec-collection-enhance"
revision="3">
+ <title>Enhance collection settings</title>
+
+ <para>It is possible to set <itemizedlist>
+ <listitem>
+ <para>
+ the batch size for collections using @BatchSize </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ the where clause, using @Where (applied on the target entity) or @WhereJoinTable
(applied on the association table) </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ the check clause, using @Check </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ the SQL order by clause, using @OrderBy </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ the delete cascade strategy through @OnDelete(action=OnDeleteAction.CASCADE)
</para>
+ </listitem>
+
+ <listitem>
+ <para>
+ the collection immutability using @Immutable: if set specifies that the elements
of the collection never change (a minor performance optimization in some cases)
</para>
+ </listitem>
+
+ <listitem>
+ <para>a custom collection persister (ie the persistence strategy
+ used) using <literal>@Persister</literal>: the class must
+ implement
+
<classname>org.hibernate.persister.collectionCollectionPersister</classname></para>
+ </listitem>
+ </itemizedlist></para>
+
+ <para>You can also declare a sort comparator. Use the
+ <literal>@Sort</literal> annotation. Expressing the comparator type
+ you want between unsorted, natural or custom comparator. If you want
+ to use your own comparator implementation, you'll also have to express
+ the implementation class using the <literal>comparator</literal>
+ attribute. Note that you need to use either a
+ <classname>SortedSet</classname> or a
<classname>SortedMap</classname>
+ interface.</para>
+
+ <programlisting> @OneToMany(cascade=CascadeType.ALL,
fetch=FetchType.EAGER)
+ @JoinColumn(name="CUST_ID")
+ @Sort(type = SortType.COMPARATOR, comparator = TicketComparator.class)
+ @Where(clause="1=1")
+ @OnDelete(action=OnDeleteAction.CASCADE)
+ public SortedSet<Ticket> getTickets() {
+ return tickets;
+ }</programlisting>
+
+ <para>Please refer to the previous descriptions of these annotations
+ for more informations.</para>
+
+ <para>Foreign key constraints, while generated by Hibernate, have a
+ fairly unreadable name. You can override the constraint name by use
+ <literal>@ForeignKey</literal>. Note that this annotation has to be
+ placed on the owning side of the relationship,
+ <literal>inverseName</literal> referencing to the other side
+ constraint.</para>
+
+ <programlisting>@Entity
+public class Woman {
+ ...
+ @ManyToMany(cascade = {CascadeType.ALL})
+ @ForeignKey(name = "TO_WOMAN_FK", inverseName = "TO_MAN_FK")
+ public Set<Man> getMens() {
+ return mens;
+ }
+}
+
+alter table Man_Woman add constraint TO_WOMAN_FK foreign key (woman_id) references Woman
+alter table Man_Woman add constraint TO_MAN_FK foreign key (man_id) references
Man</programlisting>
+ </section>
+
+ <section id="entity-hibspec-collection-extratype"
revision="1">
+ <title>Extra collection types</title>
+
+ <section>
+ <title>List</title>
+
+ <para>Beyond EJB3, Hibernate Annotations supports true
+ <classname>List</classname> and
<classname>Array</classname>. Map
+ your collection the same way as usual and add the
+ @<literal>IndexColumn</literal>. This annotation allows you to
+ describe the column that will hold the index. You can also declare
+ the index value in DB that represent the first element (aka as base
+ index). The usual value is <literal>0</literal> or
+ <literal>1</literal>.</para>
+
+ <programlisting>@OneToMany(cascade = CascadeType.ALL)
+@IndexColumn(name = "drawer_position", base=1)
+public List<Drawer> getDrawers() {
+ return drawers;
+}</programlisting>
+
+ <note>
+ <para>If you forgot to set <literal>@IndexColumn</literal>,
the
+ bag semantic is applied. If you want the bag semantic without the
+ limitations of it, consider using
+ <literal>(a)CollectionId</literal>.</para>
+ </note>
+ </section>
+
+ <section id="entity-hibspec-collection-extratype-map"
revision="1">
+ <title>Map</title>
+
+ <para>Hibernate Annotations also supports true Map mappings, if
+ <literal>(a)javax.persistence.MapKey</literal> is not set, hibernate
+ will map the key element or embeddable object in its/their own
+ columns. To override the default columns, you can use
+ <literal>(a)org.hibernate.annotations.MapKey</literal> if your key
is
+ a basic type (defaulted to <literal>mapkey</literal>) or an
+ embeddable object, or you can use
+ <literal>(a)org.hibernate.annotations.MapKeyManyToMany</literal> if
+ your key is an entity.</para>
+
+ <para>Both
<literal>(a)org.hibernate.annotations.MapKey</literal> and
+ <literal>(a)org.hibernate.annotations.MapKeyManyToMany</literal>
+ allows you to override the target element to be used. This is
+ especially useful if your collection does not use generics (or if
+ you use interfaces).</para>
+
+ <programlisting> @CollectionOfElements(targetElement =
SizeImpl.class)
+ @MapKeyManyToMany(targetEntity = LuggageImpl.class)
+ private Map<Luggage, Size> sizePerLuggage = new HashMap<Luggage,
Size>();</programlisting>
+
+ <para></para>
+ </section>
+
+ <section id="entity-hibspec-collection-extratype-indexbidir"
+ revision="2">
+ <title>Bidirectional association with indexed collections</title>
+
+ <para>A bidirectional association where one end is an indexed
+ collection (ie. represented as a <literal>@IndexColumn</literal>,
+ <literal>(a)org.hibernate.annotations.MapKey</literal> or
+
<classname>(a)org.hibernate.annotations.MapKeyManyToMany</classname>)
+ requires special consideration. If a property on the associated
+ class explicitly maps the indexed value, the use of
+ <methodname>mappedBy</methodname> is permitted:</para>
+
+ <programlisting>@Entity
+public class Parent {
+ @OneToMany(mappedBy="parent")
+ @org.hibernate.annotations.IndexColumn(name="order")
+ private List<Child> children;
+ ...
+}
+
+@Entity
+public class Child {
+ ...
+ //the index column is mapped as a property in the associated entity
+ @Column(name="order")
+ private int order;
+
+ @ManyToOne
+ @JoinColumn(name="parent_id", nullable=false)
+ private Parent parent;
+ ...
+}</programlisting>
+
+ <para>But, if there is no such property on the child class, we can't
+ think of the association as truly bidirectional (there is
+ information available at one end of the association that is not
+ available at the other end: the index). In this case, we can't map
+ the collection as <literal>mappedBy</literal>. Instead, we could
use
+ the following mapping:</para>
+
+ <programlisting>@Entity
+public class Parent {
+ @OneToMany
+ @org.hibernate.annotations.IndexColumn(name="order")
+ @JoinColumn(name="parent_id", nullable=false)
+ private List<Child> children;
+ ...
+}
+
+@Entity
+public class Child {
+ ...
+ @ManyToOne
+ @JoinColumn(name="parent_id", insertable=false, updatable=false,
nullable=false)
+ private Parent parent;
+ ...
+}</programlisting>
+
+ <para>Note that in this mapping, the collection-valued end of the
+ association is responsible for updating the foreign key.</para>
+ </section>
+
+ <section>
+ <title>Bag with primary key</title>
+
+ <para>Another interesting feature is the ability to define a
+ surrogate primary key to a bag collection. This remove pretty much
+ all of the drawbacks of bags: update and removal are efficient, more
+ than one <literal>EAGER</literal> bag per query or per entity.
This
+ primary key will be contained in a additional column of your
+ collection table but will not be visible to the Java application.
+ @CollectionId is used to mark a collection as id bag, it also allow
+ to override the primary key column(s), the primary key type and the
+ generator strategy. The strategy can be
<literal>identity</literal>,
+ or any defined generator name of your application.</para>
+
+ <programlisting>@Entity
+@TableGenerator(name="ids_generator", table="IDS")
+public class Passport {
+ ...
+
+ @ManyToMany(cascade = CascadeType.ALL)
+ @JoinTable(name="PASSPORT_VISASTAMP")
+ @CollectionId(
+ columns = @Column(name="COLLECTION_ID"),
+ type=@Type(type="long"),
+ generator = "ids_generator"
+ )
+ private Collection<Stamp> visaStamp = new ArrayList();
+ ...
+}</programlisting>
+ </section>
+
+ <section>
+ <title>Collection of element or composite elements</title>
+
+ <para>Hibernate Annotations also supports collections of core types
+ (Integer, String, Enums, ...), collections of embeddable objects and
+ even arrays of primitive types. This is known as collection of
+ elements.</para>
+
+ <para>A collection of elements has to be annotated as
+ <literal>@CollectionOfElements</literal> (as a replacement of
+ <literal>@OneToMany</literal>) To define the collection table, the
+ <literal>@JoinTable</literal> annotation is used on the
association
+ property, <literal>joinColumns</literal> defines the join columns
+ between the entity primary table and the collection table
+ (inverseJoincolumn is useless and should be left empty). For
+ collection of core types or array of primitive types, you can
+ override the element column definition using a
+ <literal>@Column</literal> on the association property. You can
also
+ override the columns of a collection of embeddable object using
+ <literal>@AttributeOverride</literal>. To reach the collection
+ element, you need to append "element" to the attribute override name
+ (eg "element" for core types, or "element.serial" for the
serial
+ property of an embeddable element). To reach the index/key of a
+ collection, append "key" instead.</para>
+
+ <programlisting>@Entity
+public class Boy {
+ private Integer id;
+ private Set<String> nickNames = new HashSet<String>();
+ private int[] favoriteNumbers;
+ private Set<Toy> favoriteToys = new HashSet<Toy>();
+ private Set<Character> characters = new
HashSet<Character>();
+
+ @Id @GeneratedValue
+ public Integer getId() {
+ return id;
+ }
+
+ @CollectionOfElements
+ public Set<String> getNickNames() {
+ return nickNames;
+ }
+
+ @CollectionOfElements
+ @JoinTable(
+ table=@Table(name="BoyFavoriteNumbers"),
+ joinColumns = @JoinColumn(name="BoyId")
+ )
+ @Column(name="favoriteNumber", nullable=false)
+ @IndexColumn(name="nbr_index")
+ public int[] getFavoriteNumbers() {
+ return favoriteNumbers;
+ }
+
+ @CollectionOfElements
+ @AttributeOverride( name="element.serial",
column=@Column(name="serial_nbr") )
+ public Set<Toy> getFavoriteToys() {
+ return favoriteToys;
+ }
+
+ @CollectionOfElements
+ public Set<Character> getCharacters() {
+ return characters;
+ }
+ ...
+}
+
+public enum Character {
+ GENTLE,
+ NORMAL,
+ AGGRESSIVE,
+ ATTENTIVE,
+ VIOLENT,
+ CRAFTY
+}
+
+@Embeddable
+public class Toy {
+ public String name;
+ public String serial;
+ public Boy owner;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getSerial() {
+ return serial;
+ }
+
+ public void setSerial(String serial) {
+ this.serial = serial;
+ }
+
+ @Parent
+ public Boy getOwner() {
+ return owner;
+ }
+
+ public void setOwner(Boy owner) {
+ this.owner = owner;
+ }
+
+ public boolean equals(Object o) {
+ if ( this == o ) return true;
+ if ( o == null || getClass() != o.getClass() ) return false;
+
+ final Toy toy = (Toy) o;
+
+ if ( !name.equals( toy.name ) ) return false;
+ if ( !serial.equals( toy.serial ) ) return false;
+
+ return true;
+ }
+
+ public int hashCode() {
+ int result;
+ result = name.hashCode();
+ result = 29 * result + serial.hashCode();
+ return result;
+ }
+}</programlisting>
+
+ <para>On a collection of embeddable objects, the embeddable object
+ can have a property annotated with <literal>@Parent</literal>.
This
+ property will then point back to the entity containing the
+ collection.</para>
+
+ <note>
+ <para>Previous versions of Hibernate Annotations used the
+ <literal>@OneToMany</literal> to mark a collection of elements.
+ Due to semantic inconsistencies, we've introduced the annotation
+ <literal>@CollectionOfElements</literal>. Marking collections of
+ elements the old way still work but is considered deprecated and
+ is going to be unsupported in future releases</para>
+ </note>
+ </section>
+
+ <section>
+ <title>@ManyToAny</title>
+
+ <para><classname>@ManyToAny</classname> allows polymorphic
+ associations to classes from multiple tables. This type of mapping
+ always requires more than one column. The first column holds the
+ type of the associated entity. The remaining columns hold the
+ identifier. It is impossible to specify a foreign key constraint for
+ this kind of association, so this is most certainly not meant as the
+ usual way of mapping (polymorphic) associations. You should use this
+ only in very special cases (eg. audit logs, user session data,
+ etc).</para>
+
+ <programlisting> @ManyToAny(
+ metaColumn = @Column( name = "property_type" ) )
+ @AnyMetaDef(
+ idType = "integer",
+ metaType = "string",
+ metaValues = {
+ @MetaValue( value = "S", targetEntity = StringProperty.class ),
+ @MetaValue( value = "I", targetEntity = IntegerProperty.class ) }
)
+ @Cascade( { org.hibernate.annotations.CascadeType.ALL } )
+ @JoinTable( name = "obj_properties", joinColumns = @JoinColumn( name =
"obj_id" ),
+ inverseJoinColumns = @JoinColumn( name = "property_id" ) )
+ public List<Property> getGeneralProperties() {</programlisting>
+
+ <para>Like <classname>@Any</classname>,
+ <classname>@ManyToAny</classname> can use named
+ <classname>@AnyDef</classname>s, see <xref
+ linkend="entity-hibspec-singleassoc-any" /> for more
info.</para>
+ </section>
+ </section>
+ </section>
+
+ <section id="entity-hibspec-cascade">
+ <title>Cascade</title>
+
+ <para>Hibernate offers more operations than the Java Persistence
+ specification. You can use the <literal>@Cascade</literal> annotation
to
+ cascade the following operations:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>PERSIST</para>
+ </listitem>
+
+ <listitem>
+ <para>MERGE</para>
+ </listitem>
+
+ <listitem>
+ <para>REMOVE</para>
+ </listitem>
+
+ <listitem>
+ <para>REFRESH</para>
+ </listitem>
+
+ <listitem>
+ <para>DELETE</para>
+ </listitem>
+
+ <listitem>
+ <para>SAVE_UPDATE</para>
+ </listitem>
+
+ <listitem>
+ <para>REPLICATE</para>
+ </listitem>
+
+ <listitem>
+ <para>DELETE_ORPHAN</para>
+ </listitem>
+
+ <listitem>
+ <para>LOCK</para>
+ </listitem>
+
+ <listitem>
+ <para>EVICT</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>This is especially useful for
<literal>SAVE_UPDATE</literal>
+ (which is the operation cascaded at flush time if you use plain
+ Hibernate Annotations - Hibernate EntityManager cascade
+ <literal>PERSIST</literal> at flush time as per the specification).
+ DELETE_ORPHAN applies only to <literal>@OneToMany</literal>
+ associations, and indicates that the
+ <methodname>delete()/remove()</methodname> operation should be applied
+ to any child object that is removed from the association. In other
+ words, if a child is dereferenced by a persistent parent and if
+ <literal>DELETE_ORPHAN</literal> is used, the "orphaned"
child is
+ deleted.</para>
+
+ <programlisting>@OneToMany( cascade = {CascadeType.PERSIST,
CascadeType.MERGE} )
+(a)Cascade({org.hibernate.annotations.CascadeType.SAVE_UPDATE,
+ org.hibernate.annotations.CascadeType.DELETE_ORPHAN})
+public Collection<Employer> getEmployers()</programlisting>
+
+ <para>It is recommended to use @Cascade to compliment @*To*(cascade=...)
+ as shown in the previous example.</para>
+ </section>
+
+ <section>
+ <title>Cache</title>
+
+ <para>In order to optimize your database accesses, you can activate the
+ so called second level cache of Hibernate. This cache is configurable on
+ a per entity and per collection basis.</para>
+
+ <para><literal>(a)org.hibernate.annotations.Cache</literal> defines
the
+ caching strategy and region of a given second level cache. This
+ annotation can be applied on the root entity (not the sub entities), and
+ on the collections.</para>
+
+ <programlisting>@Entity
+@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
+public class Forest { ... }</programlisting>
+
+ <programlisting> @OneToMany(cascade=CascadeType.ALL,
fetch=FetchType.EAGER)
+ @JoinColumn(name="CUST_ID")
+ @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
+ public SortedSet<Ticket> getTickets() {
+ return tickets;
+ }</programlisting>
+
+ <para></para>
+<!--
+ <programlistingco>
+ <areaspec>
+ <area coords="2 55" id="hm11" />
+
+ <area coords="3 55" id="hm12" />
+
+ <area coords="4 55" id="hm13" />
+ </areaspec>
+
+ <programlisting>@Cache(
+ CacheConcurrencyStrategy usage();
+ String region() default "";
+ String include() default "all";
+)</programlisting>
+
+ <calloutlist>
+ <callout arearefs="hm11">
+ <para>usage: the given cache concurrency strategy (NONE,
+ READ_ONLY, NONSTRICT_READ_WRITE, READ_WRITE, TRANSACTIONAL)</para>
+ </callout>
+
+ <callout arearefs="hm12">
+ <para>region (optional): the cache region (default to the fqcn of
+ the class or the fq role name of the collection)</para>
+ </callout>
+
+ <callout arearefs="hm13">
+ <para><literal>include</literal> (optional): all to include
all
+ properties, non-lazy to only include non lazy properties (default
+ all).</para>
+ </callout>
+ </calloutlist>
+ </programlistingco>
+-->
+<programlisting language="Java" role="Java">
+<xi:include parse="text"
href="../extras/cache_concurrency_strategy.java"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+
+ <itemizedlist>
+ <listitem>
+ <para>usage: the given cache concurrency strategy (NONE,
+ READ_ONLY, NONSTRICT_READ_WRITE, READ_WRITE, TRANSACTIONAL)</para>
+ </listitem>
+
+ <listitem>
+ <para>region (optional): the cache region (default to the fqcn of
+ the class or the fq role name of the collection)</para>
+ </listitem>
+
+ <listitem>
+ <para><literal>include</literal> (optional): all to include
all
+ properties, non-lazy to only include non lazy properties (default
+ all).</para>
+ </listitem>
+
+ </itemizedlist>
+
+ </section>
+
+ <section id="entity-hibspec-filters">
+ <title>Filters</title>
+
+ <para>Hibernate has the ability to apply arbitrary filters on top of
+ your data. Those filters are applied at runtime on a given session.
+ First, you need to define them.</para>
+
+ <para><literal>(a)org.hibernate.annotations.FilterDef</literal> or
+ <literal>@FilterDefs</literal> define filter definition(s) used by
+ filter(s) using the same name. A filter definition has a name() and an
+ array of parameters(). A parameter will allow you to adjust the behavior
+ of the filter at runtime. Each parameter is defined by a
+ <literal>@ParamDef</literal> which has a name and a type. You can also
+ define a defaultCondition() parameter for a given
+ <literal>@FilterDef</literal> to set the default condition to use when
+ none are defined in each individual <literal>@Filter</literal>. A
+ <literal>@FilterDef</literal>(s) can be defined at the class or
package
+ level.</para>
+
+ <para>We now need to define the SQL filter clause applied to either the
+ entity load or the collection load. <literal>@Filter</literal> is used
+ and placed either on the entity or the collection element</para>
+
+ <para><programlisting>@Entity
+@FilterDef(name="minLength", parameters=@ParamDef( name="minLength",
type="integer" ) )
+@Filters( {
+ @Filter(name="betweenLength", condition=":minLength <= length
and :maxLength >= length"),
+ @Filter(name="minLength", condition=":minLength <=
length")
+} )
+public class Forest { ... }</programlisting></para>
+
+ <para>When the collection use an association table as a relational
+ representation, you might want to apply the filter condition to the
+ association table itself or to the target entity table. To apply the
+ constraint on the target entity, use the regular
+ <literal>@Filter</literal> annotation. However, if you wan to target
the
+ association table, use the <literal>@FilterJoinTable</literal>
+ annotation.</para>
+
+ <programlisting> @OneToMany
+ @JoinTable
+ //filter on the target entity table
+ @Filter(name="betweenLength", condition=":minLength <= length
and :maxLength >= length")
+ //filter on the association table
+ @FilterJoinTable(name="security", condition=":userlevel >=
requredLevel")
+ public Set<Forest> getForests() { ... }</programlisting>
+ </section>
+
+ <section id="entity-hibspec-query">
+ <title>Queries</title>
+
+ <para>Since Hibernate has more features on named queries than the one
+ defined in the EJB3 specification,
+ <literal>(a)org.hibernate.annotations.NamedQuery</literal>,
+ <literal>(a)org.hibernate.annotations.NamedQueries</literal>,
+ <literal>(a)org.hibernate.annotations.NamedNativeQuery</literal> and
+ <literal>(a)org.hibernate.annotations.NamedNativeQueries</literal> have
+ been introduced. They add some attributes to the standard version and
+ can be used as a replacement:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>flushMode: define the query flush mode (Always, Auto, Commit
+ or Manual)</para>
+ </listitem>
+
+ <listitem>
+ <para>cacheable: whether the query should be cached or not</para>
+ </listitem>
+
+ <listitem>
+ <para>cacheRegion: cache region used if the query is cached</para>
+ </listitem>
+
+ <listitem>
+ <para>fetchSize: JDBC statement fetch size for this query</para>
+ </listitem>
+
+ <listitem>
+ <para>timeout: query time out</para>
+ </listitem>
+
+ <listitem>
+ <para>callable: for native queries only, to be set to true for
+ stored procedures</para>
+ </listitem>
+
+ <listitem>
+ <para>comment: if comments are activated, the comment seen when the
+ query is sent to the database.</para>
+ </listitem>
+
+ <listitem>
+ <para>cacheMode: Cache interaction mode (get, ignore, normal, put or
+ refresh)</para>
+ </listitem>
+
+ <listitem>
+ <para>readOnly: whether or not the elements retrievent from the
+ query are in read only mode.</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>Those hints can be set in a standard
+ <literal>(a)javax.persistence.NamedQuery</literal> annotations through
the
+ detyped <literal>@QueryHint</literal>. Another key advantage is the
+ ability to set those annotations at a package level.</para>
+ </section>
+
+ <section id="entity-hibspec-customsql" revision="1">
+ <title>Custom SQL for CRUD operations</title>
+
+ <para>Hibernate gives you the ability to override every single SQL
+ statement generated. We have seen native SQL query usage already, but
+ you can also override the SQL statement used to load or change the state
+ of entities.</para>
+
+ <programlisting>@Entity
+@Table(name="CHAOS")
+@SQLInsert( sql="INSERT INTO CHAOS(size, name, nickname, id)
VALUES(?,upper(?),?,?)")
+@SQLUpdate( sql="UPDATE CHAOS SET size = ?, name = upper(?), nickname = ? WHERE id =
?")
+@SQLDelete( sql="DELETE CHAOS WHERE id = ?")
+@SQLDeleteAll( sql="DELETE CHAOS")
+@Loader(namedQuery = "chaos")
+@NamedNativeQuery(name="chaos", query="select id, size, name, lower(
nickname ) as nickname from CHAOS where id= ?", resultClass = Chaos.class)
+public class Chaos {
+ @Id
+ private Long id;
+ private Long size;
+ private String name;
+ private String nickname;</programlisting>
+
+ <para><literal>@SQLInsert</literal>,
<literal>@SQLUpdate</literal>,
+ <literal>@SQLDelete</literal>,
<literal>@SQLDeleteAll</literal>
+ respectively override the INSERT statement, UPDATE statement, DELETE
+ statement, DELETE statement to remove all entities.</para>
+
+ <para>If you expect to call a store procedure, be sure to set the
+ <literal>callable</literal> attribute to true
+ (<literal>@SQLInsert(callable=true, ...)</literal>).</para>
+
+ <para>To check that the execution happens correctly, Hibernate allows
+ you to define one of those three strategies:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>NONE: no check is performed: the store procedure is expected
+ to fail upon issues</para>
+ </listitem>
+
+ <listitem>
+ <para>COUNT: use of rowcount to check that the update is
+ successful</para>
+ </listitem>
+
+ <listitem>
+ <para>PARAM: like COUNT but using an output parameter rather that
+ the standard mechanism</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>To define the result check style, use the
<literal>check</literal>
+ parameter (<literal>(a)SQLUpdate(check=ResultCheckStyle.COUNT,
+ ...)</literal>).</para>
+
+ <para>You can also override the SQL load statement by a native SQL query
+ or a HQL query. You just have to refer to a named query with the
+ <literal><literal>@Loader</literal></literal>
annotation.</para>
+
+ <para>You can use the exact same set of annotations to override the
+ collection related statements.</para>
+
+ <programlisting>@OneToMany
+@JoinColumn(name="chaos_fk")
+@SQLInsert( sql="UPDATE CASIMIR_PARTICULE SET chaos_fk = ? where id = ?")
+@SQLDelete( sql="UPDATE CASIMIR_PARTICULE SET chaos_fk = null where id = ?")
+private Set<CasimirParticle> particles = new
HashSet<CasimirParticle>();</programlisting>
+
+ <para>The parameters order is important and is defined by the order
+ Hibernate handle properties. You can see the expected order by enabling
+ debug logging for the
<literal>org.hibernate.persister.entity</literal>
+ level. With this level enabled Hibernate will print out the static SQL
+ that is used to create, update, delete etc. entities. (To see the
+ expected sequence, remember to not include your custom SQL through
+ annotations as that will override the Hibernate generated static
+ sql.)</para>
+
+ <para>Overriding SQL statements for secondary tables is also possible
+ using <literal>(a)org.hibernate.annotations.Table</literal> and either
(or
+ all) attributes <literal>sqlInsert</literal>,
+ <literal>sqlUpdate</literal>,
<literal>sqlDelete</literal>:</para>
+
+ <programlisting>@Entity
+@SecondaryTables({
+ @SecondaryTable(name = "`Cat nbr1`"),
+ @SecondaryTable(name = "Cat2"})
+(a)org.hibernate.annotations.Tables( {
+ @Table(appliesTo = "Cat", comment = "My cat table" ),
+ @Table(appliesTo = "Cat2", foreignKey =
@ForeignKey(name="FK_CAT2_CAT"), fetch = FetchMode.SELECT,
+ sqlInsert=@SQLInsert(sql="insert into Cat2(storyPart2, id) values(upper(?),
?)") )
+} )
+public class Cat implements Serializable {</programlisting>
+
+ <para>The previous example also show that you can give a comment to a
+ given table (promary or secondary): This comment will be used for DDL
+ generation.</para>
+ </section>
+
+ <section>
+ <title>Tuplizer</title>
+
+ <para><classname>org.hibernate.tuple.Tuplizer</classname>, and
its
+ sub-interfaces, are responsible for managing a particular representation
+ of a piece of data, given that representation's
+ <literal>org.hibernate.EntityMode</literal>. If a given piece of data
is
+ thought of as a data structure, then a tuplizer is the thing which knows
+ how to create such a data structure and how to extract values from and
+ inject values into such a data structure. For example, for the POJO
+ entity mode, the correpsonding tuplizer knows how create the POJO
+ through its constructor and how to access the POJO properties using the
+ defined property accessors. There are two high-level types of Tuplizers,
+ represented by the
+ <classname>org.hibernate.tuple.EntityTuplizer</classname> and
+ <classname>org.hibernate.tuple.ComponentTuplizer</classname>
interfaces.
+ EntityTuplizers are responsible for managing the above mentioned
+ contracts in regards to entities, while
+ <classname>ComponentTuplizers</classname> do the same for components.
+ Check the Hibernate reference documentation for more information.</para>
+
+ <para>To define tuplixer in annotations, simply use the
+ <literal>@Tuplizer</literal> annotation on the according
element</para>
+
+ <programlisting>@Entity
+@Tuplizer(impl = DynamicEntityTuplizer.class)
+public interface Cuisine {
+ @Id
+ @GeneratedValue
+ public Long getId();
+ public void setId(Long id);
+
+ public String getName();
+ public void setName(String name);
+
+ @Tuplizer(impl = DynamicComponentTuplizer.class)
+ public Country getCountry();
+ public void setCountry(Country country);
+
+
+}</programlisting>
+ </section>
+ </section>
+</chapter>
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/modules/setup.xml
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/modules/setup.xml
(rev 0)
+++ annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/modules/setup.xml 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,201 @@
+<?xml version='1.0' encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+<!ENTITY % BOOK_ENTITIES SYSTEM
"../Hibernate_Annotations_Reference_Guide.ent">
+%BOOK_ENTITIES;
+]>
+
+<!--
+ ~ Hibernate, Relational Persistence for Idiomatic Java
+ ~
+ ~ Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ ~ indicated by the @author tags or express copyright attribution
+ ~ statements applied by the authors. All third-party contributions are
+ ~ distributed under license by Red Hat Middleware LLC.
+ ~
+ ~ This copyrighted material is made available to anyone wishing to use, modify,
+ ~ copy, or redistribute it subject to the terms and conditions of the GNU
+ ~ Lesser General Public License, as published by the Free Software Foundation.
+ ~
+ ~ This program is distributed in the hope that it will be useful,
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ ~ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ ~ for more details.
+ ~
+ ~ You should have received a copy of the GNU Lesser General Public License
+ ~ along with this distribution; if not, write to:
+ ~ Free Software Foundation, Inc.
+ ~ 51 Franklin Street, Fifth Floor
+ ~ Boston, MA 02110-1301 USA
+ -->
+<chapter>
+ <title id="setup" revision="1">Setting up an annotations
project</title>
+
+ <section id="setup-requirements" revision="2">
+ <title>Requirements</title>
+
+ <itemizedlist>
+ <listitem>
+ <para>Download and unpack the Hibernate Annotations distribution
+ from the Hibernate website located at
+ <ulink
url="http://www.hibernate.org/6.html">
+
http://www.hibernate.org/6.html</ulink>
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>This release requires Hibernate Core 3.3 and
+ above and is known to work on Hibernate
+ Core 3.3.0.SP1</para>
+ </listitem>
+
+ <listitem>
+ <para>Make sure you have JDK 5.0 installed or above. You can, of
+ course, continue using XDoclet and get some of the benefits of
+ annotation-based metadata with older JDK versions. Note that this
+ document only describes JDK 5.0 annotations. Please refer to
+ the XDoclet documentation for more information.</para>
+ </listitem>
+ </itemizedlist>
+ </section>
+
+ <section id="setup-configuration" revision="2">
+ <title>Configuration</title>
+
+ <para>Once a new project has been created in your IDE of choice, set up
+ your classpath: <itemizedlist>
+ <listitem>
+ <para>Copy all Hibernate3 core and the required 3rd party library files
+ (see lib/README.txt in Hibernate).</para>
+ </listitem>
+
+ <listitem>
+ <para>Copy <filename>hibernate-annotations.jar</filename>,
+ <filename>lib/hibernate-comons-annotations.jar</filename> and
+ <filename>lib/ejb3-persistence.jar</filename> from the Hibernate
+ Annotations distribution to your classpath as well.</para>
+ </listitem>
+ </itemizedlist></para>
+
+ <para>If you wish to use <ulink
+ url="http://validator.hibernate.org">Hibernate Validator</ulink>,
download
+ it from the Hibernate website and add
+ <filename>hibernate-validator.jar</filename> to your
classpath.</para>
+
+ <para>If you wish to use <ulink
+ url="http://search.hibernate.org">Hibernate Search</ulink>,
download it
+ from the Hibernate website and add
+ <filename>hibernate-search.jar</filename> and
+ <filename>lucene-core-x.y.z.jar</filename> to your
classpath.</para>
+
+ <para>We also recommend a small wrapper class to startup Hibernate in a
+ static initializer block, known as <classname>HibernateUtil</classname>.
+ You might have seen this class in various forms in other areas of the
+ Hibernate documentation. For Annotation support you have to enhance this
+ helper class as follows:
+ </para>
+
+ <programlisting language="Java" role="Java"><xi:include
parse="text"
+ href="../extras/HibernateUtil.java"
+
xmlns:xi="http://www.w3.org/2001/XInclude"/></programlist...
+
+ <para>Note the use of
+ <classname>AnnotationConfiguration</classname>. The packages and
annotated
+ classes are declared in your regular XML configuration file (usually
+ <filename>hibernate.cfg.xml</filename>). Here is the equivalent of the
+ above declaration:</para>
+
+ <programlisting language="XML" role="XML">
+<xi:include parse="text" href="../extras/hibernate.cfg.xml_sample"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+
+ <para>Note that you can mix the hbm.xml use and the new annotation one.
+ The resource element can be either an hbm file or an EJB3 XML deployment
+ descriptor. The distinction is transparent for your configuration
+ process.</para>
+
+ <para>Alternatively, you can define the annotated classes and packages
+ using the programmatic API:</para>
+
+<programlisting language="Java" role="Java">
+<xi:include parse="text"
href="../extras/AnnotatedClassesandPackages.java"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+
+ <para>You can also use the Hibernate EntityManager which has its own
+ configuration mechanism. Please refer to this project documentation for
+ more details.</para>
+
+ <para>There is no other difference in the way you use Hibernate APIs with
+ annotations, except for this startup routine change or in the
+ configuration file. You can use your favorite configuration method for
+ other properties ( <filename>hibernate.properties</filename>,
+ <filename>hibernate.cfg.xml</filename>, programmatic APIs, etc). You can
+ even mix annotated persistent classes and classic
+ <filename>hbm.cfg.xml</filename> declarations with the same
+ <classname>SessionFactory</classname>. You cannot, however, declare a
class
+ several times (whether annotated or through hbm.xml). You cannot mix
+ configuration strategies (hbm vs annotations) in a mapped entity hierarchy
+ either.</para>
+
+ <para>To ease the migration process from hbm files to annotations, the
+ configuration mechanism detects the mapping duplication between
+ annotations and hbm files. HBM files are then prioritized over annotated
+ metadata on a class to class basis. You can change the priority using
+ the <varname>hibernate.mapping.precedence</varname> property. The default
is
+ <literal>hbm, class</literal>, changing it to <literal>class,
+ hbm</literal> will prioritize the annotated classes over hbm files when a
+ conflict occurs.</para>
+ </section>
+
+ <section>
+ <title id="setup-properties">Properties</title>
+
+ <para>Asides from the Hibernate core properties, Hibernate Annotations
+ reacts to the following one</para>
+ </section>
+
+ <section>
+ <title>Logging</title>
+
+ <para>Hibernate Annotations utilizes <ulink
+
url="http://www.slf4j.org/">Simple Logging Facade for Java</ulink>
(SLF4J)
+ in order to log various system events. SLF4J can direct your logging
+ output to several logging frameworks (NOP, Simple, log4j version 1.2, JDK
+ 1.4 logging, JCL or logback) depending on your chosen binding. In order to
+ setup logging properly you will need <filename>slf4j-api.jar</filename>
in
+ your classpath together with the jar file for your preferred binding -
+ <filename>slf4j-log4j12.jar</filename> in the case of Log4J. See the
SLF4J
+ <ulink type=""
+
url="http://www.slf4j.org/manual.html">documentation</uli... for
more
+ detail.</para>
+
+ <para>The logging categories interesting for Hibernate Annotations
+ are:</para>
+
+ <table>
+ <title>Hibernate Annotations Log Categories</title>
+
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry align="center">Category</entry>
+
+ <entry align="center">Function</entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry>org.hibernate.cfg</entry>
+
+ <entry>Log all configuration related events (not only
+ annotations).</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <para>For further category configuration refer to the <ulink
+
url="http://www.hibernate.org/hib_docs/v3/reference/en/html_single/#...
+ in the Hibernate Core documentation.</para>
+ </section>
+</chapter>
Added:
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/modules/xml-overriding.xml
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/modules/xml-overriding.xml
(rev 0)
+++
annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/modules/xml-overriding.xml 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,655 @@
+<?xml version='1.0' encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+<!ENTITY % BOOK_ENTITIES SYSTEM
"../Hibernate_Annotations_Reference_Guide.ent">
+%BOOK_ENTITIES;
+]>
+<!--
+ ~ Hibernate, Relational Persistence for Idiomatic Java
+ ~
+ ~ Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ ~ indicated by the @author tags or express copyright attribution
+ ~ statements applied by the authors. All third-party contributions are
+ ~ distributed under license by Red Hat Middleware LLC.
+ ~
+ ~ This copyrighted material is made available to anyone wishing to use, modify,
+ ~ copy, or redistribute it subject to the terms and conditions of the GNU
+ ~ Lesser General Public License, as published by the Free Software Foundation.
+ ~
+ ~ This program is distributed in the hope that it will be useful,
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ ~ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ ~ for more details.
+ ~
+ ~ You should have received a copy of the GNU Lesser General Public License
+ ~ along with this distribution; if not, write to:
+ ~ Free Software Foundation, Inc.
+ ~ 51 Franklin Street, Fifth Floor
+ ~ Boston, MA 02110-1301 USA
+ -->
+<chapter id="xml-overriding">
+ <title>Overriding metadata through XML</title>
+
+ <para>The primary target for metadata in EJB3 is annotations, but the EJB3
+ specification provides a way to override or replace the annotation defined
+ metadata through an XML deployment descriptor. In the current release only
+ pure EJB3 annotations overriding are supported. If you wish to use Hibernate
+ specific features in some entities, you'll have to either use annotations or
+ fallback to hbm files. You can of course mix and match annotated entities
+ and entities describes in hbm files.</para>
+
+ <para>The unit test suite shows some additional XML file samples.</para>
+
+ <section id="xml-overriding-principles">
+ <title>Principles</title>
+
+ <para>The XML deployment descriptor structure has been designed to reflect
+ the annotations one. So if you know the annotations structure, using the
+ XML schema will be straightforward for you.</para>
+
+ <para>You can define one ot more XML files describing your metadata, these
+ files will be merged by the overriding engine.</para>
+
+ <section>
+ <title>Global level metadata</title>
+
+ <para>You can define global level metadata available for all XML files.
+ You must not define these metadata more than once per deployment.</para>
+
+ <programlisting><?xml version="1.0"
encoding="UTF-8"?>
+
+<entity-mappings
+
xmlns="http://java.sun.com/xml/ns/persistence/orm"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm orm_1_0.xsd"
+ version="1.0">
+
+ <persistence-unit-metadata>
+ <xml-mapping-metadata-complete/>
+ <persistence-unit-defaults>
+ <schema>myschema</schema>
+ <catalog>mycatalog</catalog>
+ <cascade-persist/>
+ </persistence-unit-defaults>
+ </persistence-unit-metadata></programlisting>
+
+ <para><literal>xml-mapping-metadata-complete</literal> means that
all
+ entity, mapped-superclasses and embeddable metadata should be picked up
+ from XML (ie ignore annotations).</para>
+
+ <para><literal>schema / catalog</literal> will override all
default
+ definitions of schema and catalog in the metadata (both XML and
+ annotations).</para>
+
+ <para><literal>cascade-persist</literal> means that all
associations
+ have PERSIST as a cascade type. We recommend you to not use this
+ feature.</para>
+ </section>
+
+ <section id="xml-overriding-principles-entity"
revision="1">
+ <title>Entity level metadata</title>
+
+ <para>You can either define or override metadata informations on a given
+ entity.</para>
+<!-- Replacing calloutlist as not currently supported (preserving as bugfix in
progress)
+ <programlistingco>
+ <areaspec>
+ <area coords="3 85" id="aa1" />
+
+ <area coords="9 85" id="aa2" />
+
+ <area coords="10 85" id="aa3" />
+
+ <area coords="11 85" id="aa4" />
+
+ <area coords="17 85" id="aa5" />
+
+ <area coords="23 85" id="aa6" />
+
+ <area coords="24 85" id="aa7" />
+
+ <area coords="25 85" id="aa8" />
+
+ <area coords="26 85" id="aa9" />
+
+ <area coords="31 85" id="aa10" />
+ </areaspec>
+
+ <programlisting><?xml version="1.0"
encoding="UTF-8"?>
+
+<entity-mappings
+
xmlns="http://java.sun.com/xml/ns/persistence/orm"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm orm_1_0.xsd"
+ version="1.0">
+
+
<package>org.hibernate.test.annotations.reflection</package>
+ <entity class="Administration" access="PROPERTY"
metadata-complete="true">
+ <table name="tbl_admin">
+ <unique-constraint>
+ <column-name>firstname</column-name>
+ <column-name>lastname</column-name>
+ </unique-constraint>
+ </table>
+ <secondary-table name="admin2">
+ <primary-key-join-column name="admin_id"
referenced-column-name="id"/>
+ <unique-constraint>
+ <column-name>address</column-name>
+ </unique-constraint>
+ </secondary-table>
+ <id-class class="SocialSecurityNumber"/>
+ <inheritance strategy="JOINED"/>
+ <sequence-generator name="seqhilo"
sequence-name="seqhilo"/>
+ <table-generator name="table"
table="tablehilo"/>
+ ...
+ </entity>
+
+ <entity class="PostalAdministration">
+ <primary-key-join-column name="id"/>
+ ...
+ </entity>
+</entity-mappings></programlisting>
+-->
+
+<programlisting language="XML" role="XML"><xi:include
parse="text" href="../extras/override_metadata_1.xml_sample"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+ <itemizedlist>
+ <listitem>
+ <para><literal>entity-mappings</literal>: entity-mappings
is the
+ root element for all XML files. You must declare the xml schema,
+ the schema file is included in the hibernate-annotations.jar file,
+ no internet access will be processed by Hibernate
+ Annotations.</para>
+ </listitem>
+
+ <listitem>
+ <para><literal>package</literal> (optional): default
package used
+ for all non qualified class names in the given deployment
+ descriptor file.</para>
+ </listitem>
+
+ <listitem>
+ <para><literal>entity</literal>: desribes an
entity.</para>
+ </listitem>
+
+ <listitem>
+ <para><literal>metadata-complete</literal> defines whether
the
+ metadata description for this element is complete or not (in other
+ words, if annotations present at the class level should be
+ considered or not).</para>
+ </listitem>
+ <listitem>
+ <para>An entity has to have a <literal>class</literal>
attribute
+ refering the java class the metadata applies on.</para>
+
+ <para>You can overrides entity name through the
+ <literal>name</literal> attribute, if none is defined and if an
+ <literal>(a)Entity.name</literal> is present, then it is used
+ (provided that metadata complete is not set).</para>
+
+ <para>For metadata complete (see below) element, you can define an
+ <literal>access</literal> (either
<literal>FIELD</literal> or
+ <literal>PROPERTY</literal> (default)). For non medatada
complete
+ element, if <literal>access</literal> is not defined, the @Id
+ position will lead position, if <literal>access</literal> is
+ defined, the value is used.</para>
+ </listitem>
+
+ <listitem>
+ <para><literal>table</literal>: you can declare table
properties
+ (name, schema, catalog), if none is defined, the java annotation
+ is used.</para>
+
+
+ <para>You can define one or several unique constraints as seen in
+ the example</para>
+ </listitem>
+
+ <listitem>
+ <para><literal>secondary-table</literal>: defines a
secondary
+ table very much like a regular table except that you can define
+ the primary key / foreign key column(s) through the
+ <literal>primary-key-join-column</literal> element. On non
+ metadata complete, annotation secondary tables are used only if
+ there is no <literal>secondary-table</literal> definition,
+ annotations are ignored otherwise.</para>
+ </listitem>
+
+ <listitem>
+ <para><literal>id-class</literal>: defines the id class in
a
+ similar way <literal>@IdClass</literal> does</para>
+ </listitem>
+
+ <listitem>
+ <para><literal>inheritance</literal>: defines the
inheritance
+ strategy (<literal>JOINED</literal>,
+ <literal>TABLE_PER_CLASS</literal>,
+ <literal>SINGLE_TABLE</literal>), Available only at the root
+ entity level</para>
+ </listitem>
+
+ <listitem>
+ <para><literal>sequence-generator</literal>: defines a
sequence
+ generator</para>
+ </listitem>
+
+ <listitem>
+ <para><literal>table-generator</literal>: defines a table
+ generator</para>
+ </listitem>
+
+ <listitem>
+
<para><literal><literal>primary-key-join-column</literal></literal>:
+ defines the primary key join column for sub entities when JOINED
+ inheritance strategy is used</para>
+ </listitem>
+ </itemizedlist>
+
+
+<!-- Replacing calloutlist as not currently supported (preserving as bugfix in
progress)
+ <calloutlist>
+ <callout arearefs="aa1">
+ <para><literal>entity-mappings</literal>: entity-mappings
is the
+ root element for all XML files. You must declare the xml schema,
+ the schema file is included in the hibernate-annotations.jar file,
+ no internet access will be processed by Hibernate
+ Annotations.</para>
+ </callout>
+
+ <callout arearefs="aa2">
+ <para><literal>package</literal> (optional): default
package used
+ for all non qualified class names in the given deployment
+ descriptor file.</para>
+ </callout>
+
+ <callout arearefs="aa3">
+ <para><literal>entity</literal>: desribes an
entity.</para>
+
+ <para><literal>metadata-complete</literal> defines whether
the
+ metadata description for this element is complete or not (in other
+ words, if annotations present at the class level should be
+ considered or not).</para>
+
+ <para>An entity has to have a <literal>class</literal>
attribute
+ refering the java class the metadata applies on.</para>
+
+ <para>You can overrides entity name through the
+ <literal>name</literal> attribute, if none is defined and if an
+ <literal>(a)Entity.name</literal> is present, then it is used
+ (provided that metadata complete is not set).</para>
+
+ <para>For metadata complete (see below) element, you can define an
+ <literal>access</literal> (either
<literal>FIELD</literal> or
+ <literal>PROPERTY</literal> (default)). For non medatada
complete
+ element, if <literal>access</literal> is not defined, the @Id
+ position will lead position, if <literal>access</literal> is
+ defined, the value is used.</para>
+ </callout>
+
+ <callout arearefs="aa4">
+ <para><literal>table</literal>: you can declare table
properties
+ (name, schema, catalog), if none is defined, the java annotation
+ is used.</para>
+
+ <para>You can define one or several unique constraints as seen in
+ the example</para>
+ </callout>
+
+ <callout arearefs="aa5">
+ <para><literal>secondary-table</literal>: defines a
secondary
+ table very much like a regular table except that you can define
+ the primary key / foreign key column(s) through the
+ <literal>primary-key-join-column</literal> element. On non
+ metadata complete, annotation secondary tables are used only if
+ there is no <literal>secondary-table</literal> definition,
+ annotations are ignored otherwise.</para>
+ </callout>
+
+ <callout arearefs="aa6">
+ <para><literal>id-class</literal>: defines the id class in
a
+ similar way <literal>@IdClass</literal> does</para>
+ </callout>
+
+ <callout arearefs="aa7">
+ <para><literal>inheritance</literal>: defines the
inheritance
+ strategy (<literal>JOINED</literal>,
+ <literal>TABLE_PER_CLASS</literal>,
+ <literal>SINGLE_TABLE</literal>), Available only at the root
+ entity level</para>
+ </callout>
+
+ <callout arearefs="aa8">
+ <para><literal>sequence-generator</literal>: defines a
sequence
+ generator</para>
+ </callout>
+
+ <callout arearefs="aa9">
+ <para><literal>table-generator</literal>: defines a table
+ generator</para>
+ </callout>
+
+ <callout arearefs="aa10">
+
<para><literal><literal>primary-key-join-column</literal></literal>:
+ defines the primary key join column for sub entities when JOINED
+ inheritance strategy is used</para>
+ </callout>
+ </calloutlist>
+ </programlistingco>
+
+
+ <para><literal>entity-mappings</literal>: entity-mappings
is the
+ root element for all XML files. You must declare the xml schema,
+ the schema file is included in the hibernate-annotations.jar file,
+ no internet access will be processed by Hibernate
+ Annotations.</para>
+
+
+ <callout arearefs="aa2">
+ <para><literal>package</literal> (optional): default
package used
+ for all non qualified class names in the given deployment
+ descriptor file.</para>
+ </callout>
+
+ <callout arearefs="aa3">
+ <para><literal>entity</literal>: desribes an
entity.</para>
+
+ <para><literal>metadata-complete</literal> defines whether
the
+ metadata description for this element is complete or not (in other
+ words, if annotations present at the class level should be
+ considered or not).</para>
+
+ <para>An entity has to have a <literal>class</literal>
attribute
+ refering the java class the metadata applies on.</para>
+
+ <para>You can overrides entity name through the
+ <literal>name</literal> attribute, if none is defined and if an
+ <literal>(a)Entity.name</literal> is present, then it is used
+ (provided that metadata complete is not set).</para>
+
+ <para>For metadata complete (see below) element, you can define an
+ <literal>access</literal> (either
<literal>FIELD</literal> or
+ <literal>PROPERTY</literal> (default)). For non medatada
complete
+ element, if <literal>access</literal> is not defined, the @Id
+ position will lead position, if <literal>access</literal> is
+ defined, the value is used.</para>
+ </callout>
+
+ <callout arearefs="aa4">
+ <para><literal>table</literal>: you can declare table
properties
+ (name, schema, catalog), if none is defined, the java annotation
+ is used.</para>
+
+ <para>You can define one or several unique constraints as seen in
+ the example</para>
+ </callout>
+
+ <callout arearefs="aa5">
+ <para><literal>secondary-table</literal>: defines a
secondary
+ table very much like a regular table except that you can define
+ the primary key / foreign key column(s) through the
+ <literal>primary-key-join-column</literal> element. On non
+ metadata complete, annotation secondary tables are used only if
+ there is no <literal>secondary-table</literal> definition,
+ annotations are ignored otherwise.</para>
+ </callout>
+
+ <callout arearefs="aa6">
+ <para><literal>id-class</literal>: defines the id class in
a
+ similar way <literal>@IdClass</literal> does</para>
+ </callout>
+
+ <callout arearefs="aa7">
+ <para><literal>inheritance</literal>: defines the
inheritance
+ strategy (<literal>JOINED</literal>,
+ <literal>TABLE_PER_CLASS</literal>,
+ <literal>SINGLE_TABLE</literal>), Available only at the root
+ entity level</para>
+ </callout>
+
+ <callout arearefs="aa8">
+ <para><literal>sequence-generator</literal>: defines a
sequence
+ generator</para>
+ </callout>
+
+ <callout arearefs="aa9">
+ <para><literal>table-generator</literal>: defines a table
+ generator</para>
+ </callout>
+
+ <callout arearefs="aa10">
+
<para><literal><literal>primary-key-join-column</literal></literal>:
+ defines the primary key join column for sub entities when JOINED
+ inheritance strategy is used</para>
+ </callout>
+ -->
+<!-- Replacing calloutlist as not currently supported (preserving as bugfix in
progress)
+ <programlistingco>
+ <areaspec>
+ <area coords="11 85" id="ab1" />
+
+ <area coords="18 85" id="ab2" />
+
+ <area coords="22 85" id="ab3" />
+
+ <area coords="28 85" id="ab4" />
+
+ <area coords="34 85" id="ab5" />
+ </areaspec>
+
+ <programlisting><?xml version="1.0"
encoding="UTF-8"?>
+
+<entity-mappings
+
xmlns="http://java.sun.com/xml/ns/persistence/orm"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm orm_1_0.xsd"
+ version="1.0">
+
+
<package>org.hibernate.test.annotations.reflection</package>
+ <entity class="Music" access="PROPERTY"
metadata-complete="true">
+ <discriminator-value>Generic</discriminator-value>
+ <discriminator-column length="34"/>
+ ...
+ </entity>
+
+ <entity class="PostalAdministration">
+ <primary-key-join-column name="id"/>
+ <named-query name="adminById">
+ <query>select m from Administration m where m.id =
:id</query>
+ <hint name="org.hibernate.timeout"
value="200"/>
+ </named-query>
+ <named-native-query name="allAdmin"
result-set-mapping="adminrs">
+ <query>select *, count(taxpayer_id) as taxPayerNumber
+ from Administration, TaxPayer
+ where taxpayer_admin_id = admin_id group by ...</query>
+ <hint name="org.hibernate.timeout"
value="200"/>
+ </named-native-query>
+ <sql-result-set-mapping name="adminrs">
+ <entity-result entity-class="Administration">
+ <field-result name="name"
column="fld_name"/>
+ </entity-result>
+ <column-result name="taxPayerNumber"/>
+ </sql-result-set-mapping>
+ <attribute-override name="ground">
+ <column name="fld_ground" unique="true"
scale="2"/>
+ </attribute-override>
+ <association-override name="referer">
+ <join-column name="referer_id"
referenced-column-name="id"/>
+ </association-override>
+ ...
+ </entity>
+</entity-mappings></programlisting>
+
+ <calloutlist>
+ <callout arearefs="ab1">
+ <para><literal>discriminator-value /
+ discriminator-column</literal>: defines the discriminator value
+ and the column holding it when the SINGLE_TABLE inheritance
+ strategy is chosen</para>
+ </callout>
+
+ <callout arearefs="ab2">
+ <para><literal>named-query</literal>: defines named queries
and
+ possibly the hints associated to them. Those definitions are
+ additive to the one defined in annotations, if two definitions
+ have the same name, the XML one has priority.</para>
+ </callout>
+
+ <callout arearefs="ab3">
+ <para><literal>named-native-query</literal>: defines an
named
+ native query and its sql result set mapping. Alternatively, you
+ can define the <literal>result-class</literal>. Those
definitions
+ are additive to the one defined in annotations, if two definitions
+ have the same name, the XML one has priority.</para>
+ </callout>
+
+ <callout arearefs="ab4">
+ <para><literal>sql-result-set-mapping</literal>: describes
the
+ result set mapping structure. You can define both entity and
+ column mappings. Those definitions are additive to the one defined
+ in annotations, if two definitions have the same name, the XML one
+ has priority</para>
+ </callout>
+
+ <callout arearefs="ab5">
+ <para><literal>attribute-override /
+ association-override</literal>: defines a column or join column
+ overriding. This overriding is additive to the one defined in
+ annotations</para>
+ </callout>
+ </calloutlist>
+ </programlistingco>
+-->
+<programlisting language="XML" role="XML">
+<xi:include parse="text"
href="../extras/override_metadata_2.xml_sample"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+ <itemizedlist>
+ <listitem>
+ <para><literal>discriminator-value /
+ discriminator-column</literal>: defines the discriminator value
+ and the column holding it when the SINGLE_TABLE inheritance
+ strategy is chosen</para>
+ </listitem>
+
+ <listitem>
+ <para><literal>named-query</literal>: defines named queries
and
+ possibly the hints associated to them. Those definitions are
+ additive to the one defined in annotations, if two definitions
+ have the same name, the XML one has priority.</para>
+ </listitem>
+
+ <listitem>
+ <para><literal>named-native-query</literal>: defines an
named
+ native query and its sql result set mapping. Alternatively, you
+ can define the <literal>result-class</literal>. Those
definitions
+ are additive to the one defined in annotations, if two definitions
+ have the same name, the XML one has priority.</para>
+ </listitem>
+
+ <listitem>
+ <para><literal>sql-result-set-mapping</literal>: describes
the
+ result set mapping structure. You can define both entity and
+ column mappings. Those definitions are additive to the one defined
+ in annotations, if two definitions have the same name, the XML one
+ has priority</para>
+ </listitem>
+
+ <listitem>
+ <para><literal>attribute-override /
+ association-override</literal>: defines a column or join column
+ overriding. This overriding is additive to the one defined in
+ annotations</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>Same applies for
<literal><embeddable></literal> and
+ <literal><mapped-superclass></literal>.</para>
+ </section>
+
+ <section>
+ <title>Property level metadata</title>
+
+ <para>You can of course defines XML overriding for properties. If
+ metadata complete is defined, then additional properties (ie at the Java
+ level) will be ignored. Otherwise, once you start overriding a property,
+ all annotations on the given property are ignored. All property level
+ metadata behave in <literal>entity/attributes</literal>,
+ <literal>mapped-superclass/attributes</literal> or
+ <literal>embeddable/attributes</literal>.</para>
+
+ <programlisting> <attributes>
+ <id name="id">
+ <column name="fld_id"/>
+ <generated-value generator="generator"
strategy="SEQUENCE"/>
+ <temporal>DATE</temporal>
+ <sequence-generator name="generator"
sequence-name="seq"/>
+ </id>
+ <version name="version"/>
+ <embedded name="embeddedObject">
+ <attribute-override name"subproperty">
+ <column name="my_column"/>
+ </attribute-override>
+ </embedded>
+ <basic name="status" optional="false">
+ <enumerated>STRING</enumerated>
+ </basic>
+ <basic name="serial" optional="true">
+ <column name="serialbytes"/>
+ <lob/>
+ </basic>
+ <basic name="terminusTime" fetch="LAZY">
+ <temporal>TIMESTAMP</temporal>
+ </basic>
+ </attributes></programlisting>
+
+ <para>You can override a property through <literal>id</literal>,
+ <literal>embedded-id</literal>,
<literal>version</literal>,
+ <literal>embedded</literal> and <literal>basic</literal>.
Each of these
+ elements can have subelements accordingly: <literal>lob</literal>,
+ <literal>temporal</literal>,
<literal>enumerated</literal>,
+ <literal>column</literal>.</para>
+ </section>
+
+ <section>
+ <title>Association level metadata</title>
+
+ <para>You can define XML overriding for associations. All association
+ level metadata behave in <literal>entity/attributes</literal>,
+ <literal>mapped-superclass/attributes</literal> or
+ <literal>embeddable/attributes</literal>.</para>
+
+ <programlisting> <attributes>
+ <one-to-many name="players" fetch="EAGER">
+ <map-key name="name"/>
+ <join-column name="driver"/>
+ <join-column name="number"/>
+ </one-to-many>
+ <many-to-many name="roads"
target-entity="Administration">
+ <order-by>maxSpeed</order-by>
+ <join-table name="bus_road">
+ <join-column name="driver"/>
+ <join-column name="number"/>
+ <inverse-join-column name="road_id"/>
+ <unique-constraint>
+ <column-name>driver</column-name>
+ <column-name>number</column-name>
+ </unique-constraint>
+ </join-table>
+ </many-to-many>
+ <many-to-many name="allTimeDrivers"
mapped-by="drivenBuses">
+ </attributes></programlisting>
+
+ <para>You can override an association through
+ <literal>one-to-many</literal>,
<literal>one-to-one</literal>,
+ <literal>many-to-one</literal>, and
<literal>many-to-many</literal>.
+ Each of these elements can have subelements accordingly:
+ <literal>join-table</literal> (which can have
+ <literal>join-column</literal>s and
+ <literal>inverse-join-column</literal>s),
+ <literal><literal>join-column</literal>s</literal>,
+ <literal>map-key</literal>, and
<literal>order-by</literal>.
+ <literal>mapped-by</literal> and
<literal>target-entity</literal> can be
+ defined as attributes when it makes sense. Once again the structure is
+ reflects the annotations structure. You can find all semantic
+ informations in the chapter describing annotations.</para>
+ </section>
+ </section>
+</chapter>
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/pom.xml
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/pom.xml
(rev 0)
+++ annotations/branches/v3_4_0_GA_CP/src/main/docbook/en-US/pom.xml 2009-12-22 06:50:19
UTC (rev 18313)
@@ -0,0 +1,211 @@
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.jboss.project</groupId>
+ <artifactId>${docname}-${translation}</artifactId>
+ <version>1.0</version>
+ <packaging>jdocbook</packaging>
+ <name>${bookname}-(${translation})</name>
+
+ <properties>
+ <translation>en-US</translation>
+ <docname>Hibernate_Annotations_Reference_Guide</docname>
+ <bookname>Hibernate Annotations Reference Guide</bookname>
+ </properties>
+
+ <repositories>
+ <repository>
+ <id>repository.jboss.org</id>
+ <name>JBoss Repository</name>
+ <layout>default</layout>
+ <
url>http://repository.jboss.org/maven2/</url>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </repository>
+ </repositories>
+ <pluginRepositories>
+ <pluginRepository>
+ <id>repository.jboss.org</id>
+ <name>JBoss Repository</name>
+ <layout>default</layout>
+ <
url>http://repository.jboss.org/maven2/</url>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </pluginRepository>
+ </pluginRepositories>
+
+ <profiles>
+
+ <!-- mvn compile -->
+ <profile>
+ <id>all</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jboss.maven.plugins</groupId>
+ <artifactId>maven-jdocbook-plugin</artifactId>
+ <version>2.2.0</version>
+ <extensions>true</extensions>
+ <configuration>
+ <formats>
+ <format>
+ <formatName>pdf</formatName>
+ <stylesheetResource>classpath:/xslt/org/jboss/pdf.xsl</stylesheetResource>
+ <finalName>${docname}.pdf</finalName>
+ </format>
+ <format>
+ <formatName>html</formatName>
+ <stylesheetResource>classpath:/xslt/org/jboss/xhtml.xsl</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ <format>
+ <formatName>html_single</formatName>
+ <stylesheetResource>classpath:/xslt/org/jboss/xhtml-single.xsl</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ </formats>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <!-- mvn compile -Phtml -->
+ <profile>
+ <id>html</id>
+ <activation>
+ <activeByDefault>false</activeByDefault>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jboss.maven.plugins</groupId>
+ <artifactId>maven-jdocbook-plugin</artifactId>
+ <version>2.2.0</version>
+ <extensions>true</extensions>
+ <configuration>
+ <formats>
+ <format>
+ <formatName>html</formatName>
+ <stylesheetResource>classpath:/xslt/org/jboss/xhtml.xsl</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ </formats>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <!-- mvn compile -Phtml-single -->
+ <profile>
+ <id>html-single</id>
+ <activation>
+ <activeByDefault>false</activeByDefault>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jboss.maven.plugins</groupId>
+ <artifactId>maven-jdocbook-plugin</artifactId>
+ <version>2.2.0</version>
+ <extensions>true</extensions>
+ <configuration>
+ <formats>
+ <format>
+ <formatName>html_single</formatName>
+ <stylesheetResource>classpath:/xslt/org/jboss/xhtml-single.xsl</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ </formats>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <!-- mvn compile -Ppdf -->
+ <profile>
+ <id>pdf</id>
+ <activation>
+ <activeByDefault>false</activeByDefault>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jboss.maven.plugins</groupId>
+ <artifactId>maven-jdocbook-plugin</artifactId>
+ <version>2.2.0</version>
+ <extensions>true</extensions>
+ <configuration>
+ <formats>
+ <format>
+ <formatName>pdf</formatName>
+ <stylesheetResource>classpath:/xslt/org/jboss/pdf.xsl</stylesheetResource>
+ <finalName>${docname}.pdf</finalName>
+ </format>
+ </formats>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jboss.maven.plugins</groupId>
+ <artifactId>maven-jdocbook-plugin</artifactId>
+ <version>2.2.0</version>
+ <extensions>true</extensions>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jbossorg-docbook-xslt</artifactId>
+ <version>1.1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jbossorg-jdocbook-style</artifactId>
+ <version>1.1.0</version>
+ <type>jdocbook-style</type>
+ </dependency>
+ </dependencies>
+ <configuration>
+ <sourceDocumentName>${docname}.xml</sourceDocumentName>
+ <sourceDirectory>.</sourceDirectory>
+ <imageResource>
+ <directory>${translation}</directory>
+ <includes>
+ <include>images/*</include>
+ </includes>
+ </imageResource>
+ <options>
+ <xincludeSupported>true</xincludeSupported>
+ <xmlTransformerType>saxon</xmlTransformerType>
+ <!-- needed for uri-resolvers; can be ommitted if using 'current' uri
scheme -->
+ <!-- could also locate the docbook dependency and inspect its version -->
+ <docbookVersion>1.72.0</docbookVersion>
+ <transformerParameters>
+ <property>
+ <name>javax.xml.parsers.DocumentBuilderFactory</name>
+ <value>org.apache.xerces.jaxp.DocumentBuilderFactoryImpl</value>
+ </property>
+ <property>
+ <name>javax.xml.parsers.SAXParserFactory</name>
+ <value>org.apache.xerces.jaxp.SAXParserFactoryImpl</value>
+ </property>
+ </transformerParameters>
+ </options>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
+
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/es-ES/Author_Group.po
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/es-ES/Author_Group.po
(rev 0)
+++ annotations/branches/v3_4_0_GA_CP/src/main/docbook/es-ES/Author_Group.po 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,24 @@
+# translation of Author_Group.po to
+# Header entry was created by KBabel!
+#
+#. Tag: author
+#: Author_Group.xml:6
+#, no-c-format
+# Angela Garcia <agarcia(a)redhat.com>, 2009.
+msgid ""
+msgstr ""
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Last-Translator: Angela Garcia <agarcia(a)redhat.com>\n"
+"PO-Revision-Date: 2009-11-19 09:47+1000\n"
+"Project-Id-Version: Author_Group\n"
+"Language-Team: <en(a)li.org>\n"
+"X-Generator: KBabel 1.11.4\n"
+"MIME-Version: 1.0\n"
+
+#. Tag: author
+#: Author_Group.xml:6
+#, no-c-format
+msgid "<firstname>Red Hat Documentation Group</firstname>
<surname></surname>"
+msgstr ""
+
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/es-ES/Book_Info.po
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/es-ES/Book_Info.po
(rev 0)
+++ annotations/branches/v3_4_0_GA_CP/src/main/docbook/es-ES/Book_Info.po 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,44 @@
+# translation of Book_Info.po to
+# Header entry was created by KBabel!
+#
+#. Tag: title
+#: Book_Info.xml:6
+#, no-c-format
+# Angela Garcia <agarcia(a)redhat.com>, 2009.
+msgid ""
+msgstr ""
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Last-Translator: Angela Garcia <agarcia(a)redhat.com>\n"
+"PO-Revision-Date: 2009-11-19 09:48+1000\n"
+"Project-Id-Version: Book_Info\n"
+"Language-Team: <en(a)li.org>\n"
+"X-Generator: KBabel 1.11.4\n"
+"MIME-Version: 1.0\n"
+
+#. Tag: title
+#: Book_Info.xml:6
+#, no-c-format
+msgid "Hibernate Annotations Reference Guide"
+msgstr ""
+
+#. Tag: subtitle
+#: Book_Info.xml:7
+#, no-c-format
+msgid "for Use with JBoss Enterprise Application Platform 5.0"
+msgstr ""
+
+#. Tag: para
+#: Book_Info.xml:14
+#, no-c-format
+msgid ""
+"The JBoss Enterprise Application Platform Edition of the Hibernate "
+"Annotations Reference Guide"
+msgstr ""
+
+#. Tag: holder
+#: Book_Info.xml:25
+#, no-c-format
+msgid "&HOLDER;"
+msgstr ""
+
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/es-ES/Feedback.po
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/es-ES/Feedback.po
(rev 0)
+++ annotations/branches/v3_4_0_GA_CP/src/main/docbook/es-ES/Feedback.po 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,38 @@
+# translation of Feedback.po to
+# Header entry was created by KBabel!
+#
+#. Tag: title
+#: Feedback.xml:6
+#, no-c-format
+# Angela Garcia <agarcia(a)redhat.com>, 2009.
+msgid ""
+msgstr ""
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Last-Translator: Angela Garcia <agarcia(a)redhat.com>\n"
+"PO-Revision-Date: 2009-11-19 09:48+1000\n"
+"Project-Id-Version: Feedback\n"
+"Language-Team: <en(a)li.org>\n"
+"X-Generator: KBabel 1.11.4\n"
+"MIME-Version: 1.0\n"
+
+#. Tag: title
+#: Feedback.xml:6
+#, no-c-format
+msgid "Feedback"
+msgstr ""
+
+#. Tag: para
+#: Feedback.xml:7
+#, no-c-format
+msgid ""
+"If you spot a typo in this guide, or if you have thought of a way to make "
+"this manual better, we would love to hear from you! Submit a report in "
+"<ulink
url=\"http://jira.jboss.com/jira/browse/JBPAPP\">JIRA</ul... against
"
+"the Product: JBoss Enterprise Application Platform, Version: "
+"<replaceable><version></replaceable>, Component:
<emphasis>Doc</"
+"emphasis>. If you have a suggestion for improving the documentation, try to
"
+"be as specific as possible. If you have found an error, include the section "
+"number and some of the surrounding text so we can find it easily."
+msgstr ""
+
Added:
annotations/branches/v3_4_0_GA_CP/src/main/docbook/es-ES/Hibernate_Annotations_Reference_Guide.po
===================================================================
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/es-ES/Preface.po
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/es-ES/Preface.po
(rev 0)
+++ annotations/branches/v3_4_0_GA_CP/src/main/docbook/es-ES/Preface.po 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,64 @@
+# translation of Preface.po to
+# Header entry was created by KBabel!
+#
+#. Tag: title
+#: Preface.xml:2
+#, no-c-format
+# Angela Garcia <agarcia(a)redhat.com>, 2009.
+msgid ""
+msgstr ""
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Last-Translator: Angela Garcia <agarcia(a)redhat.com>\n"
+"PO-Revision-Date: 2009-11-19 09:48+1000\n"
+"Project-Id-Version: Preface\n"
+"Language-Team: <en(a)li.org>\n"
+"X-Generator: KBabel 1.11.4\n"
+"MIME-Version: 1.0\n"
+
+#. Tag: title
+#: Preface.xml:2
+#, no-c-format
+msgid "Preface"
+msgstr ""
+
+#. Tag: para
+#: Preface.xml:4
+#, no-c-format
+msgid ""
+"Hibernate, like all other object/relational mapping tools, requires metadata
"
+"that governs the transformation of data from one representation to the "
+"other. In Hibernate 2.x mapping metadata is most of the time declared in XML
"
+"text files. Alternatively XDoclet can be used utilizing Javadoc source code "
+"annotations together with a compile time preprocessor."
+msgstr ""
+
+#. Tag: para
+#: Preface.xml:11
+#, no-c-format
+msgid ""
+"The same kind of annotation support is now available in the standard JDK, "
+"although more powerful and with better tools support. IntelliJ IDEA and "
+"Eclipse for example, support auto-completion and syntax highlighting of JDK "
+"5.0 annotations which are compiled into the bytecode and read at runtime "
+"using reflection. No external XML files are needed."
+msgstr ""
+
+#. Tag: para
+#: Preface.xml:17
+#, no-c-format
+msgid ""
+"The EJB3 specification recognizes the interest and the success of the "
+"transparent object/relational mapping paradigm. It standardizes the basic "
+"APIs and the metadata needed for any object/relational persistence "
+"mechanism. <emphasis>Hibernate EntityManager</emphasis> implements the
"
+"programming interfaces and lifecycle rules as defined by the EJB3 "
+"persistence specification and together with <emphasis>Hibernate
Annotations</"
+"emphasis> offers a complete (and standalone) EJB3 persistence solution on
"
+"top of the mature Hibernate core. You may use a combination of all three "
+"together, annotations without EJB3 programming interfaces and lifecycle, or "
+"even pure native Hibernate, depending on the business and technical needs of
"
+"your project. At all times you cann fall back to Hibernate native APIs, or "
+"if required, even to native JDBC and SQL."
+msgstr ""
+
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/es-ES/Revision_History.po
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/es-ES/Revision_History.po
(rev 0)
+++
annotations/branches/v3_4_0_GA_CP/src/main/docbook/es-ES/Revision_History.po 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,40 @@
+# translation of Revision_History.po to
+# Header entry was created by KBabel!
+#
+#. Tag: title
+#: Revision_History.xml:6
+#, no-c-format
+# Angela Garcia <agarcia(a)redhat.com>, 2009.
+msgid ""
+msgstr ""
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Last-Translator: Angela Garcia <agarcia(a)redhat.com>\n"
+"PO-Revision-Date: 2009-11-20 07:32+1000\n"
+"Project-Id-Version: Revision_History\n"
+"Language-Team: <en(a)li.org>\n"
+"X-Generator: KBabel 1.11.4\n"
+"MIME-Version: 1.0\n"
+
+#. Tag: title
+#: Revision_History.xml:6
+#, no-c-format
+msgid "Revision History"
+msgstr "Historial de revisiones"
+
+#. Tag: author
+#: Revision_History.xml:12
+#, no-c-format
+msgid ""
+"<firstname>Laura</firstname> <surname>Bailey</surname>
<email>lbailey(a)redhat."
+"com</email>"
+msgstr ""
+"<firstname>Laura</firstname> <surname>Bailey</surname>
<email>lbailey(a)redhat."
+"com</email>"
+
+#. Tag: member
+#: Revision_History.xml:19
+#, no-c-format
+msgid "Initial draft."
+msgstr "Borrador inicial"
+
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/es-ES/additionalmodules.po
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/es-ES/additionalmodules.po
(rev 0)
+++
annotations/branches/v3_4_0_GA_CP/src/main/docbook/es-ES/additionalmodules.po 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,194 @@
+# translation of additionalmodules.po to
+# Header entry was created by KBabel!
+#
+#. Tag: title
+#: additionalmodules.xml:28
+#, no-c-format
+# Angela Garcia <agarcia(a)redhat.com>, 2009.
+msgid ""
+msgstr ""
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Last-Translator: Angela Garcia <agarcia(a)redhat.com>\n"
+"PO-Revision-Date: 2009-11-19 15:27+1000\n"
+"Project-Id-Version: additionalmodules\n"
+"Language-Team: <en(a)li.org>\n"
+"X-Generator: KBabel 1.11.4\n"
+"MIME-Version: 1.0\n"
+
+#. Tag: title
+#: additionalmodules.xml:28
+#, no-c-format
+msgid "Additional modules"
+msgstr "Módulos adicionales"
+
+#. Tag: para
+#: additionalmodules.xml:30
+#, no-c-format
+msgid ""
+"Hibernate Annotations mainly focus on persistence metadata. The project also
"
+"have a nice integration with two Hibernate modules."
+msgstr ""
+
+#. Tag: title
+#: additionalmodules.xml:34
+#, no-c-format
+msgid "Hibernate Validator"
+msgstr ""
+
+#. Tag: title
+#: additionalmodules.xml:37 additionalmodules.xml:117
+#, no-c-format
+msgid "Description"
+msgstr "Descripción"
+
+#. Tag: para
+#: additionalmodules.xml:39
+#, no-c-format
+msgid ""
+"Annotations are a very convenient and elegant way to specify invariant "
+"constraints for a domain model. You can, for example, express that a "
+"property should never be null, that the account balance should be strictly "
+"positive, etc. These domain model constraints are declared in the bean "
+"itself by annotating its properties. A validator can then read them and "
+"check for constraint violations. The validation mechanism can be executed in
"
+"different layers in your application without having to duplicate any of "
+"these rules (presentation layer, data access layer). Following the DRY "
+"principle, Hibernate Validator has been designed for that purpose."
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:50
+#, no-c-format
+msgid ""
+"Hibernate Validator works at two levels. First, it is able to check in-"
+"memory instances of a class for constraint violations. Second, it can apply "
+"the constraints to the Hibernate metamodel and incorporate them into the "
+"generated database schema."
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:55
+#, no-c-format
+msgid ""
+"Each constraint annotation is associated to a validator implementation "
+"responsible for checking the constraint on the entity instance. A validator "
+"can also (optionally) apply the constraint to the Hibernate metamodel, "
+"allowing Hibernate to generate DDL that expresses the constraint. With the "
+"appropriate event listener, you can execute the checking operation on "
+"inserts and updates done by Hibernate. Hibernate Validator is not limited to
"
+"use with Hibernate. You can easily use it anywhere in your application."
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:64
+#, no-c-format
+msgid ""
+"When checking instances at runtime, Hibernate Validator returns information "
+"about constraint violations in an array of
<classname>InvalidValue</"
+"classname> s. Among other information, the
<classname>InvalidValue</"
+"classname> contains an error description message that can embed the "
+"parameter values bundle with the annotation (eg. length limit), and message "
+"strings that may be externalized to a
<classname>ResourceBundle</classname> ."
+msgstr ""
+
+#. Tag: title
+#: additionalmodules.xml:74 additionalmodules.xml:132
+#, no-c-format
+msgid "Integration with Hibernate Annotations"
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:76
+#, no-c-format
+msgid ""
+"If Hibernate Validator (<filename>hibernate-validator.jar</filename>)
is "
+"available in the classpath, Hibernate Annotations will integrate in two
ways:"
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:82
+#, no-c-format
+msgid ""
+"Constraints will be applied to the Data Definition Language. In other words,
"
+"the database schema will reflect the constraints (provided that you use the "
+"hbm2ddl tool)."
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:88
+#, no-c-format
+msgid ""
+"Before an entity change is applied to the database (insert or update), the "
+"entity is validated. Validation errors, if any, will be carried over through
"
+"an <classname>InvalidStateException</classname>."
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:95
+#, no-c-format
+msgid "For entities free of validation rules, the runtime performance cost is
null."
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:98
+#, no-c-format
+msgid ""
+"To disable constraint propagation to DDL, set up <literal>hibernate."
+"validator.apply_to_ddl</literal> to false in the configuration file. Such a
"
+"need is very uncommon and not recommended."
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:103
+#, no-c-format
+msgid ""
+"To disable pre-entity change validation, set up
<literal>hibernate.validator."
+"autoregister_listeners</literal> to false in the configuration file. Such a
"
+"need is very uncommon and not recommended."
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:108
+#, no-c-format
+msgid "Check the Hibernate Validator reference documentation for more
information."
+msgstr ""
+
+#. Tag: title
+#: additionalmodules.xml:114
+#, no-c-format
+msgid "Hibernate Search"
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:119
+#, no-c-format
+msgid ""
+"Full text search engines like <productname>Apache Lucene</productname>
are a "
+"very powerful technology to bring free text/efficient queries to "
+"applications. If suffers several mismatches when dealing with a object "
+"domain model (keeping the index up to date, mismatch between the index "
+"structure and the domain model, querying mismatch...) Hibernate Search "
+"indexes your domain model thanks to a few annotations, takes care of the "
+"database / index synchronization and brings you back regular managed objects
"
+"from free text queries. Hibernate Search is using <ulink
url=\"http://lucene."
+"apache.org\">Apache Lucene</ulink> under the cover."
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:134
+#, no-c-format
+msgid ""
+"Hibernate Search integrates with Hibernate Annotations transparently "
+"provided that hibernate-search.jar is present in the classpath. If you do "
+"not wish to automatically register Hibernate Search event listeners, you can
"
+"set <literal>hibernate.search.autoregister_listeners</literal> to
false. "
+"Such a need is very uncommon and not recommended."
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:141
+#, no-c-format
+msgid "Check the Hibernate Search reference documentation for more
information."
+msgstr ""
+
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/es-ES/entity.po
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/es-ES/entity.po
(rev 0)
+++ annotations/branches/v3_4_0_GA_CP/src/main/docbook/es-ES/entity.po 2009-12-22 06:50:19
UTC (rev 18313)
@@ -0,0 +1,7128 @@
+# translation of entity.po to
+# Header entry was created by KBabel!
+#
+#. Tag: title
+#: entity.xml:28
+#, no-c-format
+# Angela Garcia <agarcia(a)redhat.com>, 2009.
+msgid ""
+msgstr ""
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Last-Translator: Angela Garcia <agarcia(a)redhat.com>\n"
+"PO-Revision-Date: 2009-11-24 19:57+1000\n"
+"Project-Id-Version: entity\n"
+"Language-Team: <en(a)li.org>\n"
+"X-Generator: KBabel 1.11.4\n"
+"MIME-Version: 1.0\n"
+
+#. Tag: title
+#: entity.xml:28
+#, no-c-format
+msgid "Entity Beans"
+msgstr "Beans de entidad"
+
+#. Tag: title
+#: entity.xml:31
+#, no-c-format
+msgid "Intro"
+msgstr "Introducción"
+
+#. Tag: para
+#: entity.xml:33
+#, no-c-format
+msgid ""
+"This section covers EJB 3.0 (aka Java Persistence) entity annotations and "
+"Hibernate-specific extensions."
+msgstr "Esta sección aborda las anotaciones de entidad EJB 3.0 (tambien conocidas
como persistencia Java) y las extensiones especificas de Hibernate."
+
+#. Tag: title
+#: entity.xml:38
+#, no-c-format
+msgid "Mapping with EJB3/JPA Annotations"
+msgstr "Mapeo con anotaciones EJB3/JPA"
+
+#. Tag: para
+#: entity.xml:40
+#, no-c-format
+msgid ""
+"EJB3 entities are plain POJOs. Actually they represent the exact same "
+"concept as the Hibernate persistent entities. Their mappings are defined "
+"through JDK 5.0 annotations (an XML descriptor syntax for overriding is "
+"defined in the EJB3 specification). Annotations can be split in two "
+"categories, the logical mapping annotations (allowing you to describe the "
+"object model, the class associations, etc.) and the physical mapping "
+"annotations (describing the physical schema, tables, columns, indexes, etc).
"
+"We will mix annotations from both categories in the following code examples."
+msgstr ""
+"Las entidades EJB3 son simples POJOs. De hecho, representan exactamente el mismo
concepto que las entidades de persistencia de Hibernate. Sus mapeos se definen por medio
de anotaciones JDK 5.0 (la sintaxis del descriptor XML para sobreescribir se define en la
especificación EJB3). Las anotaciones se pueden dividir en dos categorias, las anotaciones
de mapeo lógico (le permiten describir el modelo del objeto, las asociaciones de clase,
etc.) y las anotaciones de mapeo fÃsico (describen el esquema fÃsico, las tablas, las
columnas, los Ãndices, etc). "
+"En los siguientes ejemplos de código vamos a mezclar anotaciones de ambas
categorias."
+
+#. Tag: para
+#: entity.xml:50
+#, no-c-format
+msgid ""
+"EJB3 annotations are in the <literal>javax.persistence.*</literal>
package. "
+"Most JDK 5 compliant IDE (like Eclipse, IntelliJ IDEA and Netbeans) can "
+"autocomplete annotation interfaces and attributes for you (even without a "
+"specific \"EJB3\" module, since EJB3 annotations are plain JDK 5 "
+"annotations)."
+msgstr ""
+"Las anotaciones EJB3 se encuentran en el paquete
<literal>javax.persistence.*</literal>. "
+"La mayorÃa de JDK 5 que cumple con IDE (como Eclipse, IntelliJ IDEA y Netbeans)
puede autocompletar interfaces de anotaciones y atributos por usted (incluso sin un módulo
especifico \"EJB3\", ya que las anotaciones EJB3 son simples anotaciones JDK
5)."
+
+#. Tag: para
+#: entity.xml:56
+#, no-c-format
+msgid ""
+"For more and runnable concrete examples read the JBoss EJB 3.0 tutorial or "
+"review the Hibernate Annotations test suite. Most of the unit tests have "
+"been designed to represent a concrete example and be a inspiration source."
+msgstr "Para obtener más ejemplos concretos ejecutables consulte el tutorial JBoss
EJB 3.0 o revise la suite de test de Hibernate Annotations. La mayorÃa de los tests de
unidad han sido diseñados para representar un ejemplo en concreto y para ser una fuente de
inspiración."
+
+#. Tag: title
+#: entity.xml:62
+#, no-c-format
+msgid "Declaring an entity bean"
+msgstr "Declaración de un bean de entidad"
+
+#. Tag: para
+#: entity.xml:64
+#, no-c-format
+msgid ""
+"Every bound persistent POJO class is an entity bean and is declared using "
+"the <literal>@Entity</literal> annotation (at the class level):"
+msgstr "Toda clase POJO persistente enlazada es un bean de entidad y se declara
usando la anotación <literal>@Entity</literal> (a nivel de clase):"
+
+#. Tag: programlisting
+#: entity.xml:68
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Flight implements Serializable {\n"
+" Long id;\n"
+"\n"
+" @Id\n"
+" public Long getId() { return id; }\n"
+"\n"
+" public void setId(Long id) { this.id = id; }\n"
+"}"
+msgstr ""
+"@Entity\n"
+"public class Flight implements Serializable {\n"
+" Long id;\n"
+"\n"
+" @Id\n"
+" public Long getId() { return id; }\n"
+"\n"
+" public void setId(Long id) { this.id = id; }\n"
+"}"
+
+#. Tag: para
+#: entity.xml:70
+#, no-c-format
+msgid ""
+"<literal>@Entity</literal> declares the class as an entity bean (i.e. a
"
+"persistent POJO class), <literal>@Id</literal> declares the identifier
"
+"property of this entity bean. The other mapping declarations are implicit. "
+"This configuration by exception concept is central to the new EJB3 "
+"specification and a major improvement. The class Flight is mapped to the "
+"Flight table, using the column id as its primary key column."
+msgstr "<literal>@Entity</literal> declara la clase como un bean de
entidad (es decir, una clase POJO persistente), <literal>@Id</literal> declara
la propiedad del identificador de este bean de entidad. Las otras declaraciones de mapeo
son implÃcitas. Esta configuración por concepto de excepción es central a la nueva
especificación EJB3 y es una mejora importante. La clase Flight se mapea a la tabla
Flight, usando el id de columna como su columna de clave principal."
+
+#. Tag: para
+#: entity.xml:78
+#, no-c-format
+msgid ""
+"Depending on whether you annotate fields or methods, the access type used by
"
+"Hibernate will be <literal>field</literal> or
<literal>property</literal>. "
+"The EJB3 spec requires that you declare annotations on the element type that
"
+"will be accessed, i.e. the getter method if you use
<literal>property</"
+"literal> access, the field if you use <literal>field</literal>
access. "
+"Mixing EJB3 annotations in both fields and methods should be avoided. "
+"Hibernate will guess the access type from the position of
<literal>@Id</"
+"literal> or <literal>(a)EmbeddedId</literal>."
+msgstr ""
+"Dependiendo de si anota campos o métodos, el tipo de acceso que Hibernate utilizará
será <literal>field</literal> o <literal>property</literal>.
"
+"La especificación EJB3 requiere que declare anotaciones en el tipo de elemento al
que se accederá, es decir el método getter si usa el acceso
<literal>property</"
+"literal>, el campo si utiliza el acceso <literal>field</literal>. Se
debe evitar el mezclar las anotaciones EJB3 en ambos campos y métodos. "
+"Hibernate advinará el tipo de acceso de la posición de
<literal>@Id</"
+"literal> o <literal>(a)EmbeddedId</literal>."
+
+#. Tag: title
+#: entity.xml:89
+#, no-c-format
+msgid "Defining the table"
+msgstr "Definición de la tabla"
+
+#. Tag: para
+#: entity.xml:91
+#, no-c-format
+msgid ""
+"<literal>@Table</literal> is set at the class level; it allows you to
define "
+"the table, catalog, and schema names for your entity bean mapping. If no "
+"<literal>@Table</literal> is defined the default values are used: the
"
+"unqualified class name of the entity."
+msgstr "<literal>@Table</literal> se configura a nivel de clase; le
permite definir la tabla, el catálogo y los nombres del esquema para su mapeo de bean de
entidad. Si no se define un <literal>@Table</literal> entonces se utilizan los
valores predeterminados: el nombre de la clase no calificada de la entidad."
+
+#. Tag: programlisting
+#: entity.xml:96
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Table(name=\"tbl_sky\")\n"
+"public class Sky implements Serializable {\n"
+"..."
+msgstr ""
+"@Entity\n"
+"@Table(name=\"tbl_sky\")\n"
+"public class Sky implements Serializable {\n"
+"..."
+
+#. Tag: para
+#: entity.xml:98
+#, no-c-format
+msgid ""
+"The <literal>@Table</literal> element also contains a
<literal>schema</"
+"literal> and a <literal>catalog</literal> attributes, if they need
to be "
+"defined. You can also define unique constraints to the table using the "
+"<literal>@UniqueConstraint</literal> annotation in conjunction with
"
+"<literal>@Table</literal> (for a unique constraint bound to a single
column, "
+"refer to <literal>(a)Column</literal>)."
+msgstr ""
+"El elemento <literal>@Table</literal> también contiene unos atributos
<literal>schema</"
+"literal> y <literal>catalog</literal>, si es necesario definirlos.
También puede definir restricciones únicas en la tabla usando la anotación
<literal>@UniqueConstraint</literal> junto con
<literal>@Table</literal> (para un enlace de restricción única a una sola
columna, consulte <literal>(a)Column</literal>)."
+
+#. Tag: programlisting
+#: entity.xml:105
+#, no-c-format
+msgid ""
+"@Table(name=\"tbl_sky\",\n"
+" <emphasis role=\"bold\">uniqueConstraints =
{@UniqueConstraint"
+"(columnNames={\"month\", \"day\"})}</emphasis>\n"
+")"
+msgstr ""
+"@Table(name=\"tbl_sky\",\n"
+" <emphasis role=\"bold\">uniqueConstraints =
{@UniqueConstraint"
+"(columnNames={\"month\", \"day\"})}</emphasis>\n"
+")"
+
+#. Tag: para
+#: entity.xml:107
+#, no-c-format
+msgid ""
+"A unique constraint is applied to the tuple month, day. Note that the "
+"<literal>columnNames</literal> array refers to the logical column
names."
+msgstr "Se aplica una restricción única al tuple mes, dÃa. Observe que la lista
<literal>columnNames</literal> se refiere a los nombres de columnas
lógicas."
+
+#. Tag: remark
+#: entity.xml:111
+#, no-c-format
+msgid ""
+"The logical column name is defined by the Hibernate NamingStrategy "
+"implementation. The default EJB3 naming strategy use the physical column "
+"name as the logical column name. Note that this may be different than the "
+"property name (if the column name is explicit). Unless you override the "
+"NamingStrategy, you shouldn't worry about that."
+msgstr ""
+"La implementación NamingStrategy de Hibernate define el nombre de la columna
lógica. La estrategia predeterminada de nombrado EJB3 usa el nombre de la columna fÃsica
como el nombre de columna lógica. Observe que esto puede ser diferente del nombre de
propiedad (si el nombre de la columna es explÃcito). A menos de que sobreescriba la
"
+"NamingStrategy, no se debe preocupar de esto."
+
+#. Tag: title
+#: entity.xml:120
+#, no-c-format
+msgid "Versioning for optimistic locking"
+msgstr "Control de versiones para el bloqueo optimista"
+
+#. Tag: para
+#: entity.xml:122
+#, no-c-format
+msgid ""
+"You can add optimistic locking capability to an entity bean using the "
+"<literal>@Version</literal> annotation:"
+msgstr "Puede agregar la funcionalidad del bloqueo optimista a un bean de entidad
usando la anotación <literal>@Version</literal>:"
+
+#. Tag: programlisting
+#: entity.xml:125
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Flight implements Serializable {\n"
+"...\n"
+" @Version\n"
+" @Column(name=\"OPTLOCK\")\n"
+" public Integer getVersion() { ... }\n"
+"}"
+msgstr ""
+"@Entity\n"
+"public class Flight implements Serializable {\n"
+"...\n"
+" @Version\n"
+" @Column(name=\"OPTLOCK\")\n"
+" public Integer getVersion() { ... }\n"
+"}"
+
+#. Tag: para
+#: entity.xml:127
+#, no-c-format
+msgid ""
+"The version property will be mapped to the <literal>OPTLOCK</literal>
"
+"column, and the entity manager will use it to detect conflicting updates "
+"(preventing lost updates you might otherwise see with the last-commit-wins "
+"strategy)."
+msgstr "La propiedad versión se mapeará a la columna
<literal>OPTLOCK</literal> y el administrador de entidades la utilizará para
detectar actualizaciones en conflicto (previniendo la pérdida de actualizaciones que de
otra manera podrÃa ver con la estrategia del último que guarda los cambios gana)."
+
+#. Tag: para
+#: entity.xml:132
+#, no-c-format
+msgid ""
+"The version column may be a numeric (the recommended solution) or a "
+"timestamp as per the EJB3 spec. Hibernate support any kind of type provided "
+"that you define and implement the appropriate
<classname>UserVersionType</"
+"classname>."
+msgstr ""
+"La columna versión puede ser numérica (esta es la solución recomendada) o un sello
de fecha deacuerdo a las especificaciones EJB3. Hibernate soporta cualquier clase de tipo
dado que defina e implemente el <classname>UserVersionType</"
+"classname> apropiado."
+
+#. Tag: para
+#: entity.xml:137
+#, no-c-format
+msgid ""
+"The application must not alter the version number set up by Hibernate in any
"
+"way. To artificially increase the version number, check in Hibernate Entity "
+"Manager's reference documentation
<literal>LockMode.WRITE</literal>"
+msgstr "La aplicación no debe alterar de ninguna manera el número de la versión que
Hibernate configuró. Para incrementar artificialmente el número de la versión, conculte la
documentación de referencia del administrador de entidades de Hibernate
<literal>LockMode.WRITE</literal>"
+
+#. Tag: title
+#: entity.xml:145
+#, no-c-format
+msgid "Mapping simple properties"
+msgstr "Mapeo de propiedades simples"
+
+#. Tag: title
+#: entity.xml:148
+#, no-c-format
+msgid "Declaring basic property mappings"
+msgstr "Declaración de mapeos de propiedades básicas"
+
+#. Tag: para
+#: entity.xml:150
+#, no-c-format
+msgid ""
+"Every non static non transient property (field or method) of an entity bean "
+"is considered persistent, unless you annotate it as
<literal>@Transient</"
+"literal>. Not having an annotation for your property is equivalent to the
"
+"appropriate <literal>@Basic</literal> annotation. The
<literal>@Basic</"
+"literal> annotation allows you to declare the fetching strategy for a "
+"property:"
+msgstr ""
+"Toda propiedad no estática y no transitoria (campo o método) de un bean de entidad
se considera como persistente, a menos de que la anote como
<literal>@Transient</"
+"literal>. El no tener una anotación para su propiedad es equivalente a la
anotación <literal>@Basic</literal> apropiada. La anotación
<literal>@Basic</"
+"literal> le permite declarar la estrategia de búsqueda para una
propiedad:"
+
+#. Tag: programlisting
+#: entity.xml:157
+#, no-c-format
+msgid ""
+"public transient int counter; //transient property\n"
+"\n"
+"private String firstname; //persistent property\n"
+"\n"
+"@Transient\n"
+"String getLengthInMeter() { ... } //transient property\n"
+"\n"
+"String getName() {... } // persistent property\n"
+"\n"
+"@Basic\n"
+"int getLength() { ... } // persistent property\n"
+"\n"
+"@Basic(fetch = FetchType.LAZY)\n"
+"String getDetailedComment() { ... } // persistent property\n"
+"\n"
+"(a)Temporal(TemporalType.TIME)\n"
+"java.util.Date getDepartureTime() { ... } // persistent property
\n"
+"\n"
+"(a)Enumerated(EnumType.STRING)\n"
+"Starred getNote() { ... } //enum persisted as String in database"
+msgstr ""
+"public transient int counter; //transient property\n"
+"\n"
+"private String firstname; //persistent property\n"
+"\n"
+"@Transient\n"
+"String getLengthInMeter() { ... } //transient property\n"
+"\n"
+"String getName() {... } // persistent property\n"
+"\n"
+"@Basic\n"
+"int getLength() { ... } // persistent property\n"
+"\n"
+"@Basic(fetch = FetchType.LAZY)\n"
+"String getDetailedComment() { ... } // persistent property\n"
+"\n"
+"(a)Temporal(TemporalType.TIME)\n"
+"java.util.Date getDepartureTime() { ... } // persistent property
\n"
+"\n"
+"(a)Enumerated(EnumType.STRING)\n"
+"Starred getNote() { ... } //enum persisted as String in database"
+
+#. Tag: para
+#: entity.xml:159
+#, no-c-format
+msgid ""
+"<literal>counter</literal>, a transient field, and
<literal>lengthInMeter</"
+"literal>, a method annotated as <literal>@Transient</literal>, and
will be "
+"ignored by the entity manager. <literal>name</literal>,
<literal>length</"
+"literal>, and <literal>firstname</literal> properties are mapped
persistent "
+"and eagerly fetched (the default for simple properties). The "
+"<literal>detailedComment</literal> property value will be lazily
fetched "
+"from the database once a lazy property of the entity is accessed for the "
+"first time. Usually you don't need to lazy simple properties (not to be "
+"confused with lazy association fetching)."
+msgstr ""
+"<literal>counter</literal>, un campo transitorio y
<literal>lengthInMeter</"
+"literal>, un método anotado como <literal>@Transient</literal> y
será ignorado por el administrador de entidades. Las propiedades
<literal>name</literal>, <literal>length</"
+"literal> y <literal>firstname</literal> se mapean persistentemente y
se buscan de manera temprana (lo predeterminado para propiedades simples). El valor de la
propiedad <literal>detailedComment</literal> se buscará perezosamente desde la
base de datos una vez que una propiedad perezosa de la entidad se acceda por primera vez.
Usualmente no es necesario buscar perezosamente propiedades simples (no confundirlo con la
bñusuqeda de asociaciones perezosas)."
+
+#. Tag: para
+#: entity.xml:171
+#, no-c-format
+msgid ""
+"To enable property level lazy fetching, your classes have to be "
+"instrumented: bytecode is added to the original one to enable such feature, "
+"please refer to the Hibernate reference documentation. If your classes are "
+"not instrumented, property level lazy loading is silently ignored."
+msgstr "Para habilitar la búsqueda perezosa a nivel de propiedad, sus clases tienen
que estar instrumentadas: el código byte se agrega al original para habilitar dicha
funcionalidad, por favor consulte la documentación de referencia de Hibernate. Si sus
clases no están instrumentadas, la carga perezosa a nivel de propiedad se ignora
silenciosamente."
+
+#. Tag: para
+#: entity.xml:178
+#, no-c-format
+msgid ""
+"The recommended alternative is to use the projection capability of EJB-QL or
"
+"Criteria queries."
+msgstr "La opción recomendada es utilizar la funcionalidad de proyección de EJB-QL o
las consultas Criteria."
+
+#. Tag: para
+#: entity.xml:181
+#, no-c-format
+msgid ""
+"EJB3 support property mapping of all basic types supported by Hibernate (all
"
+"basic Java types , their respective wrappers and serializable classes). "
+"Hibernate Annotations support out of the box Enum type mapping either into a
"
+"ordinal column (saving the enum ordinal) or a string based column (saving "
+"the enum string representation): the persistence representation, defaulted "
+"to ordinal, can be overriden through the <literal>@Enumerated</literal>
"
+"annotation as shown in the <literal>note</literal> property
example."
+msgstr ""
+"Mapeo de propiedades de soporte EJB3 de todos los tipos básicos soportados por
Hibernate (todos los tipos Java básicos , sus wrappers respectivos y las clases
serializables). "
+"Hibernate Annotations soportan el mapeo de tipo Enum ya sea en una columna ordinal
(guardando el enum ordinal) o una columna basada en cadenas (guardando la representación
en cadena enum): la representación de persistencia, por defecto ordinal, se puede
sobreescribir por medio de la anotación <literal>@Enumerated</literal> como se
puede ver en el ejemplo de la propiedad <literal>note</literal>."
+
+#. Tag: para
+#: entity.xml:190
+#, no-c-format
+msgid ""
+"In core Java APIs, the temporal precision is not defined. When dealing with "
+"temporal data you might want to describe the expected precision in database.
"
+"Temporal data can have <literal>DATE</literal>,
<literal>TIME</literal>, or "
+"<literal>TIMESTAMP</literal> precision (ie the actual date, only the
time, "
+"or both). Use the <literal>@Temporal</literal> annotation to fine tune
that."
+msgstr "En APIs Java centrales, la precisión temporar no está definida. Al tratar
con datos temporales puede que quiera describir la precisión esperada en la base de datos.
Los datos temporales pueden tener una presición de <literal>DATE</literal>,
<literal>TIME</literal> o <literal>TIMESTAMP</literal> (es decir,
le fecha real, solo la hora o ambos). Use la anotación
<literal>@Temporal</literal> para afinar eso."
+
+#. Tag: para
+#: entity.xml:197
+#, no-c-format
+msgid ""
+"<literal>@Lob</literal> indicates that the property should be persisted
in a "
+"Blob or a Clob depending on the property type:
<classname>java.sql.Clob</"
+"classname>, <classname>Character[]</classname>,
<classname>char[]</"
+"classname> and java.lang.<classname>String</classname> will be
persisted in "
+"a Clob. <classname>java.sql.Blob</classname>,
<classname>Byte[]</classname>, "
+"<classname>byte[] </classname>and serializable type will be persisted
in a "
+"Blob."
+msgstr ""
+"<literal>@Lob</literal> indica que la propiedad se debe persistir en un
Blob o en un Clob dependiendo del tipo de propiedad:
<classname>java.sql.Clob</"
+"classname>, <classname>Character[]</classname>,
<classname>char[]</"
+"classname> y java.lang.<classname>String</classname> serán
persistidos en un Clob. <classname>java.sql.Blob</classname>,
<classname>Byte[]</classname>, "
+"<classname>byte[] </classname> y el tipo serializable serán persistidos
en un Blob."
+
+#. Tag: programlisting
+#: entity.xml:206
+#, no-c-format
+msgid ""
+"@Lob\n"
+"public String getFullText() {\n"
+" return fullText;\n"
+"}\n"
+"\n"
+"@Lob \n"
+"public byte[] getFullCode() {\n"
+" return fullCode;\n"
+"}"
+msgstr ""
+"@Lob\n"
+"public String getFullText() {\n"
+" return fullText;\n"
+"}\n"
+"\n"
+"@Lob \n"
+"public byte[] getFullCode() {\n"
+" return fullCode;\n"
+"}"
+
+#. Tag: para
+#: entity.xml:208
+#, no-c-format
+msgid ""
+"If the property type implements
<classname>java.io.Serializable</classname> "
+"and is not a basic type, and if the property is not annotated with "
+"<literal>@Lob</literal>, then the Hibernate
<literal>serializable</literal> "
+"type is used."
+msgstr ""
+"Si el tipo de propiedad implementa
<classname>java.io.Serializable</classname> "
+"y no es un tipo básico y si la propiedad no está anotada con
<literal>@Lob</literal> entonces se utiliza el tipo
<literal>serializable</literal> de Hibernate."
+
+#. Tag: title
+#: entity.xml:216
+#, no-c-format
+msgid "Declaring column attributes"
+msgstr "Declaración de atributos de columna"
+
+#. Tag: para
+#: entity.xml:218
+#, no-c-format
+msgid ""
+"The column(s) used for a property mapping can be defined using the "
+"<literal>@Column</literal> annotation. Use it to override default
values "
+"(see the EJB3 specification for more information on the defaults). You can "
+"use this annotation at the property level for properties that are:"
+msgstr ""
+"La(s) columna(s) utilizadas para un mapeo de propiedad se pueden definir usando la
anotación "
+"<literal>@Column</literal>. UtilÃcelo para sobreescribir los valores
predeterminados "
+"(consulte la especificación EJB3 para obtener mayor información sobre los valores
predetermiandos). Puede utilizar esta anotación a nivel de la propiedad para las
propiedades que son:"
+
+#. Tag: para
+#: entity.xml:226
+#, no-c-format
+msgid "not annotated at all"
+msgstr "no tienen ninguna anotación"
+
+#. Tag: para
+#: entity.xml:230
+#, no-c-format
+msgid "annotated with <literal>@Basic</literal>"
+msgstr "tienen una anotación <literal>@Basic</literal>"
+
+#. Tag: para
+#: entity.xml:234
+#, no-c-format
+msgid "annotated with <literal>@Version</literal>"
+msgstr "tienen una anotación <literal>@Version</literal>"
+
+#. Tag: para
+#: entity.xml:238
+#, no-c-format
+msgid "annotated with <literal>@Lob</literal>"
+msgstr "tienen una anotación <literal>@Lob</literal>"
+
+#. Tag: para
+#: entity.xml:242
+#, no-c-format
+msgid "annotated with <literal>@Temporal</literal>"
+msgstr "tienen una anotación <literal>@Temporal</literal>"
+
+#. Tag: para
+#: entity.xml:246
+#, no-c-format
+msgid ""
+"annotated with
<literal>(a)org.hibernate.annotations.CollectionOfElements</"
+"literal> (for Hibernate only)"
+msgstr ""
+"tienen una anotación
<literal>(a)org.hibernate.annotations.CollectionOfElements</"
+"literal> (para Hibernate sólamente)"
+
+#. Tag: programlisting
+#: entity.xml:252
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Flight implements Serializable {\n"
+"...\n"
+"@Column(updatable = false, name = \"flight_name\", nullable = false,
"
+"length=50)\n"
+"public String getName() { ... }"
+msgstr ""
+"@Entity\n"
+"public class Flight implements Serializable {\n"
+"...\n"
+"@Column(updatable = false, name = \"flight_name\", nullable = false,
"
+"length=50)\n"
+"public String getName() { ... }"
+
+#. Tag: para
+#: entity.xml:254
+#, no-c-format
+msgid ""
+"The <literal>name</literal> property is mapped to the
<literal>flight_name</"
+"literal> column, which is not nullable, has a length of 50 and is not "
+"updatable (making the property immutable)."
+msgstr ""
+"La propiedad <literal>name</literal> se mapea a la columna
<literal>flight_name</"
+"literal>, la cual es no nulable, tiene una longitud de 50 y no se puede
actualizar (lo que hace la propiedad inmutable)."
+
+#. Tag: para
+#: entity.xml:259
+#, no-c-format
+msgid ""
+"This annotation can be applied to regular properties as well as "
+"<literal>@Id</literal> or <literal>@Version</literal>
properties."
+msgstr "Esta anotación se puede aplicar a las propiedades regulares asà como a las
propiedades <literal>@Id</literal> o
<literal>(a)Version</literal>."
+
+#. Tag: programlisting
+#: entity.xml:286
+#, no-c-format
+msgid ""
+"@Column(\n"
+" name=\"columnName\";\n"
+" boolean unique() default false;\n"
+" boolean nullable() default true;\n"
+" boolean insertable() default true;\n"
+" boolean updatable() default true;\n"
+" String columnDefinition() default \"\";\n"
+" String table() default \"\";\n"
+" int length() default 255;\n"
+" int precision() default 0; // decimal precision\n"
+" int scale() default 0; // decimal scale"
+msgstr ""
+"@Column(\n"
+" name=\"columnName\";\n"
+" boolean unique() default false;\n"
+" boolean nullable() default true;\n"
+" boolean insertable() default true;\n"
+" boolean updatable() default true;\n"
+" String columnDefinition() default \"\";\n"
+" String table() default \"\";\n"
+" int length() default 255;\n"
+" int precision() default 0; // decimal precision\n"
+" int scale() default 0; // decimal scale"
+
+#. Tag: para
+#: entity.xml:290
+#, no-c-format
+msgid ""
+"<literal>name</literal> (optional): the column name (default to the
property "
+"name)"
+msgstr "<literal>name</literal> (opcional): el nombre de la columna (por
defecto es el nombre de la propiedad)"
+
+#. Tag: para
+#: entity.xml:295
+#, no-c-format
+msgid ""
+"<literal>unique</literal> (optional): set a unique constraint on this
column "
+"or not (default false)"
+msgstr "<literal>unique</literal> (opcional): establece una restricción
única en esta columna o no (por defecto es falso)"
+
+#. Tag: para
+#: entity.xml:300
+#, no-c-format
+msgid ""
+"<literal>nullable</literal> (optional): set the column as nullable
(default "
+"true)."
+msgstr "<literal>nullable</literal> (opcional): establece la columna
como nulable (por defecto es verdadero)."
+
+#. Tag: para
+#: entity.xml:305
+#, no-c-format
+msgid ""
+"<literal>insertable</literal> (optional): whether or not the column
will be "
+"part of the insert statement (default true)"
+msgstr "<literal>insertable</literal> (opcional): si la columna será
parte o no de la declaración insert (por defecto es verdadero)"
+
+#. Tag: para
+#: entity.xml:311
+#, no-c-format
+msgid ""
+"<literal>updatable</literal> (optional): whether or not the column will
be "
+"part of the update statement (default true)"
+msgstr "<literal>updatable</literal> (opcional): si la columna será o no
parte de la declaración update (por defecto es verdadero)"
+
+#. Tag: para
+#: entity.xml:317
+#, no-c-format
+msgid ""
+"<literal>columnDefinition</literal> (optional): override the sql DDL
"
+"fragment for this particular column (non portable)"
+msgstr "<literal>columnDefinition</literal> (opcional): sobreescribe el
fragmento DDL sql para esta columna en particular (no es portátil)"
+
+#. Tag: para
+#: entity.xml:323
+#, no-c-format
+msgid ""
+"<literal>table</literal> (optional): define the targeted table (default
"
+"primary table)"
+msgstr "<literal>table</literal> (opcional): define la tabla de destino
(por defecto es la tabla principal)"
+
+#. Tag: para
+#: entity.xml:328
+#, no-c-format
+msgid ""
+"<literal><literal>length</literal></literal> (optional):
column length "
+"(default 255)"
+msgstr "<literal><literal>length</literal></literal>
(opcional): el largo de la columna (por defecto es 255)"
+
+#. Tag: para
+#: entity.xml:333
+#, no-c-format
+msgid ""
+"<literal><literal>precision</literal></literal> (optional):
column decimal "
+"precision (default 0)"
+msgstr "<literal><literal>precision</literal></literal>
(opcional): precisión decimal de columna (por defecto es 0)"
+
+#. Tag: para
+#: entity.xml:338
+#, no-c-format
+msgid ""
+"<literal><literal>scale</literal></literal> (optional):
column decimal scale "
+"if useful (default 0)"
+msgstr "<literal><literal>scale</literal></literal>
(opcional): escala decimal de columna si es útil (por defecto es 0)"
+
+#. Tag: title
+#: entity.xml:346
+#, no-c-format
+msgid "Embedded objects (aka components)"
+msgstr "Objetos incluÃdos (tambien conocidos como componentes)"
+
+#. Tag: para
+#: entity.xml:348
+#, no-c-format
+msgid ""
+"It is possible to declare an embedded component inside an entity and even "
+"override its column mapping. Component classes have to be annotated at the "
+"class level with the <literal>@Embeddable</literal> annotation. It is
"
+"possible to override the column mapping of an embedded object for a "
+"particular entity using the <literal>@Embedded</literal> and "
+"<literal>@AttributeOverride</literal> annotation in the associated
property:"
+msgstr ""
+"Es posible el declarar un componente incluÃdo dentro de una entidad e incluso
sobreescribir su mapeo de columnas. Las clases de componentes tienen que anotarse a nivel
de clase con la anotación <literal>@Embeddable</literal>. Es "
+"posible el sobreescribir el mapeo de columnas de un objeto incluÃdo para una
entidad en particular usando las anotaciones <literal>@Embedded</literal> y
"
+"<literal>@AttributeOverride</literal> en la propiedad asociada:"
+
+#. Tag: programlisting
+#: entity.xml:356
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Person implements Serializable {\n"
+"\n"
+" // Persistent component using defaults\n"
+" Address homeAddress;\n"
+"\n"
+" @Embedded\n"
+" @AttributeOverrides( {\n"
+" @AttributeOverride(name=\"iso2\", column =
@Column(name="
+"\"bornIso2\") ),\n"
+" @AttributeOverride(name=\"name\", column =
@Column(name="
+"\"bornCountryName\") )\n"
+" } )\n"
+" Country bornIn;\n"
+" ...\n"
+"}"
+msgstr ""
+"@Entity\n"
+"public class Person implements Serializable {\n"
+"\n"
+" // Persistent component using defaults\n"
+" Address homeAddress;\n"
+"\n"
+" @Embedded\n"
+" @AttributeOverrides( {\n"
+" @AttributeOverride(name=\"iso2\", column =
@Column(name="
+"\"bornIso2\") ),\n"
+" @AttributeOverride(name=\"name\", column =
@Column(name="
+"\"bornCountryName\") )\n"
+" } )\n"
+" Country bornIn;\n"
+" ...\n"
+"}"
+
+#. Tag: programlisting
+#: entity.xml:358
+#, no-c-format
+msgid ""
+"@Embeddable\n"
+"public class Address implements Serializable {\n"
+" String city;\n"
+" Country nationality; //no overriding here\n"
+"}"
+msgstr ""
+"@Embeddable\n"
+"public class Address implements Serializable {\n"
+" String city;\n"
+" Country nationality; //no overriding here\n"
+"}"
+
+#. Tag: programlisting
+#: entity.xml:360
+#, no-c-format
+msgid ""
+"@Embeddable\n"
+"public class Country implements Serializable {\n"
+" private String iso2;\n"
+" @Column(name=\"countryName\") private String name;\n"
+"\n"
+" public String getIso2() { return iso2; }\n"
+" public void setIso2(String iso2) { this.iso2 = iso2; }\n"
+"\n"
+" \n"
+" public String getName() { return name; }\n"
+" public void setName(String name) { this.name = name; }\n"
+" ...\n"
+"}"
+msgstr ""
+"@Embeddable\n"
+"public class Country implements Serializable {\n"
+" private String iso2;\n"
+" @Column(name=\"countryName\") private String name;\n"
+"\n"
+" public String getIso2() { return iso2; }\n"
+" public void setIso2(String iso2) { this.iso2 = iso2; }\n"
+"\n"
+" \n"
+" public String getName() { return name; }\n"
+" public void setName(String name) { this.name = name; }\n"
+" ...\n"
+"}"
+
+#. Tag: para
+#: entity.xml:362
+#, no-c-format
+msgid ""
+"A embeddable object inherit the access type of its owning entity (note that "
+"you can override that using the Hibernate specific
<literal>@AccessType</"
+"literal> annotations (see <xref
linkend=\"entity-hibspec\"/>)."
+msgstr ""
+"Un objeto incluÃdo hereda el tipo de acceso de la entidad dueña (note que puede
sobreescribir eso usando las anotaciones <literal>@AccessType</"
+"literal> especificas de Hibernate (consulte <xref
linkend=\"entity-hibspec\"/>)."
+
+#. Tag: para
+#: entity.xml:367
+#, no-c-format
+msgid ""
+"The <literal>Person</literal> entity bean has two component properties,
"
+"<literal>homeAddress</literal> and
<literal>bornIn</literal>. "
+"<literal>homeAddress</literal> property has not been annotated, but
"
+"Hibernate will guess that it is a persistent component by looking for the "
+"<literal>@Embeddable</literal> annotation in the Address class. We also
"
+"override the mapping of a column name (to
<literal>bornCountryName</"
+"literal>) with the <literal>@Embedded</literal> and "
+"<literal>@AttributeOverride </literal>annotations for each mapped
attribute "
+"of <literal>Country</literal>. As you can see, <literal>Country
</literal>is "
+"also a nested component of <literal>Address</literal>, again using
auto-"
+"detection by Hibernate and EJB3 defaults. Overriding columns of embedded "
+"objects of embedded objects is currently not supported in the EJB3 spec, "
+"however, Hibernate Annotations supports it through dotted expressions."
+msgstr ""
+"El bean de entidad <literal>Person</literal> tiene dos propiedades de
componentes, "
+"<literal>homeAddress</literal> y <literal>bornIn</literal>.
La propiedad <literal>homeAddress</literal> no ha sido anotada, pero Hibernate
supondrá que es un componente persistente al buscar la anotación
<literal>@Embeddable</literal> en la clase Address. También sobreescribimos el
mapeo del nombre de una columna (como <literal>bornCountryName</"
+"literal>) con las anotaciones <literal>@Embedded</literal> y
<literal>@AttributeOverride </literal>para cada atributo mapeado de
<literal>Country</literal>. Como lo puede ver, <literal>Country
</literal>también es un componente anidado de
<literal>Address</literal>, de nuevo usando la auto-detección como valores
predeterminados de Hibernate y EJB3. El sobreescribir columnas de objetos incluÃdos
actualmente no está soportado en la especificación EJB3, sin embargo, Hibernate
Annotations lo soporta por medio de expresiones con puntos."
+
+#. Tag: programlisting
+#: entity.xml:383
+#, no-c-format
+msgid ""
+"@Embedded\n"
+" @AttributeOverrides( {\n"
+" @AttributeOverride(name=\"city\", column =
@Column(name="
+"\"fld_city\") ),\n"
+" @AttributeOverride(name=\"<emphasis
role=\"bold\">nationality."
+"iso2</emphasis>\", column = @Column(name=\"nat_Iso2\")
),\n"
+" @AttributeOverride(name=\"<emphasis
role=\"bold\">nationality."
+"name</emphasis>\", column = @Column(name=\"nat_CountryName\")
)\n"
+" //nationality columns in homeAddress are overridden\n"
+" } )\n"
+" Address homeAddress;"
+msgstr ""
+"@Embedded\n"
+" @AttributeOverrides( {\n"
+" @AttributeOverride(name=\"city\", column =
@Column(name="
+"\"fld_city\") ),\n"
+" @AttributeOverride(name=\"<emphasis
role=\"bold\">nationality."
+"iso2</emphasis>\", column = @Column(name=\"nat_Iso2\")
),\n"
+" @AttributeOverride(name=\"<emphasis
role=\"bold\">nationality."
+"name</emphasis>\", column = @Column(name=\"nat_CountryName\")
)\n"
+" //nationality columns in homeAddress are overridden\n"
+" } )\n"
+" Address homeAddress;"
+
+#. Tag: para
+#: entity.xml:383
+#, no-c-format
+msgid ""
+"Hibernate Annotations supports one more feature that is not explicitly "
+"supported by the EJB3 specification. You can annotate a embedded object with
"
+"the <literal>@MappedSuperclass</literal> annotation to make the
superclass "
+"properties persistent (see <literal>@MappedSuperclass</literal> for
more "
+"informations)."
+msgstr "Hibernate Annotations soporta una funcionalidad más que no es soportada
explÃcitamente por la especificación EJB3. Puede anotar un objeto incluÃdo con la
anotación <literal>@MappedSuperclass</literal> para hacer persistentes las
propiedades de la superclase (consulte <literal>@MappedSuperclass</literal>
para obtener mayor información)."
+
+#. Tag: para
+#: entity.xml:390
+#, no-c-format
+msgid ""
+"While not supported by the EJB3 specification, Hibernate Annotations allows "
+"you to use association annotations in an embeddable object (ie "
+"<literal>@*ToOne</literal> nor
<literal>@*ToMany</literal>). To override the "
+"association columns you can use
<literal>(a)AssociationOverride</literal>."
+msgstr "Aunque no es soportado por la especificación EJB3, Hibernate Annotations le
permite utilizar anotaciones de asociaciones en un objeto incluÃdo (es decir
<literal>@*ToOne</literal> ni <literal>@*ToMany</literal>). Para
sobreescribir las columnas de asociación puede utilizar
<literal>(a)AssociationOverride</literal>."
+
+#. Tag: para
+#: entity.xml:396
+#, no-c-format
+msgid ""
+"If you want to have the same embeddable object type twice in the same "
+"entity, the column name defaulting will not work: at least one of the "
+"columns will have to be explicit. Hibernate goes beyond the EJB3 spec and "
+"allows you to enhance the defaulting mechanism through the "
+"<classname>NamingStrategy</classname>. "
+"<classname>DefaultComponentSafeNamingStrategy</classname> is a small
"
+"improvement over the default EJB3NamingStrategy that allows embedded objects
"
+"to be defaulted even if used twice in the same entity."
+msgstr ""
+"Si quiere tener el mismo tipo de objeto incluÃdo en la misma entidad, el valor
predeterminado del nombre de la columna no funcionará: por lo menos una de las columnas
tendrá que ser explÃcita. Hibernate va más allá de la especificación EJB3 y le permite
mejorar los mecanismos predeterminados por medio de la "
+"<classname>NamingStrategy</classname>.
<classname>DefaultComponentSafeNamingStrategy</classname> es una mejora
pequeña sobre la EJB3NamingStrategy predeterminada que permite que objetos incluÃdos
utilicen los predeterminados incluso si se utilizan dos veces en la misma entidad."
+
+#. Tag: title
+#: entity.xml:407
+#, no-c-format
+msgid "Non-annotated property defaults"
+msgstr "Valores predeterminados de las propiedades no anotadas"
+
+#. Tag: para
+#: entity.xml:409
+#, no-c-format
+msgid "If a property is not annotated, the following rules apply:"
+msgstr "Si una propiedad no está anotada entonces las siguientes reglas
aplican:"
+
+#. Tag: para
+#: entity.xml:414
+#, no-c-format
+msgid "If the property is of a single type, it is mapped as @Basic"
+msgstr "Si la propiedad es de un solo tipo entonces se mapea como @Basic"
+
+#. Tag: para
+#: entity.xml:420
+#, no-c-format
+msgid ""
+"Otherwise, if the type of the property is annotated as @Embeddable, it is "
+"mapped as @Embedded"
+msgstr "De otra manera, si el tipo de la propiedad es anotada como @Embeddable
entonces se mapea como @Embedded"
+
+#. Tag: para
+#: entity.xml:426
+#, no-c-format
+msgid ""
+"Otherwise, if the type of the property is Serializable, it is mapped as "
+"@Basic in a column holding the object in its serialized version"
+msgstr ""
+"De otra forma, si el tipo de la propiedad es Serializable entonces se mapea como
"
+"@Basic en una columna que tenga el objeto en su versión serializada"
+
+#. Tag: para
+#: entity.xml:432
+#, no-c-format
+msgid ""
+"Otherwise, if the type of the property is java.sql.Clob or java.sql.Blob, it
"
+"is mapped as @Lob with the appropriate LobType"
+msgstr "De otra forma, si el tipo de la propiedad es java.sql.Clob or java.sql.Blob,
se mapea como @Lob con el LobType apropiado"
+
+#. Tag: title
+#: entity.xml:441
+#, no-c-format
+msgid "Mapping identifier properties"
+msgstr "Mapeo de propiedades identificadoras"
+
+#. Tag: para
+#: entity.xml:443
+#, no-c-format
+msgid ""
+"The <literal>@Id</literal> annotation lets you define which property is
the "
+"identifier of your entity bean. This property can be set by the application "
+"itself or be generated by Hibernate (preferred). You can define the "
+"identifier generation strategy thanks to the
<literal>@GeneratedValue</"
+"literal> annotation:"
+msgstr ""
+"La anotacióm <literal>@Id</literal> le permite definir qué propiedad es
el identificador de su bean de entidad. Esta propiedad la puede configurar la aplicación
misma o puede ser generada por Hibernate (preferido). Puede definir la estrategia de
generación del identificador gracias a la anotación
<literal>@GeneratedValue</"
+"literal>:"
+
+#. Tag: para
+#: entity.xml:451
+#, no-c-format
+msgid ""
+"AUTO - either identity column, sequence or table depending on the underlying
"
+"DB"
+msgstr "AUTO - ya sea columna de identidad, secuencia o tabla dependiendo de la base
de datos subyacente"
+
+#. Tag: para
+#: entity.xml:457
+#, no-c-format
+msgid "TABLE - table holding the id"
+msgstr "TABLE - la tabla que tiene el id"
+
+#. Tag: para
+#: entity.xml:463
+#, no-c-format
+msgid "IDENTITY - identity column"
+msgstr "IDENTITY - la columna de identidad"
+
+#. Tag: para
+#: entity.xml:469
+#, no-c-format
+msgid "SEQUENCE - sequence"
+msgstr "SEQUENCE - secuencia"
+
+#. Tag: para
+#: entity.xml:475
+#, no-c-format
+msgid ""
+"Hibernate provides more id generators than the basic EJB3 ones. Check <xref
"
+"linkend=\"entity-hibspec\"/> for more informations."
+msgstr ""
+"Hibernate brinda más generados de identificadores que los básicos de EJB3. Consulte
<xref "
+"linkend=\"entity-hibspec\"/> para obtener mayor información."
+
+#. Tag: para
+#: entity.xml:478
+#, no-c-format
+msgid ""
+"The following example shows a sequence generator using the SEQ_STORE "
+"configuration (see below)"
+msgstr "El siguiente ejemplo muestra un generador de secuencia usando la
configuración SEQ_STORE (vea a continuación)"
+
+#. Tag: programlisting
+#: entity.xml:481
+#, no-c-format
+msgid ""
+"@Id @GeneratedValue(strategy=GenerationType.SEQUENCE,
generator=\"SEQ_STORE"
+"\")\n"
+"public Integer getId() { ... }"
+msgstr ""
+"@Id @GeneratedValue(strategy=GenerationType.SEQUENCE,
generator=\"SEQ_STORE"
+"\")\n"
+"public Integer getId() { ... }"
+
+#. Tag: para
+#: entity.xml:483
+#, no-c-format
+msgid "The next example uses the identity generator:"
+msgstr "El siguiente ejemplo utiliza el generador de identidad:"
+
+#. Tag: programlisting
+#: entity.xml:485
+#, no-c-format
+msgid ""
+"@Id @GeneratedValue(strategy=GenerationType.IDENTITY)\n"
+"public Long getId() { ... }"
+msgstr ""
+"@Id @GeneratedValue(strategy=GenerationType.IDENTITY)\n"
+"public Long getId() { ... }"
+
+#. Tag: para
+#: entity.xml:487
+#, no-c-format
+msgid ""
+"The <literal>AUTO</literal> generator is the preferred type for
portable "
+"applications (across several DB vendors). The identifier generation "
+"configuration can be shared for several <literal>@Id</literal> mappings
with "
+"the generator attribute. There are several configurations available through "
+"<literal>@SequenceGenerator</literal> and
<literal>@TableGenerator</"
+"literal>. The scope of a generator can be the application or the class. "
+"Class-defined generators are not visible outside the class and can override "
+"application level generators. Application level generators are defined at "
+"XML level (see <xref linkend=\"xml-overriding\"/>):"
+msgstr ""
+"El generador <literal>AUTO</literal> es el tipo preferido para
aplicaciones portátiles (a través de varios vendedores de bases de datos). La
configuración de la generación del identificador se puede compartir para varios mapeos
<literal>@Id</literal> con el atributo generador. Hay varias configuraciones
disponibles a través <literal>@SequenceGenerator</literal> y
<literal>@TableGenerator</"
+"literal>. El ámbito de un generador puede ser la aplicación o la clase. Los
generadores definidos por clase no son visibles por fuera de la clase y pueden
sobreescribir los generadores a nivel de aplicación. Los generadores a nivel de aplicación
se definen a nivel XML (consulte <xref
linkend=\"xml-overriding\"/>):"
+
+#. Tag: programlisting
+#: entity.xml:499
+#, no-c-format
+msgid ""
+"<table-generator name=\"EMP_GEN\"\n"
+" table=\"GENERATOR_TABLE\"\n"
+" pk-column-name=\"key\"\n"
+" value-column-name=\"hi\"\n"
+" pk-column-value=\"EMP\"\n"
+" allocation-size=\"20\"/>\n"
+"\n"
+"//and the annotation equivalent\n"
+"\n"
+"(a)javax.persistence.TableGenerator(\n"
+" name=\"EMP_GEN\",\n"
+" table=\"GENERATOR_TABLE\",\n"
+" pkColumnName = \"key\",\n"
+" valueColumnName = \"hi\"\n"
+" pkColumnValue=\"EMP\",\n"
+" allocationSize=20\n"
+")\n"
+"\n"
+"<sequence-generator name=\"SEQ_GEN\" \n"
+" sequence-name=\"my_sequence\"\n"
+" allocation-size=\"20\"/>\n"
+"\n"
+"//and the annotation equivalent\n"
+"\n"
+"(a)javax.persistence.SequenceGenerator(\n"
+" name=\"SEQ_GEN\",\n"
+" sequenceName=\"my_sequence\",\n"
+" allocationSize=20\n"
+")"
+msgstr ""
+"<table-generator name=\"EMP_GEN\"\n"
+" table=\"GENERATOR_TABLE\"\n"
+" pk-column-name=\"key\"\n"
+" value-column-name=\"hi\"\n"
+" pk-column-value=\"EMP\"\n"
+" allocation-size=\"20\"/>\n"
+"\n"
+"//and the annotation equivalent\n"
+"\n"
+"(a)javax.persistence.TableGenerator(\n"
+" name=\"EMP_GEN\",\n"
+" table=\"GENERATOR_TABLE\",\n"
+" pkColumnName = \"key\",\n"
+" valueColumnName = \"hi\"\n"
+" pkColumnValue=\"EMP\",\n"
+" allocationSize=20\n"
+")\n"
+"\n"
+"<sequence-generator name=\"SEQ_GEN\" \n"
+" sequence-name=\"my_sequence\"\n"
+" allocation-size=\"20\"/>\n"
+"\n"
+"//and the annotation equivalent\n"
+"\n"
+"(a)javax.persistence.SequenceGenerator(\n"
+" name=\"SEQ_GEN\",\n"
+" sequenceName=\"my_sequence\",\n"
+" allocationSize=20\n"
+")"
+
+#. Tag: para
+#: entity.xml:501
+#, no-c-format
+msgid ""
+"If JPA XML (like <filename>META-INF/orm.xml</filename>) is used to
define "
+"thegenerators, <literal>EMP_GEN</literal> and
<literal>SEQ_GEN</literal> are "
+"application level generators. <literal>EMP_GEN</literal> defines a
table "
+"based id generator using the hilo algorithm with a
<literal>max_lo</literal> "
+"of 20. The hi value is kept in a <literal>table</literal> "
+"\"<literal>GENERATOR_TABLE</literal>\". The information is
kept in a row "
+"where <literal>pkColumnName</literal> \"key\" is equals to
"
+"<literal>pkColumnValue</literal>
\"<literal>EMP</literal>\" and column "
+"<literal>valueColumnName</literal>
\"<literal>hi</literal>\" contains the "
+"the next high value used."
+msgstr ""
+"Si utiliza JPA XML (como <filename>META-INF/orm.xml</filename>) para
definir los generadores, <literal>EMP_GEN</literal> y
<literal>SEQ_GEN</literal> son generadores a nivel de aplicación.
<literal>EMP_GEN</literal> define un generador de id basado en tablas usando
el algoritmo hilo con un <literal>max_lo</literal> de 20. El valor hi se
mantiene en una <literal>table</literal> "
+"\"<literal>GENERATOR_TABLE</literal>\". La información se
mantienen en una fila en donde <literal>pkColumnName</literal>
\"key\" es igual a <literal>pkColumnValue</literal>
\"<literal>EMP</literal>\" y la columna "
+"<literal>valueColumnName</literal>
\"<literal>hi</literal>\" contiene el siguiente valor alto
utilizado."
+
+#. Tag: para
+#: entity.xml:512
+#, no-c-format
+msgid ""
+"<literal>SEQ_GEN</literal> defines a sequence generator using a
sequence "
+"named <literal>my_sequence</literal>. The allocation size used for this
"
+"sequence based hilo algorithm is 20. Note that this version of Hibernate "
+"Annotations does not handle <literal>initialValue</literal> in the
sequence "
+"generator. The default allocation size is 50, so if you want to use a "
+"sequence and pickup the value each time, you must set the allocation size to
"
+"1."
+msgstr ""
+"<literal>SEQ_GEN</literal> define un generador de secuencia usando una
secuencia llamada <literal>my_sequence</literal>. El tamaño asignado para este
algoritmo hilo basado en secuencia es 20. Observe que esta versión de Hibernate "
+"Annotations no maneja <literal>initialValue</literal> en el generador
de secuencia. El tamaó asignado por defecto es 50, asà que si quiere utilizar una
secuencia y tomar el valor cada vez, tiene que establecer el tamaño asignado como "
+"1."
+
+#. Tag: para
+#: entity.xml:521
+#, no-c-format
+msgid ""
+"Package level definition is no longer supported by the EJB 3.0 "
+"specification. However, you can use the
<literal>@GenericGenerator</literal> "
+"at the package level (see <xref
linkend=\"entity-hibspec-identifier\"/>)."
+msgstr ""
+"La definición a nivel de paquete ya no es soportada por la especificaicón EJB 3.0.
Sin embargo, puede utilizar el <literal>@GenericGenerator</literal> "
+"a nivel de paquete (consulte <xref
linkend=\"entity-hibspec-identifier\"/>)."
+
+#. Tag: para
+#: entity.xml:527
+#, no-c-format
+msgid ""
+"The next example shows the definition of a sequence generator in a class "
+"scope:"
+msgstr "El siguiente ejemplo muestra la definición de un generador de secuencia en
un ámbito de clase:"
+
+#. Tag: programlisting
+#: entity.xml:530
+#, no-c-format
+msgid ""
+"@Entity\n"
+"(a)javax.persistence.SequenceGenerator(\n"
+" name=\"SEQ_STORE\",\n"
+" sequenceName=\"my_sequence\"\n"
+")\n"
+"public class Store implements Serializable {\n"
+" private Long id;\n"
+"\n"
+" @Id @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="
+"\"SEQ_STORE\")\n"
+" public Long getId() { return id; }\n"
+"}"
+msgstr ""
+"@Entity\n"
+"(a)javax.persistence.SequenceGenerator(\n"
+" name=\"SEQ_STORE\",\n"
+" sequenceName=\"my_sequence\"\n"
+")\n"
+"public class Store implements Serializable {\n"
+" private Long id;\n"
+"\n"
+" @Id @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="
+"\"SEQ_STORE\")\n"
+" public Long getId() { return id; }\n"
+"}"
+
+#. Tag: para
+#: entity.xml:532
+#, no-c-format
+msgid ""
+"This class will use a sequence named my_sequence and the SEQ_STORE generator
"
+"is not visible in other classes. Note that you can check the Hibernate "
+"Annotations tests in the
<package>org.hibernate.test.annotations.id</"
+"package> package for more examples."
+msgstr ""
+"Esta clase usará una secuencia llamada my_sequence y el generador SEQ_STORE no es
visible en otras clases. Note que puede chequear los tests de Hibernate "
+"Annotations en el paquete
<package>org.hibernate.test.annotations.id</"
+"package> para obtener más ejemplos."
+
+#. Tag: para
+#: entity.xml:538
+#, no-c-format
+msgid "You can define a composite primary key through several syntaxes:"
+msgstr "Puede definir una llave principal compuesta por medio de varias
sintaxis:"
+
+#. Tag: para
+#: entity.xml:543
+#, no-c-format
+msgid ""
+"annotate the component property as @Id and make the component class "
+"@Embeddable"
+msgstr ""
+"anote la propiedad componente como @Id y haga la clase del componente "
+"@Embeddable"
+
+#. Tag: para
+#: entity.xml:549
+#, no-c-format
+msgid "annotate the component property as @EmbeddedId"
+msgstr "anote la propiedad componente como @EmbeddedId"
+
+#. Tag: para
+#: entity.xml:555
+#, no-c-format
+msgid ""
+"annotate the class as @IdClass and annotate each property of the entity "
+"involved in the primary key with @Id"
+msgstr "anote la clase como @IdClass y anote cada propiedad de la entidad
involucrada en la llave principal con @Id"
+
+#. Tag: para
+#: entity.xml:561
+#, no-c-format
+msgid ""
+"While quite common to the EJB2 developer, <literal>@IdClass</literal>
is "
+"likely new for Hibernate users. The composite primary key class corresponds "
+"to multiple fields or properties of the entity class, and the names of "
+"primary key fields or properties in the primary key class and those of the "
+"entity class must match and their types must be the same. Let's look at an
"
+"example:"
+msgstr "Aunque es bastante común para el desarrollador EJB2, es probable que
<literal>@IdClass</literal> sea nuevo para los usuarios de Hibernate. La clase
de la llave principal compuesta corresponde a múltiples campos o propiedades de la clase
entidad y los nombres de los campos de llaves principales o propiedades en la clase de la
llave principal y aquellos de la clase entidad deben coincidir y sus tipos deben ser
iguales. Vamos a ver un ejemplo:"
+
+#. Tag: programlisting
+#: entity.xml:568
+#, no-c-format
+msgid ""
+"@Entity\n"
+"<emphasis
role=\"bold\">(a)IdClass(FootballerPk.class)</emphasis>\n"
+"public class Footballer {\n"
+" //part of the id key\n"
+" <emphasis role=\"bold\">@Id</emphasis> public String
getFirstname() {\n"
+" return firstname;\n"
+" }\n"
+"\n"
+" public void setFirstname(String firstname) {\n"
+" this.firstname = firstname;\n"
+" }\n"
+"\n"
+" //part of the id key\n"
+" <emphasis role=\"bold\">@Id</emphasis> public String
getLastname() {\n"
+" return lastname;\n"
+" }\n"
+"\n"
+" public void setLastname(String lastname) {\n"
+" this.lastname = lastname;\n"
+" }\n"
+"\n"
+" public String getClub() {\n"
+" return club;\n"
+" }\n"
+"\n"
+" public void setClub(String club) {\n"
+" this.club = club;\n"
+" }\n"
+"\n"
+" //appropriate equals() and hashCode() implementation\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"public class FootballerPk implements Serializable {\n"
+" //same name and type as in Footballer\n"
+" public String getFirstname() {\n"
+" return firstname;\n"
+" }\n"
+"\n"
+" public void setFirstname(String firstname) {\n"
+" this.firstname = firstname;\n"
+" }\n"
+"\n"
+" //same name and type as in Footballer\n"
+" public String getLastname() {\n"
+" return lastname;\n"
+" }\n"
+"\n"
+" public void setLastname(String lastname) {\n"
+" this.lastname = lastname;\n"
+" }\n"
+"\n"
+" //appropriate equals() and hashCode() implementation\n"
+"}"
+msgstr ""
+"@Entity\n"
+"<emphasis
role=\"bold\">(a)IdClass(FootballerPk.class)</emphasis>\n"
+"public class Footballer {\n"
+" //part of the id key\n"
+" <emphasis role=\"bold\">@Id</emphasis> public String
getFirstname() {\n"
+" return firstname;\n"
+" }\n"
+"\n"
+" public void setFirstname(String firstname) {\n"
+" this.firstname = firstname;\n"
+" }\n"
+"\n"
+" //part of the id key\n"
+" <emphasis role=\"bold\">@Id</emphasis> public String
getLastname() {\n"
+" return lastname;\n"
+" }\n"
+"\n"
+" public void setLastname(String lastname) {\n"
+" this.lastname = lastname;\n"
+" }\n"
+"\n"
+" public String getClub() {\n"
+" return club;\n"
+" }\n"
+"\n"
+" public void setClub(String club) {\n"
+" this.club = club;\n"
+" }\n"
+"\n"
+" //appropriate equals() and hashCode() implementation\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"public class FootballerPk implements Serializable {\n"
+" //same name and type as in Footballer\n"
+" public String getFirstname() {\n"
+" return firstname;\n"
+" }\n"
+"\n"
+" public void setFirstname(String firstname) {\n"
+" this.firstname = firstname;\n"
+" }\n"
+"\n"
+" //same name and type as in Footballer\n"
+" public String getLastname() {\n"
+" return lastname;\n"
+" }\n"
+"\n"
+" public void setLastname(String lastname) {\n"
+" this.lastname = lastname;\n"
+" }\n"
+"\n"
+" //appropriate equals() and hashCode() implementation\n"
+"}"
+
+#. Tag: para
+#: entity.xml:570
+#, no-c-format
+msgid ""
+"As you may have seen, <literal>@IdClass</literal> points to the "
+"corresponding primary key class."
+msgstr "Como lo puede haber observado, <literal>@IdClass</literal>
apunta a la clase de la llave principal correspondiente."
+
+#. Tag: para
+#: entity.xml:573
+#, no-c-format
+msgid ""
+"While not supported by the EJB3 specification, Hibernate allows you to "
+"define associations inside a composite identifier. Simply use the regular "
+"annotations for that"
+msgstr "Aunque no es soportado por la especificación EJB3, Hibernate le permite
definir asociaciones dentro de un identificador compuesto. Simplemente use las anotaciones
comunes para eso."
+
+#. Tag: programlisting
+#: entity.xml:577
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@AssociationOverride( name=\"id.channel\", joinColumns =
@JoinColumn(name="
+"\"chan_id\") )\n"
+"public class TvMagazin {\n"
+" @EmbeddedId public TvMagazinPk id;\n"
+" @Temporal(TemporalType.TIME) Date time;\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"public class TvMagazinPk implements Serializable {\n"
+" @ManyToOne\n"
+" public Channel channel;\n"
+" public String name;\n"
+" @ManyToOne\n"
+" public Presenter presenter;\n"
+"}"
+msgstr ""
+"@Entity\n"
+"@AssociationOverride( name=\"id.channel\", joinColumns =
@JoinColumn(name="
+"\"chan_id\") )\n"
+"public class TvMagazin {\n"
+" @EmbeddedId public TvMagazinPk id;\n"
+" @Temporal(TemporalType.TIME) Date time;\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"public class TvMagazinPk implements Serializable {\n"
+" @ManyToOne\n"
+" public Channel channel;\n"
+" public String name;\n"
+" @ManyToOne\n"
+" public Presenter presenter;\n"
+"}"
+
+#. Tag: title
+#: entity.xml:581
+#, no-c-format
+msgid "Mapping inheritance"
+msgstr "Mapeo de herencias"
+
+#. Tag: para
+#: entity.xml:583
+#, no-c-format
+msgid "EJB3 supports the three types of inheritance:"
+msgstr "EJB3 soporta los tres tipos de herencia:"
+
+#. Tag: para
+#: entity.xml:587
+#, no-c-format
+msgid "Table per Class Strategy: the <union-class> element in
Hibernate"
+msgstr "Estrategia tabla por clase: el elemento <union-class> en
Hibernate"
+
+#. Tag: para
+#: entity.xml:593
+#, no-c-format
+msgid ""
+"Single Table per Class Hierarchy Strategy: the <subclass> element in
"
+"Hibernate"
+msgstr ""
+"Estrategia de jerarquÃa una sola tabla por clase: el elemento
<subclass> en "
+"Hibernate"
+
+#. Tag: para
+#: entity.xml:599
+#, no-c-format
+msgid "Joined Subclass Strategy: the <joined-subclass> element in
Hibernate"
+msgstr "Estrategia subclase unida: el elemento <joined-subclass> en
Hibernate"
+
+#. Tag: para
+#: entity.xml:604
+#, no-c-format
+msgid ""
+"The chosen strategy is declared at the class level of the top level entity "
+"in the hierarchy using the <literal>@Inheritance</literal>
annotation."
+msgstr "La estrategia seleccionada se declara a nivel de la clase de la entidad del
nivel superior en la jerarquÃa usando la anotación
<literal>(a)Inheritance</literal>."
+
+#. Tag: para
+#: entity.xml:609
+#, no-c-format
+msgid "Annotating interfaces is currently not supported."
+msgstr "Actualmente no se soporta la anotación de interfaces."
+
+#. Tag: title
+#: entity.xml:613
+#, no-c-format
+msgid "Table per class"
+msgstr "Tabla por clase"
+
+#. Tag: para
+#: entity.xml:615
+#, no-c-format
+msgid ""
+"This strategy has many drawbacks (esp. with polymorphic queries and "
+"associations) explained in the EJB3 spec, the Hibernate reference "
+"documentation, Hibernate in Action, and many other places. Hibernate work "
+"around most of them implementing this strategy using <literal>SQL
UNION</"
+"literal> queries. It is commonly used for the top level of an inheritance
"
+"hierarchy:"
+msgstr ""
+"Esta estrategia tiene muchos inconvenientes (especialmente con peticiones
polimórficas y asociaciones) que se abordan en la especificación EJB3, la documentación de
referencia de Hibernate, Hibernate en acción y muchos otros lugares. Hibernate funciona
con la mayorÃa de ellos implementando esta estrategia usando peticiones <literal>SQL
UNION</"
+"literal>. Se utiliza usualmente para el nivel superir de una jerarquÃa de
herencias:"
+
+#. Tag: programlisting
+#: entity.xml:622
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)\n"
+"public class Flight implements Serializable {"
+msgstr ""
+"@Entity\n"
+"@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)\n"
+"public class Flight implements Serializable {"
+
+#. Tag: para
+#: entity.xml:624
+#, no-c-format
+msgid ""
+"This strategy support one to many associations provided that they are "
+"bidirectional. This strategy does not support the
<literal>IDENTITY</"
+"literal> generator strategy: the id has to be shared across several tables.
"
+"Consequently, when using this strategy, you should not use <literal>AUTO
</"
+"literal>nor <literal>IDENTITY</literal>."
+msgstr ""
+"Esta estrategia soporta asociaciones uno a muchos dado que sean bidireccionales.
Esta estrategia no soporta la estrategia del generador <literal>IDENTITY</"
+"literal>: el id se tiene que compartir entre varias tablas. Por lo tanto, al
usar esta estrategia, no use <literal>AUTO </"
+"literal>ni <literal>IDENTITY</literal>."
+
+#. Tag: title
+#: entity.xml:633
+#, no-c-format
+msgid "Single table per class hierarchy"
+msgstr "JerarquÃa de una sola tabla por clase"
+
+#. Tag: para
+#: entity.xml:635
+#, no-c-format
+msgid ""
+"All properties of all super- and subclasses are mapped into the same table, "
+"instances are distinguished by a special discriminator column:"
+msgstr "Todas las propiedades de todas las superclases y subclases se mapean en la
misma tabla, las instances se distinguen por medio de una columna discriminadora
especial:"
+
+#. Tag: programlisting
+#: entity.xml:639
+#, no-c-format
+msgid ""
+"@Entity\n"
+"(a)Inheritance(strategy=InheritanceType.SINGLE_TABLE)\n"
+"@DiscriminatorColumn(\n"
+" name=\"planetype\",\n"
+" discriminatorType=DiscriminatorType.STRING\n"
+")\n"
+"@DiscriminatorValue(\"Plane\")\n"
+"public class Plane { ... }\n"
+"\n"
+"@Entity\n"
+"@DiscriminatorValue(\"A320\")\n"
+"public class A320 extends Plane { ... }"
+msgstr ""
+"@Entity\n"
+"(a)Inheritance(strategy=InheritanceType.SINGLE_TABLE)\n"
+"@DiscriminatorColumn(\n"
+" name=\"planetype\",\n"
+" discriminatorType=DiscriminatorType.STRING\n"
+")\n"
+"@DiscriminatorValue(\"Plane\")\n"
+"public class Plane { ... }\n"
+"\n"
+"@Entity\n"
+"@DiscriminatorValue(\"A320\")\n"
+"public class A320 extends Plane { ... }"
+
+#. Tag: para
+#: entity.xml:641
+#, no-c-format
+msgid ""
+"<classname>Plane</classname> is the superclass, it defines the
inheritance "
+"strategy <literal>InheritanceType.SINGLE_TABLE</literal>. It also
defines "
+"the discriminator column through the
<literal>@DiscriminatorColumn</literal> "
+"annotation, a discriminator column can also define the discriminator type. "
+"Finally, the <literal>@DiscriminatorValue</literal> annotation defines
the "
+"value used to differentiate a class in the hierarchy. All of these "
+"attributes have sensible default values. The default name of the "
+"discriminator column is <literal>DTYPE</literal>. The default
discriminator "
+"value is the entity name (as defined in
<literal>(a)Entity.name</literal>) for "
+"DiscriminatorType.STRING. <classname>A320</classname> is a subclass;
you "
+"only have to define discriminator value if you don't want to use the default
"
+"value. The strategy and the discriminator type are implicit."
+msgstr "<classname>Plane</classname> es la superclase, define la
estrategia de herencia <literal>InheritanceType.SINGLE_TABLE</literal>.
También define la columna discriminadora por medio de la anotación
<literal>@DiscriminatorColumn</literal>, una columna discriminadora también
puede definir el tipo de discriminador. Finalmente, la anotación
<literal>@DiscriminatorValue</literal> define el valor utilizado para
diferenciar una clase en la jerarquÃa. Todos estos atributos tiene valores predeterminados
razonables. El nombre predeterminado de la columna discriminadora es
<literal>DTYPE</literal>. El valor discriminador predeterminado es el nombre
de entidad (tal como está definido en <literal>(a)Entity.name</literal>) para
DiscriminatorType.STRING. <classname>A320</classname> es una subclase; solo
tiene que definir el valor discriminador si no quiere usar el valor predeterminado. La
estrategia y el tipo discriminador son implÃcitos."
+
+#. Tag: para
+#: entity.xml:656
+#, no-c-format
+msgid ""
+"<literal>@Inheritance</literal> and
<literal>@DiscriminatorColumn</literal> "
+"should only be defined at the top of the entity hierarchy."
+msgstr ""
+"<literal>@Inheritance</literal> y
<literal>@DiscriminatorColumn</literal> "
+"solo se deben definir en el nivel superior de la jerarquÃa de entidades."
+
+#. Tag: title
+#: entity.xml:662
+#, no-c-format
+msgid "Joined subclasses"
+msgstr "Subclases unidas"
+
+#. Tag: para
+#: entity.xml:664
+#, no-c-format
+msgid ""
+"The<literal> @PrimaryKeyJoinColumn</literal> and "
+"<literal>@PrimaryKeyJoinColumns</literal> annotations define the
primary key"
+"(s) of the joined subclass table:"
+msgstr ""
+"Las anotaciones <literal> @PrimaryKeyJoinColumn</literal> y "
+"<literal>@PrimaryKeyJoinColumns</literal> definen la llave principal de
las tablas unidas de subclases:"
+
+#. Tag: programlisting
+#: entity.xml:668
+#, no-c-format
+msgid ""
+"@Entity\n"
+"(a)Inheritance(strategy=InheritanceType.JOINED)\n"
+"public class Boat implements Serializable { ... }\n"
+"\n"
+"@Entity\n"
+"public class Ferry extends Boat { ... }\n"
+"\n"
+"@Entity\n"
+"@PrimaryKeyJoinColumn(name=\"BOAT_ID\")\n"
+"public class AmericaCupClass extends Boat { ... }"
+msgstr ""
+"@Entity\n"
+"(a)Inheritance(strategy=InheritanceType.JOINED)\n"
+"public class Boat implements Serializable { ... }\n"
+"\n"
+"@Entity\n"
+"public class Ferry extends Boat { ... }\n"
+"\n"
+"@Entity\n"
+"@PrimaryKeyJoinColumn(name=\"BOAT_ID\")\n"
+"public class AmericaCupClass extends Boat { ... }"
+
+#. Tag: para
+#: entity.xml:670
+#, no-c-format
+msgid ""
+"All of the above entities use the <literal>JOINED</literal> strategy,
the "
+"<literal>Ferry</literal> table is joined with the
<literal>Boat</literal> "
+"table using the same primary key names. The
<literal>AmericaCupClass</"
+"literal> table is joined with <literal>Boat</literal> using the join
"
+"condition <code>Boat.id = AmericaCupClass.BOAT_ID</code>."
+msgstr ""
+"Todas las entidades anteriores usan la estrategia
<literal>JOINED</literal>, la tabla "
+"<literal>Ferry</literal> se une con la tabla
<literal>Boat</literal> usando los mismos nombres de clave principal. La tabla
<literal>AmericaCupClass</"
+"literal> se une con <literal>Boat</literal> usando la condición de
unión <code>Boat.id = AmericaCupClass.BOAT_ID</code>."
+
+#. Tag: title
+#: entity.xml:679
+#, no-c-format
+msgid "Inherit properties from superclasses"
+msgstr "Herencia de propiedades de superclases"
+
+#. Tag: para
+#: entity.xml:681
+#, no-c-format
+msgid ""
+"This is sometimes useful to share common properties through a technical or a
"
+"business superclass without including it as a regular mapped entity (ie no "
+"specific table for this entity). For that purpose you can map them as "
+"<literal>(a)MappedSuperclass</literal>."
+msgstr "A veces es útil el compartir propiedades comunes por medio de una superclase
empresarial o técnica sin incluirla como una entidad mapeada regular (es decir, ninguna
tabla especifica para esta entidad). Con ese fin puede mapearlas como
<literal>(a)MappedSuperclass</literal>."
+
+#. Tag: programlisting
+#: entity.xml:686
+#, no-c-format
+msgid ""
+"@MappedSuperclass\n"
+"public class BaseEntity {\n"
+" @Basic\n"
+" @Temporal(TemporalType.TIMESTAMP)\n"
+" public Date getLastUpdate() { ... }\n"
+" public String getLastUpdater() { ... }\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity class Order extends BaseEntity {\n"
+" @Id public Integer getId() { ... }\n"
+" ...\n"
+"}"
+msgstr ""
+"@MappedSuperclass\n"
+"public class BaseEntity {\n"
+" @Basic\n"
+" @Temporal(TemporalType.TIMESTAMP)\n"
+" public Date getLastUpdate() { ... }\n"
+" public String getLastUpdater() { ... }\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity class Order extends BaseEntity {\n"
+" @Id public Integer getId() { ... }\n"
+" ...\n"
+"}"
+
+#. Tag: para
+#: entity.xml:688
+#, no-c-format
+msgid ""
+"In database, this hierarchy will be represented as an
<literal>Order</"
+"literal> table having the <literal>id</literal>,
<literal>lastUpdate</"
+"literal> and <literal>lastUpdater</literal> columns. The embedded
superclass "
+"property mappings are copied into their entity subclasses. Remember that the
"
+"embeddable superclass is not the root of the hierarchy though."
+msgstr ""
+"En la base de datos, esta jerarquÃa se representará como una tabla
<literal>Order</"
+"literal> que tiene las columnas <literal>id</literal>,
<literal>lastUpdate</"
+"literal> y <literal>lastUpdater</literal>. Los mapeos de propiedades
superclase incluÃdos se copian en sus subclases de entidad. Recuerde que la superclase
incluÃda no es la raÃz de la jerarquÃa."
+
+#. Tag: para
+#: entity.xml:696
+#, no-c-format
+msgid ""
+"Properties from superclasses not mapped as
<literal>@MappedSuperclass</"
+"literal> are ignored."
+msgstr ""
+"Las propiedades de superclases que no estén mapeadas como
<literal>@MappedSuperclass</"
+"literal> se ignoran."
+
+#. Tag: para
+#: entity.xml:701
+#, no-c-format
+msgid ""
+"The access type (field or methods), is inherited from the root entity, "
+"unless you use the Hibernate annotation
<literal>@AccessType</literal>"
+msgstr "El tipo de acceso (campo o métodos) se hereda de la entidad raÃz, a menos de
que use la anotación Hibernate <literal>@AccessType</literal>"
+
+#. Tag: para
+#: entity.xml:707
+#, no-c-format
+msgid ""
+"The same notion can be applied to <literal>@Embeddable</literal>
objects to "
+"persist properties from their superclasses. You also need to use "
+"<literal>@MappedSuperclass</literal> to do that (this should not be
"
+"considered as a standard EJB3 feature though)"
+msgstr ""
+"La misma noción se puede aplicar a los objetos
<literal>@Embeddable</literal> para persistir propiedades desde sus
superclases. También necesita utilizar <literal>@MappedSuperclass</literal>
para hacer eso (esto no se debe "
+"considerar como una funcionalidad EJB3 estándar)"
+
+#. Tag: para
+#: entity.xml:715
+#, no-c-format
+msgid ""
+"It is allowed to mark a class as <literal>@MappedSuperclass</literal>
in the "
+"middle of the mapped inheritance hierarchy."
+msgstr "Se permite marcar una clase como
<literal>@MappedSuperclass</literal> en la mitad de la jerarquÃa de herencias
mapeadas."
+
+#. Tag: para
+#: entity.xml:721
+#, no-c-format
+msgid ""
+"Any class in the hierarchy non annotated with
<literal>@MappedSuperclass</"
+"literal> nor <literal>@Entity</literal> will be ignored."
+msgstr ""
+"Se ignorará cualquier clase en la jerarquÃa que no esté anotada con
<literal>@MappedSuperclass</"
+"literal> o <literal>(a)Entity</literal>."
+
+#. Tag: para
+#: entity.xml:726
+#, no-c-format
+msgid ""
+"You can override columns defined in entity superclasses at the root entity "
+"level using the <literal>@AttributeOverride</literal>
annotation."
+msgstr "Puede sobreescribir las columnas definidas en las superclases de entidad a
nivel de la entidad raÃz usando la anotación
<literal>(a)AttributeOverride</literal>."
+
+#. Tag: programlisting
+#: entity.xml:730
+#, no-c-format
+msgid ""
+"@MappedSuperclass\n"
+"public class FlyingObject implements Serializable {\n"
+"\n"
+" public int getAltitude() {\n"
+" return altitude;\n"
+" }\n"
+"\n"
+" @Transient\n"
+" public int getMetricAltitude() {\n"
+" return metricAltitude;\n"
+" }\n"
+"\n"
+" @ManyToOne\n"
+" public PropulsionType getPropulsion() {\n"
+" return metricAltitude;\n"
+" }\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"@AttributeOverride( name=\"altitude\", column =
@Column(name=\"fld_altitude"
+"\") )\n"
+"@AssociationOverride( name=\"propulsion\", joinColumns =
@JoinColumn(name="
+"\"fld_propulsion_fk\") )\n"
+"public class Plane extends FlyingObject {\n"
+" ...\n"
+"}"
+msgstr ""
+"@MappedSuperclass\n"
+"public class FlyingObject implements Serializable {\n"
+"\n"
+" public int getAltitude() {\n"
+" return altitude;\n"
+" }\n"
+"\n"
+" @Transient\n"
+" public int getMetricAltitude() {\n"
+" return metricAltitude;\n"
+" }\n"
+"\n"
+" @ManyToOne\n"
+" public PropulsionType getPropulsion() {\n"
+" return metricAltitude;\n"
+" }\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"@AttributeOverride( name=\"altitude\", column =
@Column(name=\"fld_altitude"
+"\") )\n"
+"@AssociationOverride( name=\"propulsion\", joinColumns =
@JoinColumn(name="
+"\"fld_propulsion_fk\") )\n"
+"public class Plane extends FlyingObject {\n"
+" ...\n"
+"}"
+
+#. Tag: para
+#: entity.xml:732
+#, no-c-format
+msgid ""
+"The <literal>altitude</literal> property will be persisted in an
"
+"<literal>fld_altitude</literal> column of table
<literal>Plane</literal> and "
+"the propulsion association will be materialized in a "
+"<literal>fld_propulsion_fk</literal> foreign key column."
+msgstr ""
+"La propiedad <literal>altitude</literal> será persistida en una columna
<literal>fld_altitude</literal> de la tabla
<literal>Plane</literal> y la asociación de propulsión se materializará en una
columna de clave foránea "
+"<literal>fld_propulsion_fk</literal>."
+
+#. Tag: para
+#: entity.xml:738
+#, no-c-format
+msgid ""
+"You can define <literal>@AttributeOverride</literal>(s) and "
+"<literal>@AssociationOverride</literal>(s) on
<literal>@Entity</literal> "
+"classes, <literal>@MappedSuperclass</literal> classes and properties
"
+"pointing to an <literal>@Embeddable</literal> object."
+msgstr "Puede definir <literal>@AttributeOverride</literal>(s) y
<literal>@AssociationOverride</literal>(s) en clases
<literal>@Entity</literal>, clases
<literal>@MappedSuperclass</literal> y propiedades apuntando a un objeto
<literal>(a)Embeddable</literal>."
+
+#. Tag: title
+#: entity.xml:747
+#, no-c-format
+msgid "Mapping entity bean associations/relationships"
+msgstr "Mapeo de asociaciones/relaciones de beans de entidad "
+
+#. Tag: title
+#: entity.xml:750
+#, no-c-format
+msgid "One-to-one"
+msgstr "Uno-a-uno"
+
+#. Tag: para
+#: entity.xml:752
+#, no-c-format
+msgid ""
+"You can associate entity beans through a one-to-one relationship using "
+"<literal>@OneToOne</literal>. There are three cases for one-to-one
"
+"associations: either the associated entities share the same primary keys "
+"values, a foreign key is held by one of the entities (note that this FK "
+"column in the database should be constrained unique to simulate one-to-one "
+"multiplicity), or a association table is used to store the link between the "
+"2 entities (a unique constraint has to be defined on each fk to ensure the "
+"one to one multiplicity)"
+msgstr ""
+"Puede asociar beans de entidad por medio de una relación uno-a-uno usando "
+"<literal>@OneToOne</literal>. Hay tres casos para asociaciones
uno-a-uno: ya sea que las entidades asociadas comparten los mismos valores de las claves
principales, una de las entidades tiene una clave foránea (observe que esta columna de
clave foránea en la base de datos se debe limitar como único para simular una
multiplicidad uno-a-uno) o se utiliza una tabla de asociación para almacenar el enlace
entre las dos entidades (se tiene que definir una restricción única en cada clave foránea
para asegurarse de que la multiplicidad es uno a uno)."
+
+#. Tag: para
+#: entity.xml:761
+#, no-c-format
+msgid "First, we map a real one-to-one association using shared primary keys:"
+msgstr "Primero, mapeamos una asociación real uno-a-uno usando las claves
principales compartidas:"
+
+#. Tag: programlisting
+#: entity.xml:764
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Body {\n"
+" @Id\n"
+" public Long getId() { return id; }\n"
+"\n"
+" @OneToOne(cascade = CascadeType.ALL)\n"
+" @PrimaryKeyJoinColumn\n"
+" public Heart getHeart() {\n"
+" return heart;\n"
+" }\n"
+" ...\n"
+"}"
+msgstr ""
+"@Entity\n"
+"public class Body {\n"
+" @Id\n"
+" public Long getId() { return id; }\n"
+"\n"
+" @OneToOne(cascade = CascadeType.ALL)\n"
+" @PrimaryKeyJoinColumn\n"
+" public Heart getHeart() {\n"
+" return heart;\n"
+" }\n"
+" ...\n"
+"}"
+
+#. Tag: programlisting
+#: entity.xml:766
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Heart {\n"
+" @Id\n"
+" public Long getId() { ...}\n"
+"}"
+msgstr ""
+"@Entity\n"
+"public class Heart {\n"
+" @Id\n"
+" public Long getId() { ...}\n"
+"}"
+
+#. Tag: para
+#: entity.xml:768
+#, no-c-format
+msgid ""
+"The one to one is marked as true by using the "
+"<literal>@PrimaryKeyJoinColumn</literal> annotation."
+msgstr "La uno a uno se marca como verdadera usando la anotación
<literal>(a)PrimaryKeyJoinColumn</literal>."
+
+#. Tag: para
+#: entity.xml:771
+#, no-c-format
+msgid ""
+"In the following example, the associated entities are linked through a "
+"foreign key column:"
+msgstr "En el siguiente ejemplo, las entidades asociadas se enlazan por medio de una
columna de clave foránea:"
+
+#. Tag: programlisting
+#: entity.xml:774
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Customer implements Serializable {\n"
+" @OneToOne(cascade = CascadeType.ALL)\n"
+" <emphasis
role=\"bold\">@JoinColumn(name=\"passport_fk\")</emphasis>\n"
+" public Passport getPassport() {\n"
+" ...\n"
+" }\n"
+"\n"
+"@Entity\n"
+"public class Passport implements Serializable {\n"
+" @OneToOne(<emphasis role=\"bold\">mappedBy =
\"passport\"</emphasis>)\n"
+" public Customer getOwner() {\n"
+" ...\n"
+"}"
+msgstr ""
+"@Entity\n"
+"public class Customer implements Serializable {\n"
+" @OneToOne(cascade = CascadeType.ALL)\n"
+" <emphasis
role=\"bold\">@JoinColumn(name=\"passport_fk\")</emphasis>\n"
+" public Passport getPassport() {\n"
+" ...\n"
+" }\n"
+"\n"
+"@Entity\n"
+"public class Passport implements Serializable {\n"
+" @OneToOne(<emphasis role=\"bold\">mappedBy =
\"passport\"</emphasis>)\n"
+" public Customer getOwner() {\n"
+" ...\n"
+"}"
+
+#. Tag: para
+#: entity.xml:776
+#, no-c-format
+msgid ""
+"A <classname>Customer</classname> is linked to a
<classname>Passport</"
+"classname>, with a foreign key column named
<literal>passport_fk</literal> "
+"in the <literal>Customer</literal> table. The join column is declared
with "
+"the <literal>@JoinColumn</literal> annotation which looks like the
"
+"<literal>@Column</literal> annotation. It has one more parameters named
"
+"<literal>referencedColumnName</literal>. This parameter declares the
column "
+"in the targeted entity that will be used to the join. Note that when using "
+"<literal><literal>referencedColumnName</literal></literal>
to a non primary "
+"key column, the associated class has to be
<classname>Serializable</"
+"classname>. Also note that the
<literal><literal>referencedColumnName</"
+"literal></literal> to a non primary key column has to be mapped to a
"
+"property having a single column (other cases might not work)."
+msgstr ""
+"Un <classname>Customer</classname> es enlazado a un
<classname>Passport</"
+"classname>, con una columna de clave foránea llamada
<literal>passport_fk</literal> en la tabla
<literal>Customer</literal>. La columna de unión se declara con la anotación
<literal>@JoinColumn</literal>, la cual se ve como la anotación
<literal>@Column</literal>. Tiene otro parámetro más llamado
<literal>referencedColumnName</literal>. Este parámetro declara la columna en
la entidad de destino que se utilizará para la unión. Note que al utilizar
<literal><literal>referencedColumnName</literal></literal> en una
columna que no es la clave principal, la clase asociada tiene que ser
<classname>Serializable</"
+"classname>. Observe también que el
<literal><literal>referencedColumnName</"
+"literal></literal> a una columna que no es la clave principal tiene que
ser mapeada a una propiedad que tenga una sola columna (puede que otros casos no
funcionen)."
+
+#. Tag: para
+#: entity.xml:792
+#, no-c-format
+msgid ""
+"The association may be bidirectional. In a bidirectional relationship, one "
+"of the sides (and only one) has to be the owner: the owner is responsible "
+"for the association column(s) update. To declare a side as
<emphasis>not</"
+"emphasis> responsible for the relationship, the attribute
<literal>mappedBy</"
+"literal> is used. <literal>mappedBy</literal> refers to the property
name of "
+"the association on the owner side. In our case, this is
<literal>passport</"
+"literal>. As you can see, you don't have to (must not) declare the join
"
+"column since it has already been declared on the owners side."
+msgstr ""
+"La asociación puede sre bidireccional. En una relación bidireccional, uno de los
lados (y solo uno) tiene que ser el propietario: el propietario es el responsable por la
actualización de la(s) columna(s) de asociación. Para declarar un lado como
<emphasis>no</"
+"emphasis> responsable por la relación, se utiliza el atributo
<literal>mappedBy</"
+"literal>. <literal>mappedBy</literal> se refiere al nombre de la
propiedad de la asociación en el lado del propietario. En nuestro caso, este es
<literal>passport</"
+"literal>. Como lo puede ver, no tiene que declarar la columna de unión ya que ya
se ha declarado del lado del propietario."
+
+#. Tag: para
+#: entity.xml:803
+#, no-c-format
+msgid ""
+"If no <literal>@JoinColumn</literal> is declared on the owner side, the
"
+"defaults apply. A join column(s) will be created in the owner table and its "
+"name will be the concatenation of the name of the relationship in the owner "
+"side, <keycap>_</keycap> (underscore), and the name of the primary key
column"
+"(s) in the owned side. In this example <literal>passport_id</literal>
"
+"because the property name is <literal>passport</literal> and the column
id "
+"of <literal>Passport </literal>is
<literal>id</literal>."
+msgstr ""
+"Si no se declara una <literal>@JoinColumn</literal> en el lado del
propietario, entonces los valores predeterminados aplican. Se creará(n) una(s) columna(s)
de unión en la tabla propietaria y su nombre será la concatenación del nombre de la
relación del lado del propietario, <keycap>_</keycap> (guión abajo) y el
nombre de la columna de la clave principal en el otro lado. En este ejemplo
<literal>passport_id</literal> "
+"ya que el nombre de la propiedad es <literal>passport</literal> y el id
de columna de <literal>Passport </literal> es
<literal>id</literal>."
+
+#. Tag: para
+#: entity.xml:812
+#, no-c-format
+msgid "The third possibility (using an association table) is very exotic."
+msgstr "La tercera posibilidad es muy exótica (usando una tabla de asociación).
"
+
+#. Tag: programlisting
+#: entity.xml:815
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Customer implements Serializable {\n"
+" @OneToOne(cascade = CascadeType.ALL)\n"
+" <emphasis role=\"bold\">@JoinTable(name =
\"CustomerPassports\",\n"
+" joinColumns = @JoinColumn(name=\"customer_fk\"),\n"
+" inverseJoinColumns =
@JoinColumn(name=\"passport_fk\")</emphasis>\n"
+" )\n"
+" public Passport getPassport() {\n"
+" ...\n"
+" }\n"
+"\n"
+"@Entity\n"
+"public class Passport implements Serializable {\n"
+" @OneToOne(<emphasis role=\"bold\">mappedBy =
\"passport\"</emphasis>)\n"
+" public Customer getOwner() {\n"
+" ...\n"
+"}"
+msgstr ""
+"@Entity\n"
+"public class Customer implements Serializable {\n"
+" @OneToOne(cascade = CascadeType.ALL)\n"
+" <emphasis role=\"bold\">@JoinTable(name =
\"CustomerPassports\",\n"
+" joinColumns = @JoinColumn(name=\"customer_fk\"),\n"
+" inverseJoinColumns =
@JoinColumn(name=\"passport_fk\")</emphasis>\n"
+" )\n"
+" public Passport getPassport() {\n"
+" ...\n"
+" }\n"
+"\n"
+"@Entity\n"
+"public class Passport implements Serializable {\n"
+" @OneToOne(<emphasis role=\"bold\">mappedBy =
\"passport\"</emphasis>)\n"
+" public Customer getOwner() {\n"
+" ...\n"
+"}"
+
+#. Tag: para
+#: entity.xml:817
+#, no-c-format
+msgid ""
+"A <classname>Customer</classname> is linked to a
<classname>Passport</"
+"classname> through a association table named
<literal>CustomerPassports</"
+"literal> ; this association table has a foreign key column named "
+"<literal>passport_fk</literal> pointing to the
<literal>Passport</literal> "
+"table (materialized by the <literal>inverseJoinColumn</literal>, and a
"
+"foreign key column named <literal>customer_fk</literal> pointing to the
"
+"<literal>Customer</literal> table materialized by the
<literal>joinColumns</"
+"literal> attribute."
+msgstr ""
+"Un <classname>Customer</classname> está enlazado a un
<classname>Passport</"
+"classname> por medio de una tabla de asociaciones llamada
<literal>CustomerPassports</"
+"literal> ; esta tabla de asociación tiene una columna de clave foránea llamada
<literal>passport_fk</literal> apuntando a la tabla
<literal>Passport</literal> (materializada por la
<literal>inverseJoinColumn</literal> y una columna de clave foránea llamada
<literal>customer_fk</literal> apuntando a la tabla "
+"<literal>Customer</literal> materializada por el atributo
<literal>joinColumns</"
+"literal>."
+
+#. Tag: para
+#: entity.xml:827
+#, no-c-format
+msgid ""
+"You must declare the join table name and the join columns explicitly in such
"
+"a mapping."
+msgstr "En dicho mapeo tiene que declarar el nombre de la tabla de unión y las
columnas de unión de manera explÃcita. "
+
+#. Tag: title
+#: entity.xml:832
+#, no-c-format
+msgid "Many-to-one"
+msgstr "Muchos-a-uno"
+
+#. Tag: para
+#: entity.xml:834
+#, no-c-format
+msgid ""
+"Many-to-one associations are declared at the property level with the "
+"annotation <literal>@ManyToOne</literal>:"
+msgstr "Las asociaciones muchos-a-uno se declaran a nivel de propiedad con la
anotación <literal>@ManyToOne</literal>:"
+
+#. Tag: programlisting
+#: entity.xml:837
+#, no-c-format
+msgid ""
+"@Entity()\n"
+"public class Flight implements Serializable {\n"
+" <emphasis role=\"bold\">@ManyToOne</emphasis>( cascade =
{CascadeType."
+"PERSIST, CascadeType.MERGE} )\n"
+" @JoinColumn(name=\"COMP_ID\")\n"
+" public Company getCompany() {\n"
+" return company;\n"
+" }\n"
+" ...\n"
+"}"
+msgstr ""
+"@Entity()\n"
+"public class Flight implements Serializable {\n"
+" <emphasis role=\"bold\">@ManyToOne</emphasis>( cascade =
{CascadeType."
+"PERSIST, CascadeType.MERGE} )\n"
+" @JoinColumn(name=\"COMP_ID\")\n"
+" public Company getCompany() {\n"
+" return company;\n"
+" }\n"
+" ...\n"
+"}"
+
+#. Tag: para
+#: entity.xml:839
+#, no-c-format
+msgid ""
+"The <literal>@JoinColumn</literal> attribute is optional, the default
value"
+"(s) is like in one to one, the concatenation of the name of the relationship
"
+"in the owner side, <keycap>_</keycap> (underscore), and the name of the
"
+"primary key column in the owned side. In this example
<literal>company_id</"
+"literal> because the property name is <literal>company</literal> and
the "
+"column id of Company is <literal>id</literal>."
+msgstr ""
+"El atributo <literal>@JoinColumn</literal> es opcional, el valor
predeterminado es como en uno a uno, la concatenación del nombre de la relación en el lado
del propietario, <keycap>_</keycap> (guión abajo) y el nombre de la columna de
la clave principal en el otro lado. En este ejemplo <literal>company_id</"
+"literal> ya que el nombre de la propiedad es
<literal>company</literal> y el id de columna de Company es
<literal>id</literal>."
+
+#. Tag: para
+#: entity.xml:847
+#, no-c-format
+msgid ""
+"<literal>@ManyToOne</literal> has a parameter named
<literal>targetEntity</"
+"literal> which describes the target entity name. You usually don't need this
"
+"parameter since the default value (the type of the property that stores the "
+"association) is good in almost all cases. However this is useful when you "
+"want to use interfaces as the return type instead of the regular entity."
+msgstr ""
+"<literal>@ManyToOne</literal> tiene un parámetro llamado
<literal>targetEntity</"
+"literal>, el cual describe el nombre de la entidad destino. Usualmente no
necesita este parámetro ya que el valor predeterminado (the type of the property that
stores the "
+"association) está bien en casi todos los casos. Sin embargo, esto es útil cuando
quiere usar interfaces como tipo de retorno en lugar de la entidad regular."
+
+#. Tag: programlisting
+#: entity.xml:854
+#, no-c-format
+msgid ""
+"@Entity()\n"
+"public class Flight implements Serializable {\n"
+" @ManyToOne( cascade = {CascadeType.PERSIST, CascadeType.MERGE}, "
+"<emphasis\n"
+"
role=\"bold\">targetEntity=CompanyImpl.class</emphasis> )\n"
+" @JoinColumn(name=\"COMP_ID\")\n"
+" public Company getCompany() {\n"
+" return company;\n"
+" }\n"
+" ...\n"
+"}\n"
+"\n"
+"public interface Company {\n"
+" ..."
+msgstr ""
+"@Entity()\n"
+"public class Flight implements Serializable {\n"
+" @ManyToOne( cascade = {CascadeType.PERSIST, CascadeType.MERGE}, "
+"<emphasis\n"
+"
role=\"bold\">targetEntity=CompanyImpl.class</emphasis> )\n"
+" @JoinColumn(name=\"COMP_ID\")\n"
+" public Company getCompany() {\n"
+" return company;\n"
+" }\n"
+" ...\n"
+"}\n"
+"\n"
+"public interface Company {\n"
+" ..."
+
+#. Tag: para
+#: entity.xml:856
+#, no-c-format
+msgid ""
+"You can alse map a many to one association through an association table. "
+"This association table described by the <literal>@JoinTable</literal>
"
+"annotation will contains a foreign key referencing back the entity table "
+"(through <literal>(a)JoinTable.joinColumns</literal>) and a a foreign key
"
+"referencing the target entity table (through <literal>(a)JoinTable."
+"inverseJoinColumns</literal>)."
+msgstr ""
+"También puede mapear una asociación muchos a uno por medio de una tabla de
asociaciones. Esta tabla de asociaciones descrita por la anotación
<literal>@JoinTable</literal> contendrá una referencia de clave foránea a la
tabla de entidades (por medio de <literal>(a)JoinTable.joinColumns</literal>) y
una clave foránea referenciando la tabla de entidades destino (por medio de
<literal>(a)JoinTable."
+"inverseJoinColumns</literal>)."
+
+#. Tag: programlisting
+#: entity.xml:864
+#, no-c-format
+msgid ""
+"@Entity()\n"
+"public class Flight implements Serializable {\n"
+" @ManyToOne( cascade = {CascadeType.PERSIST, CascadeType.MERGE} )\n"
+" <emphasis
role=\"bold\">@JoinTable(name=\"Flight_Company\",\n"
+" joinColumns = @JoinColumn(name=\"FLIGHT_ID\"),\n"
+" inverseJoinColumns = @JoinColumn(name=\"COMP_ID\")\n"
+" )</emphasis>\n"
+" public Company getCompany() {\n"
+" return company;\n"
+" }\n"
+" ...\n"
+"}"
+msgstr ""
+"@Entity()\n"
+"public class Flight implements Serializable {\n"
+" @ManyToOne( cascade = {CascadeType.PERSIST, CascadeType.MERGE} )\n"
+" <emphasis
role=\"bold\">@JoinTable(name=\"Flight_Company\",\n"
+" joinColumns = @JoinColumn(name=\"FLIGHT_ID\"),\n"
+" inverseJoinColumns = @JoinColumn(name=\"COMP_ID\")\n"
+" )</emphasis>\n"
+" public Company getCompany() {\n"
+" return company;\n"
+" }\n"
+" ...\n"
+"}"
+
+#. Tag: title
+#: entity.xml:868
+#, no-c-format
+msgid "Collections"
+msgstr "Colecciones"
+
+#. Tag: title
+#: entity.xml:872
+#, no-c-format
+msgid "Overview"
+msgstr "Sinopsis"
+
+#. Tag: para
+#: entity.xml:874
+#, no-c-format
+msgid ""
+"You can map <classname>Collection</classname>,
<literal>List</literal> (ie "
+"ordered lists, not indexed lists), <literal>Map</literal> and "
+"<classname>Set</classname>. The EJB3 specification describes how to map
an "
+"ordered list (ie a list ordered at load time) using <literal>(a)javax."
+"persistence.OrderBy</literal> annotation: this annotation takes into "
+"parameter a list of comma separated (target entity) properties to order the "
+"collection by (eg <code>firstname asc, age desc</code>), if the string
is "
+"empty, the collection will be ordered by id. For true indexed collections, "
+"please refer to the <xref linkend=\"entity-hibspec\"/>. EJB3 allows
you to "
+"map Maps using as a key one of the target entity property using "
+"<literal>@MapKey(name=\"myProperty\")</literal> (myProperty
is a property "
+"name in the target entity). When using <literal>@MapKey</literal>
(without "
+"property name), the target entity primary key is used. The map key uses the "
+"same column as the property pointed out: there is no additional column "
+"defined to hold the map key, and it does make sense since the map key "
+"actually represent a target property. Be aware that once loaded, the key is "
+"no longer kept in sync with the property, in other words, if you change the "
+"property value, the key will not change automatically in your Java model "
+"(for true map support please refers to <xref
linkend=\"entity-hibspec\"/>). "
+"Many people confuse <literal><map></literal> capabilities
and "
+"<literal>@MapKey</literal> ones. These are two different features.
"
+"<literal>@MapKey</literal> still has some limitations, please check the
"
+"forum or the JIRA tracking system for more informations."
+msgstr ""
+"Puede mapear <classname>Collection</classname>,
<literal>List</literal> (es decir listas ordenadas, no listas con Ãndices),
<literal>Map</literal> y <classname>Set</classname>. La
especificación EJB3 describe la manera de mapear una lista ordenada (es decir una lista
ordenada en tiempo de carga) usando la anotación <literal>(a)javax."
+"persistence.OrderBy</literal>: esta anotación toma como parámetro una lista
de propiedades separadas por comas (entidad destino) para ordenar la colección (por
ejemplo, <code>firstname asc, age desc</code>), si la cadena está vacÃa, la
colección se ordenará por id. Para colecciones con Ãndices verdaderas, consulte el
<xref linkend=\"entity-hibspec\"/>. EJB3 le permite mapear Maps usando
como clave una de las propiedades de entidad destino usando
<literal>@MapKey(name=\"myProperty\")</literal> (myProperty es un
nombre de una propiedad en la entidad destino). Al usar
<literal>@MapKey</literal> (sin el nombre de la propiedad), se utiliza la
clave principal de la entidad destino. La clave de mapeo usa la misma columna como la
propiedad lo señaló: no hay una columna adicional definida para mantener la clave de mapeo
y esto tiene sentido ya que la clave de mapeo de hecho representa una propiedad destino.
Tenga en cuenta que una vez cargado, la clave ya no se mantiene e!
n sincronización con la propiedad, en otras palabras, si cambia el valor de la propiedad,
la clave no cambiará automáticamente en su modelo Java (para soporte de mapeo verdadero
consulte <xref linkend=\"entity-hibspec\"/>). "
+"Muchas personas confunden las funcionalidades de
<literal><map></literal> y las de
<literal>@MapKey</literal>. Estas son dos funcionalidades diferentes. "
+"<literal>@MapKey</literal> todavÃa tiene algunas limitaciones, consulte
el foro el sistema de rastreo JIRA para obtener mayor información."
+
+#. Tag: para
+#: entity.xml:902
+#, no-c-format
+msgid "Hibernate has several notions of collections."
+msgstr "Hibernate tiene varias nociones de colecciones."
+
+#. Tag: title
+#: entity.xml:907
+#, no-c-format
+msgid "Collections semantics"
+msgstr "Semántica de colecciones"
+
+#. Tag: entry
+#: entity.xml:918
+#, no-c-format
+msgid "Semantic"
+msgstr "Semántica"
+
+#. Tag: entry
+#: entity.xml:920
+#, no-c-format
+msgid "java representation"
+msgstr "representación java"
+
+#. Tag: entry
+#: entity.xml:922
+#, no-c-format
+msgid "annotations"
+msgstr "anotaciones"
+
+#. Tag: entry
+#: entity.xml:928
+#, no-c-format
+msgid "Bag semantic"
+msgstr "Semántica bag"
+
+#. Tag: para
+#: entity.xml:930
+#, no-c-format
+msgid "<para>java.util.List</para>"
+msgstr "<para>java.util.List</para>"
+
+#. Tag: para
+#: entity.xml:930
+#, no-c-format
+msgid "java.util.Collection"
+msgstr "java.util.Collection"
+
+#. Tag: para
+#: entity.xml:932
+#, no-c-format
+msgid "(a)org.hibernate.annotations.CollectionOfElements"
+msgstr "(a)org.hibernate.annotations.CollectionOfElements"
+
+#. Tag: para
+#: entity.xml:932
+#, no-c-format
+msgid "or @OneToMany"
+msgstr "o @OneToMany"
+
+#. Tag: para
+#: entity.xml:932
+#, no-c-format
+msgid "or @ManyToMany"
+msgstr "o @ManyToMany"
+
+#. Tag: entry
+#: entity.xml:936
+#, no-c-format
+msgid "Bag semantic with primary key (withtout the limitations of Bag
semantic)"
+msgstr "Semántica bag con clave principal (sin las limitaciones de la semántica
Bag)"
+
+#. Tag: entry
+#: entity.xml:939
+#, no-c-format
+msgid "java.util.List, java.util.Collection"
+msgstr "java.util.List, java.util.Collection"
+
+#. Tag: entry
+#: entity.xml:941
+#, no-c-format
+msgid ""
+"((a)org.hibernate.annotations.CollectionOfElements or @OneToMany or "
+"@ManyToMany) and @CollectionId"
+msgstr ""
+"((a)org.hibernate.annotations.CollectionOfElements or @OneToMany or "
+"@ManyToMany) and @CollectionId"
+
+#. Tag: entry
+#: entity.xml:946
+#, no-c-format
+msgid "List semantic"
+msgstr "Semántica List"
+
+#. Tag: entry
+#: entity.xml:948
+#, no-c-format
+msgid "<entry>java.util.List</entry>"
+msgstr "<entry>java.util.List</entry>"
+
+#. Tag: entry
+#: entity.xml:950
+#, no-c-format
+msgid ""
+"((a)org.hibernate.annotations.CollectionOfElements or @OneToMany or "
+"@ManyToMany) and @org.hibernate.annotations.IndexColumn"
+msgstr ""
+"((a)org.hibernate.annotations.CollectionOfElements or @OneToMany or "
+"@ManyToMany) and @org.hibernate.annotations.IndexColumn"
+
+#. Tag: entry
+#: entity.xml:956
+#, no-c-format
+msgid "Set semantic"
+msgstr "Configurar la semántica"
+
+#. Tag: entry
+#: entity.xml:958
+#, no-c-format
+msgid "java.util.Set"
+msgstr "java.util.Set"
+
+#. Tag: entry
+#: entity.xml:960
+#, no-c-format
+msgid "(a)org.hibernate.annotations.CollectionOfElements or @OneToMany or
@ManyToMany"
+msgstr "(a)org.hibernate.annotations.CollectionOfElements or @OneToMany or
@ManyToMany"
+
+#. Tag: entry
+#: entity.xml:965
+#, no-c-format
+msgid "Map semantic"
+msgstr "Semántica de mapeo"
+
+#. Tag: entry
+#: entity.xml:967
+#, no-c-format
+msgid "java.util.Map"
+msgstr "java.util.Map"
+
+#. Tag: entry
+#: entity.xml:969
+#, no-c-format
+msgid ""
+"((a)org.hibernate.annotations.CollectionOfElements or @OneToMany or "
+"@ManyToMany) and (nothing or @org.hibernate.annotations.MapKey/"
+"MapKeyManyToMany for true map support, OR @javax.persistence.MapKey"
+msgstr ""
+"((a)org.hibernate.annotations.CollectionOfElements o @OneToMany o "
+"@ManyToMany) y (nada o @org.hibernate.annotations.MapKey/"
+"MapKeyManyToMany para soporte de mapeo verdadero o @javax.persistence.MapKey"
+
+#. Tag: remark
+#: entity.xml:978
+#, no-c-format
+msgid ""
+"So specifically, java.util.List collections without @org.hibernate."
+"annotations.IndexColumn are going to be considered as bags."
+msgstr ""
+"Asà que especificamente, las colecciones java.util.List sin @org.hibernate."
+"annotations.IndexColumn se considerarán como bags."
+
+#. Tag: para
+#: entity.xml:982
+#, no-c-format
+msgid ""
+"Collection of primitive, core type or embedded objects is not supported by "
+"the EJB3 specification. Hibernate Annotations allows them however (see <xref
"
+"linkend=\"entity-hibspec\"/>)."
+msgstr ""
+"La especificación EJB3 no soporta la colección de objetos primitivos, de tipo
central o incluÃdo. Sin embargo, Hibernate Annotations los permite (consulte <xref
"
+"linkend=\"entity-hibspec\"/>)."
+
+#. Tag: programlisting
+#: entity.xml:986
+#, no-c-format
+msgid ""
+"@Entity public class City {\n"
+" @OneToMany(mappedBy=\"city\")\n"
+" <emphasis
role=\"bold\">@OrderBy(\"streetName\")</emphasis>\n"
+" public List<Street> getStreets() {\n"
+" return streets;\n"
+" }\n"
+"...\n"
+"}\n"
+"\n"
+"@Entity public class Street {\n"
+" <emphasis role=\"bold\">public String
getStreetName()</emphasis> {\n"
+" return streetName;\n"
+" }\n"
+"\n"
+" @ManyToOne\n"
+" public City getCity() {\n"
+" return city;\n"
+" }\n"
+" ...\n"
+"}\n"
+"\n"
+"\n"
+"@Entity\n"
+"public class Software {\n"
+" @OneToMany(mappedBy=\"software\")\n"
+" <emphasis
role=\"bold\">@MapKey(name=\"codeName\")</emphasis>\n"
+" public Map<String, Version> getVersions() {\n"
+" return versions;\n"
+" }\n"
+"...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"@Table(name=\"tbl_version\")\n"
+"public class Version {\n"
+" <emphasis role=\"bold\">public String
getCodeName()</emphasis> {...}\n"
+"\n"
+" @ManyToOne\n"
+" public Software getSoftware() { ... }\n"
+"...\n"
+"}"
+msgstr ""
+"@Entity public class City {\n"
+" @OneToMany(mappedBy=\"city\")\n"
+" <emphasis
role=\"bold\">@OrderBy(\"streetName\")</emphasis>\n"
+" public List<Street> getStreets() {\n"
+" return streets;\n"
+" }\n"
+"...\n"
+"}\n"
+"\n"
+"@Entity public class Street {\n"
+" <emphasis role=\"bold\">public String
getStreetName()</emphasis> {\n"
+" return streetName;\n"
+" }\n"
+"\n"
+" @ManyToOne\n"
+" public City getCity() {\n"
+" return city;\n"
+" }\n"
+" ...\n"
+"}\n"
+"\n"
+"\n"
+"@Entity\n"
+"public class Software {\n"
+" @OneToMany(mappedBy=\"software\")\n"
+" <emphasis
role=\"bold\">@MapKey(name=\"codeName\")</emphasis>\n"
+" public Map<String, Version> getVersions() {\n"
+" return versions;\n"
+" }\n"
+"...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"@Table(name=\"tbl_version\")\n"
+"public class Version {\n"
+" <emphasis role=\"bold\">public String
getCodeName()</emphasis> {...}\n"
+"\n"
+" @ManyToOne\n"
+" public Software getSoftware() { ... }\n"
+"...\n"
+"}"
+
+#. Tag: para
+#: entity.xml:988
+#, no-c-format
+msgid ""
+"So <literal>City</literal> has a collection of
<literal>Street</literal>s "
+"that are ordered by <literal>streetName</literal> (of
<literal>Street</"
+"literal>) when the collection is loaded. <literal>Software</literal>
has a "
+"map of <literal>Version</literal>s which key is the
<literal>Version</"
+"literal> <literal>codeName</literal>."
+msgstr ""
+"Asà que <literal>City</literal> tiene una colección de
<literal>Street</literal>s "
+"que están ordenas por <literal>streetName</literal> (de
<literal>Street</"
+"literal>) cuando la colección se carga. <literal>Software</literal>
tiene un mapa de <literal>Version</literal>es, cuya clave es la
<literal>Version</"
+"literal> <literal>codeName</literal>."
+
+#. Tag: para
+#: entity.xml:995
+#, no-c-format
+msgid ""
+"Unless the collection is a generic, you will have to define "
+"<literal>targetEntity</literal>. This is a annotation attribute that
take "
+"the target entity class as a value."
+msgstr "A menos de que la colección sea genérica, tendrá que definir
<literal>targetEntity</literal>. Este es un atributo de anotación que toma la
clase de la entidad de destino como un valor."
+
+#. Tag: title
+#: entity.xml:1002
+#, no-c-format
+msgid "One-to-many"
+msgstr "Uno-a-muchos"
+
+#. Tag: para
+#: entity.xml:1004
+#, no-c-format
+msgid ""
+"One-to-many associations are declared at the property level with the "
+"annotation <literal>@OneToMany</literal>. One to many associations may
be "
+"bidirectional."
+msgstr "Las asociaciones uno-a-muchos se declaran a nivel de propiedad con la
anotación <literal>@OneToMany</literal>. Las asociaciones uno a muchos pueden
ser bidireccionales."
+
+#. Tag: sect4
+#: entity.xml:1006
+#, no-c-format
+msgid ""
+"<sect5> <title>Bidirectional</title> <para>Since many to
one are (almost) "
+"always the owner side of a bidirectional relationship in the EJB3 spec, the "
+"one to many association is annotated by <literal>@OneToMany( mappedBy=...
)</"
+"literal></para> <programlisting>@Entity\n"
+"public class Troop {\n"
+" @OneToMany(mappedBy=\"troop\")\n"
+" public Set<Soldier> getSoldiers() {\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Soldier {\n"
+" @ManyToOne\n"
+" @JoinColumn(name=\"troop_fk\")\n"
+" public Troop getTroop() {\n"
+" ...\n"
+"} </programlisting>
<para><classname>Troop</classname> has a "
+"bidirectional one to many relationship with <literal>Soldier</literal>
"
+"through the <literal>troop</literal> property. You don't have to
(must not) "
+"define any physical mapping in the <literal>mappedBy</literal>
side.</para> "
+"<para>To map a bidirectional one to many, with the one-to-many side as the
"
+"owning side, you have to remove the <literal>mappedBy</literal> element
and "
+"set the many to one <literal>@JoinColumn</literal> as insertable and
"
+"updatable to false. This solution is obviously not optimized and will "
+"produce some additional UPDATE statements.</para>
<programlisting>@Entity\n"
+"public class Troop {\n"
+" @OneToMany\n"
+" @JoinColumn(name=\"troop_fk\") //we need to duplicate the physical
"
+"information\n"
+" public Set<Soldier> getSoldiers() {\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Soldier {\n"
+" @ManyToOne\n"
+" @JoinColumn(name=\"troop_fk\", insertable=false,
updatable=false)\n"
+" public Troop getTroop() {\n"
+" ...\n"
+"}</programlisting> </sect5> <sect5>
<title>Unidirectional</title> <para>A "
+"unidirectional one to many using a foreign key column in the owned entity is
"
+"not that common and not really recommended. We strongly advise you to use a "
+"join table for this kind of association (as explained in the next section). "
+"This kind of association is described through a
<literal>@JoinColumn</"
+"literal></para> <programlisting>\n"
+"@Entity\n"
+"public class Customer implements Serializable {\n"
+" @OneToMany(cascade=CascadeType.ALL, fetch=FetchType.EAGER)\n"
+" @JoinColumn(name=\"CUST_ID\")\n"
+" public Set<Ticket> getTickets() {\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Ticket implements Serializable {\n"
+" ... //no bidir\n"
+"}\n"
+" </programlisting>
<para><literal>Customer</literal> describes "
+"a unidirectional relationship with <literal>Ticket</literal> using the
join "
+"column <literal>CUST_ID</literal>.</para> </sect5>
<sect5> "
+"<title>Unidirectional with join table</title> <para>A
unidirectional one to "
+"many with join table is much preferred. This association is described "
+"through an <literal>(a)JoinTable</literal>.</para>
<programlisting>\n"
+"@Entity\n"
+"public class Trainer {\n"
+" @OneToMany\n"
+" @JoinTable(\n"
+" name=\"TrainedMonkeys\",\n"
+" joinColumns = @JoinColumn( name=\"trainer_id\"),\n"
+" inverseJoinColumns = @JoinColumn(
name=\"monkey_id\")\n"
+" )\n"
+" public Set<Monkey> getTrainedMonkeys() {\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Monkey {\n"
+" ... //no bidir\n"
+"}\n"
+" </programlisting>
<para><literal>Trainer</literal> describes "
+"a unidirectional relationship with <classname>Monkey</classname> using
the "
+"join table <classname>TrainedMonkeys</classname>, with a foreign key
"
+"<literal>trainer_id</literal> to <literal>Trainer</literal>
"
+"(<literal>joinColumns</literal>) and a foreign key
<literal>monkey_id</"
+"literal> to <literal>Monkey</literal>
(<literal>inversejoinColumns</"
+"literal>).</para> </sect5> <sect5
id=\"entity-mapping-association-collection-"
+"manytomany-default\" revision=\"1\">
<title>Defaults</title> <para>Without "
+"describing any physical mapping, a unidirectional one to many with join "
+"table is used. The table name is the concatenation of the owner table name, "
+"<keycap>_</keycap>, and the other side table name. The foreign key
name(s) "
+"referencing the owner table is the concatenation of the owner table, "
+"<keycap>_</keycap>, and the owner primary key column(s) name. The
foreign "
+"key name(s) referencing the other side is the concatenation of the owner "
+"property name, <keycap>_</keycap>, and the other side primary key
column(s) "
+"name. A unique constraint is added to the foreign key referencing the other "
+"side table to reflect the one to many.</para> <programlisting>\n"
+"@Entity\n"
+"public class Trainer {\n"
+" @OneToMany\n"
+" public Set<Tiger> getTrainedTigers() {\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Tiger {\n"
+" ... //no bidir\n"
+"}\n"
+" </programlisting>
<para><classname>Trainer</classname> "
+"describes a unidirectional relationship with
<classname>Tiger</classname> "
+"using the join table <literal>Trainer_Tiger</literal>, with a foreign
key "
+"<literal>trainer_id</literal> to <literal>Trainer</literal>
(table name, "
+"<keycap>_</keycap>, trainer id) and a foreign key
<literal>trainedTigers_id</"
+"literal> to <literal>Monkey</literal> (property name,
<keycap>_</keycap>, "
+"Tiger primary column).</para> </sect5>"
+msgstr ""
+"<sect5> <title>Bidirectional</title> <para>Ya que muchos a
uno son (casi) "
+"siempre el lado propietario de una relación bidireccional en la especificación
EJB3, la asociación uno a muchos es anotada por <literal>@OneToMany( mappedBy=...
)</"
+"literal></para> <programlisting>@Entity\n"
+"public class Troop {\n"
+" @OneToMany(mappedBy=\"troop\")\n"
+" public Set<Soldier> getSoldiers() {\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Soldier {\n"
+" @ManyToOne\n"
+" @JoinColumn(name=\"troop_fk\")\n"
+" public Troop getTroop() {\n"
+" ...\n"
+"} </programlisting>
<para><classname>Troop</classname> tiene una relación bidireccional uno
a muchos con <literal>Soldier</literal> por medio de la propiedad
<literal>troop</literal>. No tiene que "
+"definir ningún mapeo fÃsico en el lado
<literal>mappedBy</literal>.</para> "
+"<para>Para mapear una a muchos bidireccional, con el lado uno-a-muchos como
el lado propietario, tiene que borrar el elemento <literal>mappedBy</literal>
y configurar la <literal>@JoinColumn</literal> muchos a uno como insertable y
actualizable como falso. Esta solución claramente no está optimizada y producirá algunas
declaraciones UPDATE adicionales.</para> <programlisting>@Entity\n"
+"public class Troop {\n"
+" @OneToMany\n"
+" @JoinColumn(name=\"troop_fk\") //necesitamos duplicar la información
fÃsica\n"
+" public Set<Soldier> getSoldiers() {\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Soldier {\n"
+" @ManyToOne\n"
+" @JoinColumn(name=\"troop_fk\", insertable=false,
updatable=false)\n"
+" public Troop getTroop() {\n"
+" ...\n"
+"}</programlisting> </sect5> <sect5>
<title>Unidirectional</title> <para>Una una a muchos unidireccional
usando una columna de clave foránea en la entidad apropiada no es tan común y realmente no
se recomienda. Le aconsejamos que use una tabla de unión para esta clase de asociación
(como lo vamos a explicar en la siguiente sección). Esta clase de asociación se describe
por medio de una <literal>@JoinColumn</"
+"literal></para> <programlisting>\n"
+"@Entity\n"
+"public class Customer implements Serializable {\n"
+" @OneToMany(cascade=CascadeType.ALL, fetch=FetchType.EAGER)\n"
+" @JoinColumn(name=\"CUST_ID\")\n"
+" public Set<Ticket> getTickets() {\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Ticket implements Serializable {\n"
+" ... //no bidir\n"
+"}\n"
+" </programlisting>
<para><literal>Customer</literal> describe una relación unidireccional
con <literal>Ticket</literal> usando la columna de unión
<literal>CUST_ID</literal>.</para> </sect5> <sect5> "
+"<title>Unidireccional con tabla de unión</title> <para>Se
prefiere una una a muchos unidireccional con tabla de unión. Esta asociación se describe
por medio de un <literal>(a)JoinTable</literal>.</para>
<programlisting>\n"
+"@Entity\n"
+"public class Trainer {\n"
+" @OneToMany\n"
+" @JoinTable(\n"
+" name=\"TrainedMonkeys\",\n"
+" joinColumns = @JoinColumn( name=\"trainer_id\"),\n"
+" inverseJoinColumns = @JoinColumn(
name=\"monkey_id\")\n"
+" )\n"
+" public Set<Monkey> getTrainedMonkeys() {\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Monkey {\n"
+" ... //no bidir\n"
+"}\n"
+" </programlisting>
<para><literal>Trainer</literal> describe una relación unidireccional
con <classname>Monkey</classname> usando la tabla de unión
<classname>TrainedMonkeys</classname>, con una clave foránea
<literal>trainer_id</literal> a <literal>Trainer</literal> "
+"(<literal>joinColumns</literal>) y una clave foránea
<literal>monkey_id</"
+"literal> a <literal>Monkey</literal>
(<literal>inversejoinColumns</"
+"literal>).</para> </sect5> <sect5
id=\"entity-mapping-association-collection-"
+"manytomany-default\" revision=\"1\">
<title>Predeterminados</title> <para>Sin describir ningun mapeo fÃsico,
se utiliza un uno a muchos unidireccional con tabla de unión. El nombre de la tabla es la
concatenación del nombre de la tabla del propietario, "
+"<keycap>_</keycap>, y el nombre de la tabla del otro lado. Los nombres
de la clave foránea que referencia la tabla propietaria es la concatenación de la tabla
propietaria, "
+"<keycap>_</keycap>, y el nombre de la(s) columna(s) clave principal. El
nombre de la clave foránea referenciando el otro lado es la concatenación del nombre de la
propiedad del propietario, <keycap>_</keycap>, y el nombre de la(s) columna(s)
de clave principal del otro lado. Se agrega una restricción única a la clave foránea que
referencia el otro lado de la tabla para reflejar el uno a muchos.</para>
<programlisting>\n"
+"@Entity\n"
+"public class Trainer {\n"
+" @OneToMany\n"
+" public Set<Tiger> getTrainedTigers() {\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Tiger {\n"
+" ... //no bidir\n"
+"}\n"
+" </programlisting>
<para><classname>Trainer</classname> "
+"describe una relación unidireccional con <classname>Tiger</classname>
usando la tabla de unión <literal>Trainer_Tiger</literal>, con una clave
foránea <literal>trainer_id</literal> a <literal>Trainer</literal>
(nombre de la tabla, "
+"<keycap>_</keycap>, id de entrenador -trainer) y una clave foránea
<literal>trainedTigers_id</"
+"literal> a <literal>Monkey</literal> (nombre de la propiedad,
<keycap>_</keycap>, "
+"columna principal Tiger).</para> </sect5>"
+
+#. Tag: title
+#: entity.xml:1099
+#, no-c-format
+msgid "Many-to-many"
+msgstr "Muchos-a-muchos"
+
+#. Tag: sect4
+#: entity.xml:1099
+#, no-c-format
+msgid ""
+"<sect5> <title>Definition</title> <para>A many-to-many
association is "
+"defined logically using the <literal>@ManyToMany</literal> annotation.
You "
+"also have to describe the association table and the join conditions using "
+"the <literal>@JoinTable</literal> annotation. If the association is
"
+"bidirectional, one side has to be the owner and one side has to be the "
+"inverse end (ie. it will be ignored when updating the relationship values in
"
+"the association table):</para> <programlisting>\n"
+"@Entity\n"
+"public class Employer implements Serializable {\n"
+" @ManyToMany(\n"
+"
targetEntity=org.hibernate.test.metadata.manytomany.Employee.class,\n"
+" cascade={CascadeType.PERSIST, CascadeType.MERGE}\n"
+" )\n"
+" @JoinTable(\n"
+" name=\"EMPLOYER_EMPLOYEE\",\n"
+" joinColumns=@JoinColumn(name=\"EMPER_ID\"),\n"
+" inverseJoinColumns=@JoinColumn(name=\"EMPEE_ID\")\n"
+" )\n"
+" public Collection getEmployees() {\n"
+" return employees;\n"
+" }\n"
+" ...\n"
+"}\n"
+" </programlisting> <programlisting>\n"
+"@Entity\n"
+"public class Employee implements Serializable {\n"
+" @ManyToMany(\n"
+" cascade = {CascadeType.PERSIST, CascadeType.MERGE},\n"
+" mappedBy = \"employees\",\n"
+" targetEntity = Employer.class\n"
+" )\n"
+" public Collection getEmployers() {\n"
+" return employers;\n"
+" }\n"
+"}\n"
+" </programlisting> <para>We've already shown the many
"
+"declarations and the detailed attributes for associations. We'll go deeper
"
+"in the <literal>@JoinTable</literal> description, it defines a "
+"<literal>name</literal>, an array of join columns (an array in
annotation is "
+"defined using { A, B, C }), and an array of inverse join columns. The latter
"
+"ones are the columns of the association table which refer to the "
+"<classname>Employee</classname> primary key (the \"other
side\").</para> "
+"<para>As seen previously, the other side don't have to (must not)
describe "
+"the physical mapping: a simple <literal>mappedBy</literal> argument
"
+"containing the owner side property name bind the two.</para> </sect5>
"
+"<sect5> <title>Default values</title> <para>As any other
annotations, most "
+"values are guessed in a many to many relationship. Without describing any "
+"physical mapping in a unidirectional many to many the following rules "
+"applied. The table name is the concatenation of the owner table name, "
+"<keycap>_</keycap> and the other side table name. The foreign key
name(s) "
+"referencing the owner table is the concatenation of the owner table name, "
+"<keycap>_</keycap> and the owner primary key column(s). The foreign key
name"
+"(s) referencing the other side is the concatenation of the owner property "
+"name, <keycap>_</keycap>, and the other side primary key column(s).
These "
+"are the same rules used for a unidirectional one to many relationship.</"
+"para> <programlisting>\n"
+"@Entity\n"
+"public class Store {\n"
+" @ManyToMany(cascade = CascadeType.PERSIST)\n"
+" public Set<City> getImplantedIn() {\n"
+" ...\n"
+" }\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class City {\n"
+" ... //no bidirectional relationship\n"
+"}\n"
+" </programlisting> <para>A
<literal>Store_City</literal> is "
+"used as the join table. The <literal>Store_id</literal> column is a
foreign "
+"key to the <literal>Store</literal> table. The
<literal>implantedIn_id</"
+"literal> column is a foreign key to the <literal>City</literal>
table.</"
+"para> <para>Without describing any physical mapping in a bidirectional
many "
+"to many the following rules applied. The table name is the concatenation of "
+"the owner table name, <keycap>_</keycap> and the other side table name.
The "
+"foreign key name(s) referencing the owner table is the concatenation of the "
+"other side property name, <keycap>_</keycap>, and the owner primary key
"
+"column(s). The foreign key name(s) referencing the other side is the "
+"concatenation of the owner property name, <keycap>_</keycap>, and the
other "
+"side primary key column(s). These are the same rules used for a "
+"unidirectional one to many relationship.</para>
<programlisting>\n"
+"@Entity\n"
+"public class Store {\n"
+" @ManyToMany(cascade = {CascadeType.PERSIST, CascadeType.MERGE})\n"
+" public Set<Customer> getCustomers() {\n"
+" ...\n"
+" }\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Customer {\n"
+" @ManyToMany(mappedBy=\"customers\")\n"
+" public Set<Store> getStores() {\n"
+" ...\n"
+" }\n"
+"}\n"
+" </programlisting> <para>A
<literal>Store_Customer</literal> "
+"is used as the join table. The <literal>stores_id</literal> column is a
"
+"foreign key to the <literal>Store</literal> table. The "
+"<literal>customers_id</literal> column is a foreign key to the "
+"<literal>Customer</literal> table.</para> </sect5>"
+msgstr ""
+"<sect5> <title>Definition</title> <para>Una asociación
muchos a muchos se define lógicamente usando la anotación
<literal>@ManyToMany</literal>. Tmabién tiene que describir la tabla de
asociación y las condiciones de unión usando la anotación
<literal>@JoinTable</literal>. Si la asociación es "
+"bidireccional, un lado tiene que ser el dueño y otro lado tiene que ser el inverso
(es decir que será ignorado al actualizar los valores de la relación en la tabla de
asociaciones):</para> <programlisting>\n"
+"@Entity\n"
+"public class Employer implements Serializable {\n"
+" @ManyToMany(\n"
+"
targetEntity=org.hibernate.test.metadata.manytomany.Employee.class,\n"
+" cascade={CascadeType.PERSIST, CascadeType.MERGE}\n"
+" )\n"
+" @JoinTable(\n"
+" name=\"EMPLOYER_EMPLOYEE\",\n"
+" joinColumns=@JoinColumn(name=\"EMPER_ID\"),\n"
+" inverseJoinColumns=@JoinColumn(name=\"EMPEE_ID\")\n"
+" )\n"
+" public Collection getEmployees() {\n"
+" return employees;\n"
+" }\n"
+" ...\n"
+"}\n"
+" </programlisting> <programlisting>\n"
+"@Entity\n"
+"public class Employee implements Serializable {\n"
+" @ManyToMany(\n"
+" cascade = {CascadeType.PERSIST, CascadeType.MERGE},\n"
+" mappedBy = \"employees\",\n"
+" targetEntity = Employer.class\n"
+" )\n"
+" public Collection getEmployers() {\n"
+" return employers;\n"
+" }\n"
+"}\n"
+" </programlisting> <para>Ya hemos mostrado las muchas
declaraciones y los atributos detallados para las asociaciones. Vamos a profundizar en la
descripción <literal>@JoinTable</literal>, define un "
+"<literal>name</literal>, un array de columnas de unión (un array en
anotación se "
+"define usando { A, B, C }), y un array de columnas de unión inversas. Las últimas
son las columnas de la tabla de asociación, las cuales se refieren a la clave principal
<classname>Employee</classname> (el \"otro lado\").</para>
"
+"<para>Como lo vimos anteriormente, el otro lado no tiene que describir el
mapeo fÃsico: un argumento <literal>mappedBy</literal> simple que contiene el
nombre de la propiedad del lado del propietario enlaza a los dos.</para>
</sect5> "
+"<sect5> <title>Valores predeterminados</title> <para>Como
cualquier otra anotacións, la mayorÃa de los "
+"valores se advinan en una relación muchos a muchos. Sin describir ningun mapeo
fÃsico en un muchos a muchos unidireccional las siguientes reglas se aplican. El nombre de
la tabla es la concatenación del nombre de la tabla propietaria, "
+"<keycap>_</keycap> y el nombre de la tabla del otro lado. Los nombres
de la clave foránea referenciando la tabla propietaria es la concatenación del nombre de
la tabla propietaria, "
+"<keycap>_</keycap> y las columnas de la clave principal propietaria. El
nombre de la clave foránea referenciando el otro lado es la concatenación del nombre de la
propiedad propietaria, <keycap>_</keycap>, y las columnas de la clave
principal del otro lado. Estas son las mismas reglas que se utilizan para una relación
unidireccional uno a muchos.</"
+"para> <programlisting>\n"
+"@Entity\n"
+"public class Store {\n"
+" @ManyToMany(cascade = CascadeType.PERSIST)\n"
+" public Set<City> getImplantedIn() {\n"
+" ...\n"
+" }\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class City {\n"
+" ... //relación no bidireccional\n"
+"}\n"
+" </programlisting> <para>Un
<literal>Store_City</literal> se utiliza como la tabla de unión. La columna
<literal>Store_id</literal> es una clave foránea a la tabla
<literal>Store</literal>. La columna <literal>implantedIn_id</"
+"literal> es una clave foránea a la tabla
<literal>City</literal>.</"
+"para> <para>Sin describir ningun mapeo fÃsico en un muchos a muchos
bidireccional las siguientes reglas aplican. El nombre de la tabla es la concatenación del
nombre de la tabla del propietario, <keycap>_</keycap> y el nombre de la tabla
del otro lado. El nombre de la clave foránea referenciando la tabla propietaria es la
concatenación del nombre de la propiedad del otro lado, <keycap>_</keycap>, y
las columnas de la clave principal propietaria. Los nombres de clave foránea referenciando
el otro lado es la concatenación del nombre de la propiedad propietaria,
<keycap>_</keycap>, y el otro lado de las columas de la clave principal. Estas
son las mismas reglas utilizadas para una relación uno a muchos
unidireccional.</para> <programlisting>\n"
+"@Entity\n"
+"public class Store {\n"
+" @ManyToMany(cascade = {CascadeType.PERSIST, CascadeType.MERGE})\n"
+" public Set<Customer> getCustomers() {\n"
+" ...\n"
+" }\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Customer {\n"
+" @ManyToMany(mappedBy=\"customers\")\n"
+" public Set<Store> getStores() {\n"
+" ...\n"
+" }\n"
+"}\n"
+" </programlisting> <para>Un
<literal>Store_Customer</literal> se utiliza como la tabla de unión. La
columna <literal>stores_id</literal> es una clave foránea a la tabla
<literal>Store</literal>. La columna
<literal>customers_id</literal> es una clave foránea a la tabla
<literal>Customer</literal> table.</para> </sect5>"
+
+#. Tag: title
+#: entity.xml:1177
+#, no-c-format
+msgid "Transitive persistence with cascading"
+msgstr "Persistencia transitiva con cascadas"
+
+#. Tag: para
+#: entity.xml:1179
+#, no-c-format
+msgid ""
+"You probably have noticed the <literal>cascade</literal> attribute
taking an "
+"array of <classname>CascadeType</classname> as a value. The cascade
concept "
+"in EJB3 is very is similar to the transitive persistence and cascading of "
+"operations in Hibernate, but with slightly different semantics and cascading
"
+"types:"
+msgstr ""
+"Probablemente habrá notado que el atributo <literal>cascade</literal>
toma un "
+"array de <classname>CascadeType</classname> como valor. El concepto de
cascada en EJB3 es muy similar a la persistencia transitiva y el uso de cascadas de las
operaciones en Hibernate, pero con una semántica y tipos de cascadas un poco
diferentes:"
+
+#. Tag: para
+#: entity.xml:1187
+#, no-c-format
+msgid ""
+"CascadeType.PERSIST: cascades the persist (create) operation to associated "
+"entities persist() is called or if the entity is managed"
+msgstr "CascadeType.PERSIST: usa cascadas para la operación de persistencia (crear)
a las entidades asociadas se llama a persist() o si la entidad es administrada"
+
+#. Tag: para
+#: entity.xml:1192
+#, no-c-format
+msgid ""
+"CascadeType.MERGE: cascades the merge operation to associated entities if "
+"merge() is called or if the entity is managed"
+msgstr "CascadeType.MERGE: usa cascadas para la operación merge a las entidades
asociadas si se llama a merge() o si la entidad es administrada"
+
+#. Tag: para
+#: entity.xml:1197
+#, no-c-format
+msgid ""
+"CascadeType.REMOVE: cascades the remove operation to associated entities if "
+"delete() is called"
+msgstr "CascadeType.REMOVE: usa cascadas en la operación de eliminación a las
entidades asociadas si se llama a delete()"
+
+#. Tag: para
+#: entity.xml:1202
+#, no-c-format
+msgid ""
+"CascadeType.REFRESH: cascades the refresh operation to associated entities "
+"if refresh() is called"
+msgstr "CascadeType.REFRESH: usa cascadas para la operación de actualización a las
entidades asociadas si se llama a refresh()"
+
+#. Tag: para
+#: entity.xml:1207
+#, no-c-format
+msgid "CascadeType.ALL: all of the above"
+msgstr "CascadeType.ALL: todas las anteriores"
+
+#. Tag: para
+#: entity.xml:1213
+#, no-c-format
+msgid ""
+"CascadeType.ALL also covers Hibernate specific operations like save-update, "
+"lock etc... Check <xref linkend=\"entity-hibspec-cascade\"/> for
more "
+"information"
+msgstr ""
+"CascadeType.ALL también cubre operaciones especificas de Hibernate como
save-update, "
+"lock etc... Consulte <xref linkend=\"entity-hibspec-cascade\"/>
para obtener mayor información"
+
+#. Tag: para
+#: entity.xml:1218
+#, no-c-format
+msgid ""
+"Please refer to the chapter 6.3 of the EJB3 specification for more "
+"information on cascading and create/merge semantics."
+msgstr "Consulte el capÃtulo 6.3 de la especificación EJB3 para obtener mayor
información sobre cascadas y la semántica create/merge."
+
+#. Tag: title
+#: entity.xml:1223
+#, no-c-format
+msgid "Association fetching"
+msgstr "Búsqueda de asociaciones"
+
+#. Tag: para
+#: entity.xml:1225
+#, no-c-format
+#, fuzzy
+msgid ""
+"You have the ability to either eagerly or lazily fetch associated entities. "
+"The <literal>fetch</literal> parameter can be set to
<literal>FetchType."
+"LAZY</literal> or <literal>FetchType.EAGER</literal>.
<literal>EAGER</"
+"literal> will try to use an outer join select to retrieve the associated "
+"object, while <literal>LAZY</literal> will only trigger a select when
the "
+"associated object is accessed for the first time.
<literal>@OneToMany</"
+"literal> and <literal>@ManyToMany</literal> associations are
defaulted to "
+"<literal>LAZY</literal> and <literal>@OneToOne</literal>
and "
+"<literal>@ManyToOne</literal> are defaulted to
<literal>EAGER</literal>. For "
+"more information about static fetching, check <xref
linkend=\"entity-hibspec-"
+"singleassoc-fetching\"/>."
+msgstr ""
+"Tiene la habilidad para realizar búsquedas perezosas o eagerly or lazily fetch
associated entities. "
+"El parámetro <literal>fetch</literal> se puede configurar como
<literal>FetchType."
+"LAZY</literal> o <literal>FetchType.EAGER</literal>.
<literal>EAGER</"
+"literal> tratará de utilizar un select de unión externa para recuperar el objeto
asociado, mientras que <literal>LAZY</literal> solo disparará un select cuando
se acceda por primera vez al objeto asociado. Las asociaciones
<literal>@OneToMany</"
+"literal> y <literal>@ManyToMany</literal> por defecto utilizan
<literal>LAZY</literal> y <literal>@OneToOne</literal> y "
+"<literal>@ManyToOne</literal> por defecto utiliza
<literal>EAGER</literal>. Para obtener mayor información sobre la búsqueda
estática, consulte <xref linkend=\"entity-hibspec-"
+"singleassoc-fetching\"/>."
+
+#. Tag: para
+#: entity.xml:1238
+#, no-c-format
+msgid ""
+"The recommanded approach is to use <literal>LAZY</literal> onn all
static "
+"fetching definitions and override this choice dynamically through JPA-QL. "
+"JPA-QL has a <literal>fetch</literal> keyword that allows you to
override "
+"laziness when doing a particular query. This is very useful to improve "
+"performance and is decided on a use case to use case basis."
+msgstr ""
+"El enfoque recomendado es utilizar <literal>LAZY</literal> en todas las
definiciones de búsqueda estatica "
+"y sobreescribir esta elección dinámicamente por medio de JPA-QL. JPA-QL tiene una
palabra clave <literal>fetch</literal> que le permite sobreescribir perezoso
al realizar una petición en particular. Esto es bastante útil para mejorar el rendimiento
y se utiliza dependiendo de cada caso."
+
+#. Tag: title
+#: entity.xml:1248
+#, no-c-format
+msgid "Mapping composite primary and foreign keys"
+msgstr "Mapeo de claves principales compuestas y claves foráneas"
+
+#. Tag: para
+#: entity.xml:1250
+#, no-c-format
+msgid ""
+"Composite primary keys use a embedded class as the primary key "
+"representation, so you'd use the <literal>@Id</literal> and "
+"<literal>@Embeddable</literal> annotations. Alternatively, you can use
the "
+"<literal>@EmbeddedId</literal> annotation. Note that the dependent
class has "
+"to be serializable and implements
<methodname>equals()</methodname>/"
+"<methodname>hashCode()</methodname>. You can also use
<literal>@IdClass</"
+"literal> as described in <xref
linkend=\"entity-mapping-identifier\"/>."
+msgstr ""
+"Las claves principales compuestas usan una clase incluÃda como la representanción
de clave principal asà que usted utilizarÃa las anotaciones
<literal>@Id</literal> y <literal>@Embeddable</literal>.
Opcionalmente, puede utilizar la anotación <literal>@EmbeddedId</literal>.
Observe que la clase dependiente tiene que ser serializable e implementa
<methodname>equals()</methodname>/"
+"<methodname>hashCode()</methodname>. También puede usar
<literal>@IdClass</"
+"literal> tal como se describe en <xref
linkend=\"entity-mapping-identifier\"/>."
+
+#. Tag: programlisting
+#: entity.xml:1259
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class RegionalArticle implements Serializable {\n"
+"\n"
+" @Id\n"
+" public RegionalArticlePk getPk() { ... }\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"public class RegionalArticlePk implements Serializable { ... }"
+msgstr ""
+"@Entity\n"
+"public class RegionalArticle implements Serializable {\n"
+"\n"
+" @Id\n"
+" public RegionalArticlePk getPk() { ... }\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"public class RegionalArticlePk implements Serializable { ... }"
+
+#. Tag: para
+#: entity.xml:1261
+#, no-c-format
+msgid "or alternatively"
+msgstr "u opcionalmente"
+
+#. Tag: programlisting
+#: entity.xml:1263
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class RegionalArticle implements Serializable {\n"
+"\n"
+" @EmbeddedId\n"
+" public RegionalArticlePk getPk() { ... }\n"
+"}\n"
+"\n"
+"public class RegionalArticlePk implements Serializable { ... }"
+msgstr ""
+"@Entity\n"
+"public class RegionalArticle implements Serializable {\n"
+"\n"
+" @EmbeddedId\n"
+" public RegionalArticlePk getPk() { ... }\n"
+"}\n"
+"\n"
+"public class RegionalArticlePk implements Serializable { ... }"
+
+#. Tag: para
+#: entity.xml:1265
+#, no-c-format
+msgid ""
+"<literal>@Embeddable</literal> inherit the access type of its owning
entity "
+"unless the Hibernate specific annotation <literal>@AccessType</literal>
is "
+"used. Composite foreign keys (if not using the default sensitive values) are
"
+"defined on associations using the <literal>@JoinColumns</literal>
element, "
+"which is basically an array of <literal>@JoinColumn</literal>. It is
"
+"considered a good practice to express
<literal>referencedColumnNames</"
+"literal> explicitly. Otherwise, Hibernate will suppose that you use the same
"
+"order of columns as in the primary key declaration."
+msgstr ""
+"<literal>@Embeddable</literal> inherit the access type of its owning
entity "
+"unless the Hibernate specific annotation <literal>@AccessType</literal>
is "
+"used. Composite foreign keys (if not using the default sensitive values) are
"
+"defined on associations using the <literal>@JoinColumns</literal>
element, "
+"which is basically an array of <literal>@JoinColumn</literal>. It is
"
+"considered a good practice to express
<literal>referencedColumnNames</"
+"literal> explicitly. Otherwise, Hibernate will suppose that you use the same
"
+"order of columns as in the primary key declaration."
+
+#. Tag: programlisting
+#: entity.xml:1275
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Parent implements Serializable {\n"
+" @Id\n"
+" public ParentPk id;\n"
+" public int age;\n"
+"\n"
+" @OneToMany(cascade=CascadeType.ALL)\n"
+" @JoinColumns ({\n"
+" @JoinColumn(name=\"parentCivility\", referencedColumnName =
\"isMale"
+"\"),\n"
+" @JoinColumn(name=\"parentLastName\", referencedColumnName =
"
+"\"lastName\"),\n"
+" @JoinColumn(name=\"parentFirstName\", referencedColumnName =
"
+"\"firstName\")\n"
+" })\n"
+" public Set<Child> children; //unidirectional\n"
+" ...\n"
+"}"
+msgstr ""
+"@Entity\n"
+"public class Parent implements Serializable {\n"
+" @Id\n"
+" public ParentPk id;\n"
+" public int age;\n"
+"\n"
+" @OneToMany(cascade=CascadeType.ALL)\n"
+" @JoinColumns ({\n"
+" @JoinColumn(name=\"parentCivility\", referencedColumnName =
\"isMale"
+"\"),\n"
+" @JoinColumn(name=\"parentLastName\", referencedColumnName =
"
+"\"lastName\"),\n"
+" @JoinColumn(name=\"parentFirstName\", referencedColumnName =
"
+"\"firstName\")\n"
+" })\n"
+" public Set<Child> children; //unidirectional\n"
+" ...\n"
+"}"
+
+#. Tag: programlisting
+#: entity.xml:1277
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Child implements Serializable {\n"
+" @Id @GeneratedValue\n"
+" public Integer id;\n"
+"\n"
+" @ManyToOne\n"
+" @JoinColumns ({\n"
+" @JoinColumn(name=\"parentCivility\", referencedColumnName =
\"isMale"
+"\"),\n"
+" @JoinColumn(name=\"parentLastName\", referencedColumnName =
"
+"\"lastName\"),\n"
+" @JoinColumn(name=\"parentFirstName\", referencedColumnName =
"
+"\"firstName\")\n"
+" })\n"
+" public Parent parent; //unidirectional\n"
+"}"
+msgstr ""
+"@Entity\n"
+"public class Child implements Serializable {\n"
+" @Id @GeneratedValue\n"
+" public Integer id;\n"
+"\n"
+" @ManyToOne\n"
+" @JoinColumns ({\n"
+" @JoinColumn(name=\"parentCivility\", referencedColumnName =
\"isMale"
+"\"),\n"
+" @JoinColumn(name=\"parentLastName\", referencedColumnName =
"
+"\"lastName\"),\n"
+" @JoinColumn(name=\"parentFirstName\", referencedColumnName =
"
+"\"firstName\")\n"
+" })\n"
+" public Parent parent; //unidirectional\n"
+"}"
+
+#. Tag: programlisting
+#: entity.xml:1279
+#, no-c-format
+msgid ""
+"@Embeddable\n"
+"public class ParentPk implements Serializable {\n"
+" String firstName;\n"
+" String lastName;\n"
+" ...\n"
+"}"
+msgstr ""
+"@Embeddable\n"
+"public class ParentPk implements Serializable {\n"
+" String firstName;\n"
+" String lastName;\n"
+" ...\n"
+"}"
+
+#. Tag: para
+#: entity.xml:1281
+#, no-c-format
+msgid "Note the explicit usage of the
<literal>referencedColumnName</literal>."
+msgstr "Observe el uso explÃcito del
<literal>referencedColumnName</literal>."
+
+#. Tag: title
+#: entity.xml:1286
+#, no-c-format
+msgid "Mapping secondary tables"
+msgstr "Mapeo de tablas secundarias"
+
+#. Tag: para
+#: entity.xml:1288
+#, no-c-format
+msgid ""
+"You can map a single entity bean to several tables using the "
+"<literal>@SecondaryTable</literal> or
<literal>@SecondaryTables</literal> "
+"class level annotations. To express that a column is in a particular table, "
+"use the <literal>table</literal> parameter of
<literal>@Column</literal> or "
+"<literal>(a)JoinColumn</literal>."
+msgstr ""
+"Puede mapear un solo bean de entidad a varias tablas usando las anotaciones a nivel
de clase <literal>@SecondaryTable</literal> o
<literal>@SecondaryTables</literal>. Para expresar que una columna se
encuentra en una tabla en particular, "
+"use el parámetro <literal>table</literal> de
<literal>@Column</literal> o "
+"<literal>(a)JoinColumn</literal>."
+
+#. Tag: programlisting
+#: entity.xml:1295
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Table(name=\"MainCat\")\n"
+"<emphasis role=\"bold\">@SecondaryTables({\n"
+" @SecondaryTable(name=\"Cat1\", pkJoinColumns={\n"
+" @PrimaryKeyJoinColumn(name=\"cat_id\",
referencedColumnName=\"id\")\n"
+" ),\n"
+" @SecondaryTable(name=\"Cat2\",
uniqueConstraints={@UniqueConstraint"
+"(columnNames={\"storyPart2\"})})\n"
+"})</emphasis>\n"
+"public class Cat implements Serializable {\n"
+"\n"
+" private Integer id;\n"
+" private String name;\n"
+" private String storyPart1;\n"
+" private String storyPart2;\n"
+"\n"
+" @Id @GeneratedValue\n"
+" public Integer getId() {\n"
+" return id;\n"
+" }\n"
+"\n"
+" public String getName() {\n"
+" return name;\n"
+" }\n"
+" \n"
+" <emphasis
role=\"bold\">@Column(table=\"Cat1\")</emphasis>\n"
+" public String getStoryPart1() {\n"
+" return storyPart1;\n"
+" }\n"
+"\n"
+" <emphasis
role=\"bold\">@Column(table=\"Cat2\")</emphasis>\n"
+" public String getStoryPart2() {\n"
+" return storyPart2;\n"
+" }"
+msgstr ""
+"@Entity\n"
+"@Table(name=\"MainCat\")\n"
+"<emphasis role=\"bold\">@SecondaryTables({\n"
+" @SecondaryTable(name=\"Cat1\", pkJoinColumns={\n"
+" @PrimaryKeyJoinColumn(name=\"cat_id\",
referencedColumnName=\"id\")\n"
+" ),\n"
+" @SecondaryTable(name=\"Cat2\",
uniqueConstraints={@UniqueConstraint"
+"(columnNames={\"storyPart2\"})})\n"
+"})</emphasis>\n"
+"public class Cat implements Serializable {\n"
+"\n"
+" private Integer id;\n"
+" private String name;\n"
+" private String storyPart1;\n"
+" private String storyPart2;\n"
+"\n"
+" @Id @GeneratedValue\n"
+" public Integer getId() {\n"
+" return id;\n"
+" }\n"
+"\n"
+" public String getName() {\n"
+" return name;\n"
+" }\n"
+" \n"
+" <emphasis
role=\"bold\">@Column(table=\"Cat1\")</emphasis>\n"
+" public String getStoryPart1() {\n"
+" return storyPart1;\n"
+" }\n"
+"\n"
+" <emphasis
role=\"bold\">@Column(table=\"Cat2\")</emphasis>\n"
+" public String getStoryPart2() {\n"
+" return storyPart2;\n"
+" }"
+
+#. Tag: para
+#: entity.xml:1297
+#, no-c-format
+msgid ""
+"In this example, <literal>name</literal> will be in
<literal>MainCat</"
+"literal>. <literal>storyPart1</literal> will be in
<literal>Cat1</literal> "
+"and <literal>storyPart2</literal> will be in
<literal>Cat2</literal>. "
+"<literal>Cat1</literal> will be joined to
<literal>MainCat</literal> using "
+"the <literal>cat_id</literal> as a foreign key, and
<literal>Cat2</literal> "
+"using <literal>id</literal> (ie the same column name, the
<literal>MainCat</"
+"literal> id column has). Plus a unique constraint on
<literal>storyPart2</"
+"literal> has been set."
+msgstr ""
+"En este ejemplo, <literal>name</literal> estará en
<literal>MainCat</"
+"literal>. <literal>storyPart1</literal> estará en
<literal>Cat1</literal> y <literal>storyPart2</literal> estará en
<literal>Cat2</literal>. "
+"<literal>Cat1</literal> se unirá a
<literal>MainCat</literal> usando el <literal>cat_id</literal>
como una clave foránea y <literal>Cat2</literal> utilizando
<literal>id</literal> (es decir el mismo nombre de columna que la columna id
<literal>MainCat</"
+"literal> tiene). Además se ha configurado una restricción única en
<literal>storyPart2</"
+"literal>."
+
+#. Tag: para
+#: entity.xml:1307
+#, no-c-format
+msgid ""
+"Check out the JBoss EJB 3 tutorial or the Hibernate Annotations unit test "
+"suite for more examples."
+msgstr "Consulte el tutorial de JBoss EJB 3 o la suite de prueba de unidad de
Hibernate Annotations para obtener más ejemplos."
+
+#. Tag: title
+#: entity.xml:1313
+#, no-c-format
+msgid "Mapping Queries"
+msgstr "Solicitudes de mapeo"
+
+#. Tag: title
+#: entity.xml:1317
+#, no-c-format
+msgid "Mapping JPAQL/HQL queries"
+msgstr "Mapeo de solicitudes JPAQL/HQL"
+
+#. Tag: para
+#: entity.xml:1319
+#, no-c-format
+msgid ""
+"You can map EJBQL/HQL queries using annotations.
<literal>@NamedQuery</"
+"literal> and <literal>@NamedQueries</literal> can be defined at the
class "
+"level or in a JPA XML file. However their definitions are global to the "
+"session factory/entity manager factory scope. A named query is defined by "
+"its name and the actual query string."
+msgstr ""
+"Puede mapear consultas EJBQL/HQL usando anotaciones.
<literal>@NamedQuery</"
+"literal> y <literal>@NamedQueries</literal> se pueden definir a
nivel de clase o en un archivo XML JPA. Sin embargo, sus definiciones son globales para el
ámbito de fábrica del administrador de fábrica/entidad de sesión. Una petición nombrada
está definida por su nombre y la cadena de petición misma."
+
+#. Tag: programlisting
+#: entity.xml:1326
+#, no-c-format
+msgid ""
+"<entity-mappings>\n"
+" <named-query name=\"plane.getAll\">\n"
+" <query>select p from Plane p</query>\n"
+" </named-query>\n"
+" ...\n"
+"</entity-mappings>\n"
+"...\n"
+"\n"
+"@Entity\n"
+"(a)NamedQuery(name=\"night.moreRecentThan\", query=\"select n from
Night n "
+"where n.date >= :date\")\n"
+"public class Night {\n"
+" ...\n"
+"}\n"
+"\n"
+"public class MyDao {\n"
+" doStuff() {\n"
+" Query q = s.getNamedQuery(\"night.moreRecentThan\");\n"
+" q.setDate( \"date\", aMonthAgo );\n"
+" List results = q.list();\n"
+" ...\n"
+" }\n"
+" ...\n"
+"}"
+msgstr ""
+"<entity-mappings>\n"
+" <named-query name=\"plane.getAll\">\n"
+" <query>select p from Plane p</query>\n"
+" </named-query>\n"
+" ...\n"
+"</entity-mappings>\n"
+"...\n"
+"\n"
+"@Entity\n"
+"(a)NamedQuery(name=\"night.moreRecentThan\", query=\"select n from
Night n "
+"where n.date >= :date\")\n"
+"public class Night {\n"
+" ...\n"
+"}\n"
+"\n"
+"public class MyDao {\n"
+" doStuff() {\n"
+" Query q = s.getNamedQuery(\"night.moreRecentThan\");\n"
+" q.setDate( \"date\", aMonthAgo );\n"
+" List results = q.list();\n"
+" ...\n"
+" }\n"
+" ...\n"
+"}"
+
+#. Tag: para
+#: entity.xml:1328
+#, no-c-format
+msgid ""
+"You can also provide some hints to a query through an array of "
+"<literal>QueryHint</literal> through a
<literal>hints</literal> attribute."
+msgstr "También puede darle a la petición algunas pistas por medio de un array de
<literal>QueryHint</literal> a través del atributo
<literal>hints</literal>."
+
+#. Tag: para
+#: entity.xml:1332
+#, no-c-format
+msgid "The availabe Hibernate hints are"
+msgstr "Las pistas Hibernate disponibles son:"
+
+#. Tag: title
+#: entity.xml:1337
+#, no-c-format
+msgid "Query hints"
+msgstr "Pistas de petición"
+
+#. Tag: entry
+#: entity.xml:1346
+#, no-c-format
+msgid "hint"
+msgstr "pista"
+
+#. Tag: entry
+#: entity.xml:1348
+#, no-c-format
+msgid "description"
+msgstr "descripción"
+
+#. Tag: entry
+#: entity.xml:1354
+#, no-c-format
+msgid "org.hibernate.cacheable"
+msgstr "org.hibernate.cacheable"
+
+#. Tag: entry
+#: entity.xml:1356
+#, no-c-format
+msgid ""
+"Whether the query should interact with the second level cache (defualt to "
+"false)"
+msgstr "Si la consulta debe interactuar con el caché de segundo nivel (por defecto
es falso)"
+
+#. Tag: entry
+#: entity.xml:1361
+#, no-c-format
+msgid "org.hibernate.cacheRegion"
+msgstr "org.hibernate.cacheRegion"
+
+#. Tag: entry
+#: entity.xml:1363
+#, no-c-format
+msgid "Cache region name (default used otherwise)"
+msgstr "Nombre de región de caché (de otra manera se utiliza el
predeterminado)"
+
+#. Tag: entry
+#: entity.xml:1367
+#, no-c-format
+msgid "org.hibernate.timeout"
+msgstr "org.hibernate.timeout"
+
+#. Tag: entry
+#: entity.xml:1369
+#, no-c-format
+msgid "Query timeout"
+msgstr "Expiración de una petición"
+
+#. Tag: entry
+#: entity.xml:1373
+#, no-c-format
+msgid "org.hibernate.fetchSize"
+msgstr "org.hibernate.fetchSize"
+
+#. Tag: entry
+#: entity.xml:1375
+#, no-c-format
+msgid "resultset fetch size"
+msgstr "tamaño de búsqueda del grupo de resultados"
+
+#. Tag: entry
+#: entity.xml:1379
+#, no-c-format
+msgid "org.hibernate.flushMode"
+msgstr "org.hibernate.flushMode"
+
+#. Tag: entry
+#: entity.xml:1381
+#, no-c-format
+msgid "Flush mode used for this query"
+msgstr "Modo de vaciado utilizado para esta consulta"
+
+#. Tag: entry
+#: entity.xml:1385
+#, no-c-format
+msgid "org.hibernate.cacheMode"
+msgstr "org.hibernate.cacheMode"
+
+#. Tag: entry
+#: entity.xml:1387
+#, no-c-format
+msgid "Cache mode used for this query"
+msgstr "Modo de caché utilizado para esta consulta"
+
+#. Tag: entry
+#: entity.xml:1391
+#, no-c-format
+msgid "org.hibernate.readOnly"
+msgstr "org.hibernate.readOnly"
+
+#. Tag: entry
+#: entity.xml:1393
+#, no-c-format
+msgid ""
+"Entities loaded by this query should be in read only mode or not (default to
"
+"false)"
+msgstr "Las entidades cargadas por esta consulta deben estar o no en modo de sólo
lectura (por defecto es falso)"
+
+#. Tag: entry
+#: entity.xml:1398
+#, no-c-format
+msgid "org.hibernate.comment"
+msgstr "org.hibernate.comment"
+
+#. Tag: entry
+#: entity.xml:1400
+#, no-c-format
+msgid "Query comment added to the generated SQL"
+msgstr "Comentario de la solicitud agregado al SQL generado"
+
+#. Tag: title
+#: entity.xml:1408
+#, no-c-format
+msgid "Mapping native queries"
+msgstr "Mapeo de solicitudes nativas"
+
+#. Tag: para
+#: entity.xml:1410
+#, no-c-format
+msgid ""
+"You can also map a native query (ie a plain SQL query). To achieve that, you
"
+"need to describe the SQL resultset structure using "
+"<literal>@SqlResultSetMapping</literal> (or
<literal>@SqlResultSetMappings</"
+"literal> if you plan to define several resulset mappings). Like "
+"<literal>@NamedQuery</literal>, a
<literal>@SqlResultSetMapping</literal> "
+"can be defined at class level or in a JPA XML file. However its scope is "
+"global to the application."
+msgstr ""
+"También puede mapear una petición nativa (es decir, una simple petición SQL). Para
lograr esto, necesita describir la estructura del grupo de resultados SQL usando
<literal>@SqlResultSetMapping</literal> (o
<literal>@SqlResultSetMappings</"
+"literal> si planea definir varios mapeos del grupo de resultados). Tal como
<literal>@NamedQuery</literal>, un
<literal>@SqlResultSetMapping</literal> se puede definir a nivel de clase o en
un archivo XML JPA. Sin embargo, su ámbito es global para la aplicación."
+
+#. Tag: para
+#: entity.xml:1419
+#, no-c-format
+msgid ""
+"As we will see, a <literal>resultSetMapping</literal> parameter is
defined "
+"in <literal>@NamedNativeQuery</literal>, it represents the name of a
defined "
+"<literal>@SqlResultSetMapping</literal>. The resultset mapping declares
the "
+"entities retrieved by this native query. Each field of the entity is bound "
+"to an SQL alias (or column name). All fields of the entity including the "
+"ones of subclasses and the foreign key columns of related entities have to "
+"be present in the SQL query. Field definitions are optional provided that "
+"they map to the same column name as the one declared on the class property."
+msgstr "Tal como lo vamos a ver, un parámetro
<literal>resultSetMapping</literal> se define en
<literal>@NamedNativeQuery</literal>, representa el nombre de un
<literal>@SqlResultSetMapping</literal> definido. El mapeo del grupo de
resultados declara las entidades recuperadas por esta petición nativa. Cada campo de la
entidad se enlaza a un alias SQL (o nombre de columna). Todos los campos de la entidad
incluyendo los de las subclases y las columnas de la clave foránea de entidades
relacionada tienen que estar presentes en la petición SQL. Las definiciones de campos son
opcionales dado que mapean al mismo nombre de columna que el declarado en la propiedad de
clase."
+
+#. Tag: programlisting
+#: entity.xml:1429
+#, no-c-format
+msgid ""
+"@NamedNativeQuery(name=\"night&area\", query=\"select
night.id nid, "
+"night.night_duration, \"\n"
+" + \" night.night_date, area.id aid, night.area_id, area.name
\"\n"
+" + \"from Night night, Area area where night.area_id = area.id\",
"
+"<emphasis\n"
+"
role=\"bold\">resultSetMapping=\"joinMapping\"</emphasis>)\n"
+"@SqlResultSetMapping(name=\"joinMapping\", entities={\n"
+" @EntityResult(entityClass=org.hibernate.test.annotations.query.Night."
+"class, fields = {\n"
+" @FieldResult(name=\"id\", column=\"nid\"),\n"
+" @FieldResult(name=\"duration\",
column=\"night_duration\"),\n"
+" @FieldResult(name=\"date\",
column=\"night_date\"),\n"
+" @FieldResult(name=\"area\",
column=\"area_id\"),\n"
+" discriminatorColumn=\"disc\"\n"
+" }),\n"
+" @EntityResult(entityClass=org.hibernate.test.annotations.query.Area."
+"class, fields = {\n"
+" @FieldResult(name=\"id\", column=\"aid\"),\n"
+" @FieldResult(name=\"name\", column=\"name\")\n"
+" })\n"
+" }\n"
+")"
+msgstr ""
+"@NamedNativeQuery(name=\"night&area\", query=\"select
night.id nid, "
+"night.night_duration, \"\n"
+" + \" night.night_date, area.id aid, night.area_id, area.name
\"\n"
+" + \"from Night night, Area area where night.area_id = area.id\",
"
+"<emphasis\n"
+"
role=\"bold\">resultSetMapping=\"joinMapping\"</emphasis>)\n"
+"@SqlResultSetMapping(name=\"joinMapping\", entities={\n"
+" @EntityResult(entityClass=org.hibernate.test.annotations.query.Night."
+"class, fields = {\n"
+" @FieldResult(name=\"id\", column=\"nid\"),\n"
+" @FieldResult(name=\"duration\",
column=\"night_duration\"),\n"
+" @FieldResult(name=\"date\",
column=\"night_date\"),\n"
+" @FieldResult(name=\"area\",
column=\"area_id\"),\n"
+" discriminatorColumn=\"disc\"\n"
+" }),\n"
+" @EntityResult(entityClass=org.hibernate.test.annotations.query.Area."
+"class, fields = {\n"
+" @FieldResult(name=\"id\", column=\"aid\"),\n"
+" @FieldResult(name=\"name\", column=\"name\")\n"
+" })\n"
+" }\n"
+")"
+
+#. Tag: para
+#: entity.xml:1431
+#, no-c-format
+msgid ""
+"In the above example, the <literal>night&area</literal> named
query use "
+"the <literal>joinMapping</literal> result set mapping. This mapping
returns "
+"2 entities, <literal>Night</literal> and
<literal>Area</literal>, each "
+"property is declared and associated to a column name, actually the column "
+"name retrieved by the query. Let's now see an implicit declaration of the
"
+"property / column."
+msgstr ""
+"En el ejemplo anterior, la petición nombrada
<literal>night&area</literal> usa el mapeo del grupo de resultados
<literal>joinMapping</literal>. Este mapeo retorna dos entidades,
<literal>Night</literal> y <literal>Area</literal>, cada propiedad
se declara y se asocia a un nombre de columna, de hecho el nombre de columna "
+"recuperado por la petición. Ahora vamos a ver una declaración implÃcita de la
propiedad / columna."
+
+#. Tag: programlisting
+#: entity.xml:1438
+#, no-c-format
+msgid ""
+"@Entity\n"
+"<emphasis
role=\"bold\">@SqlResultSetMapping(name=\"implicit\", "
+"entities=(a)EntityResult(entityClass=org.hibernate.test.annotations.query."
+"SpaceShip.class))\n"
+"@NamedNativeQuery(name=\"implicitSample\", query=\"select * from
SpaceShip"
+"\", resultSetMapping=\"implicit\")</emphasis>\n"
+"public class SpaceShip {\n"
+" private String name;\n"
+" private String model;\n"
+" private double speed;\n"
+"\n"
+" @Id\n"
+" public String getName() {\n"
+" return name;\n"
+" }\n"
+"\n"
+" public void setName(String name) {\n"
+" this.name = name;\n"
+" }\n"
+"\n"
+" @Column(name=\"model_txt\")\n"
+" public String getModel() {\n"
+" return model;\n"
+" }\n"
+"\n"
+" public void setModel(String model) {\n"
+" this.model = model;\n"
+" }\n"
+"\n"
+" public double getSpeed() {\n"
+" return speed;\n"
+" }\n"
+"\n"
+" public void setSpeed(double speed) {\n"
+" this.speed = speed;\n"
+" }\n"
+"}"
+msgstr ""
+"@Entity\n"
+"<emphasis
role=\"bold\">@SqlResultSetMapping(name=\"implicit\", "
+"entities=(a)EntityResult(entityClass=org.hibernate.test.annotations.query."
+"SpaceShip.class))\n"
+"@NamedNativeQuery(name=\"implicitSample\", query=\"select * from
SpaceShip"
+"\", resultSetMapping=\"implicit\")</emphasis>\n"
+"public class SpaceShip {\n"
+" private String name;\n"
+" private String model;\n"
+" private double speed;\n"
+"\n"
+" @Id\n"
+" public String getName() {\n"
+" return name;\n"
+" }\n"
+"\n"
+" public void setName(String name) {\n"
+" this.name = name;\n"
+" }\n"
+"\n"
+" @Column(name=\"model_txt\")\n"
+" public String getModel() {\n"
+" return model;\n"
+" }\n"
+"\n"
+" public void setModel(String model) {\n"
+" this.model = model;\n"
+" }\n"
+"\n"
+" public double getSpeed() {\n"
+" return speed;\n"
+" }\n"
+"\n"
+" public void setSpeed(double speed) {\n"
+" this.speed = speed;\n"
+" }\n"
+"}"
+
+#. Tag: para
+#: entity.xml:1440
+#, no-c-format
+msgid ""
+"In this example, we only describe the entity member of the result set "
+"mapping. The property / column mappings is done using the entity mapping "
+"values. In this case the <literal>model</literal> property is bound to
the "
+"<literal>model_txt </literal>column. If the association to a related
entity "
+"involve a composite primary key, a <literal>@FieldResult</literal>
element "
+"should be used for each foreign key column. The
<literal>@FieldResult</"
+"literal> name is composed of the property name for the relationship, "
+"followed by a dot (\".\"), followed by the name or the field or property
of "
+"the primary key."
+msgstr ""
+"En este ejemplo, solo describimos el miembro de la entidad del mapeo del grupo de
resultados. Los mapeos de propiedad / columna se realizan usando los valores del mapeo de
entidad. En este caso la propiedad <literal>model</literal> es enlazada a la
columna <literal>model_txt </literal>. Si la asociación a una entidad
relacionada involucra una clave principal compuesta entonces debe utiliza un elemento
<literal>@FieldResult</literal> para cada columna de clave foránea. El nombre
<literal>@FieldResult</"
+"literal> está compuesto del nombre de la propiedad para la relación, seguido de
un punto (\".\"), seguido del nombre o el campo o la propiedad de la clave
principal."
+
+#. Tag: programlisting
+#: entity.xml:1450
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@SqlResultSetMapping(name=\"compositekey\",\n"
+" entities=(a)EntityResult(entityClass=org.hibernate.test.annotations."
+"query.SpaceShip.class,\n"
+" fields = {\n"
+" @FieldResult(name=\"name\", column =
\"name\"),\n"
+" @FieldResult(name=\"model\", column =
\"model\"),\n"
+" @FieldResult(name=\"speed\", column =
\"speed\"),\n"
+"<emphasis role=\"bold\">
@FieldResult(name=\"captain."
+"firstname\", column = \"firstn\"),\n"
+" @FieldResult(name=\"captain.lastname\", column =
\"lastn"
+"\"),</emphasis>\n"
+" @FieldResult(name=\"dimensions.length\", column =
"
+"\"length\"),\n"
+" @FieldResult(name=\"dimensions.width\", column =
\"width"
+"\")\n"
+" }),\n"
+" columns = { @ColumnResult(name = \"surface\"),\n"
+" @ColumnResult(name = \"volume\") } )\n"
+"\n"
+"@NamedNativeQuery(name=\"compositekey\",\n"
+" query=\"select name, model, speed, lname as lastn, fname as firstn,
"
+"length, width, length * width as surface from SpaceShip\", \n"
+" resultSetMapping=\"compositekey\")\n"
+"} )\n"
+"public class SpaceShip {\n"
+" private String name;\n"
+" private String model;\n"
+" private double speed;\n"
+" private Captain captain;\n"
+" private Dimensions dimensions;\n"
+"\n"
+" @Id\n"
+" public String getName() {\n"
+" return name;\n"
+" }\n"
+"\n"
+" public void setName(String name) {\n"
+" this.name = name;\n"
+" }\n"
+"\n"
+" @ManyToOne(fetch= FetchType.LAZY)\n"
+" @JoinColumns( {\n"
+" @JoinColumn(name=\"fname\", referencedColumnName =
\"firstname"
+"\"),\n"
+" @JoinColumn(name=\"lname\", referencedColumnName =
\"lastname"
+"\")\n"
+" } )\n"
+" public Captain getCaptain() {\n"
+" return captain;\n"
+" }\n"
+"\n"
+" public void setCaptain(Captain captain) {\n"
+" this.captain = captain;\n"
+" }\n"
+"\n"
+" public String getModel() {\n"
+" return model;\n"
+" }\n"
+"\n"
+" public void setModel(String model) {\n"
+" this.model = model;\n"
+" }\n"
+"\n"
+" public double getSpeed() {\n"
+" return speed;\n"
+" }\n"
+"\n"
+" public void setSpeed(double speed) {\n"
+" this.speed = speed;\n"
+" }\n"
+"\n"
+" public Dimensions getDimensions() {\n"
+" return dimensions;\n"
+" }\n"
+"\n"
+" public void setDimensions(Dimensions dimensions) {\n"
+" this.dimensions = dimensions;\n"
+" }\n"
+"}\n"
+"\n"
+"@Entity\n"
+"(a)IdClass(Identity.class)\n"
+"public class Captain implements Serializable {\n"
+" private String firstname;\n"
+" private String lastname;\n"
+"\n"
+" @Id\n"
+" public String getFirstname() {\n"
+" return firstname;\n"
+" }\n"
+"\n"
+" public void setFirstname(String firstname) {\n"
+" this.firstname = firstname;\n"
+" }\n"
+"\n"
+" @Id\n"
+" public String getLastname() {\n"
+" return lastname;\n"
+" }\n"
+"\n"
+" public void setLastname(String lastname) {\n"
+" this.lastname = lastname;\n"
+" }\n"
+"}"
+msgstr ""
+"@Entity\n"
+"@SqlResultSetMapping(name=\"compositekey\",\n"
+" entities=(a)EntityResult(entityClass=org.hibernate.test.annotations."
+"query.SpaceShip.class,\n"
+" fields = {\n"
+" @FieldResult(name=\"name\", column =
\"name\"),\n"
+" @FieldResult(name=\"model\", column =
\"model\"),\n"
+" @FieldResult(name=\"speed\", column =
\"speed\"),\n"
+"<emphasis role=\"bold\">
@FieldResult(name=\"captain."
+"firstname\", column = \"firstn\"),\n"
+" @FieldResult(name=\"captain.lastname\", column =
\"lastn"
+"\"),</emphasis>\n"
+" @FieldResult(name=\"dimensions.length\", column =
"
+"\"length\"),\n"
+" @FieldResult(name=\"dimensions.width\", column =
\"width"
+"\")\n"
+" }),\n"
+" columns = { @ColumnResult(name = \"surface\"),\n"
+" @ColumnResult(name = \"volume\") } )\n"
+"\n"
+"@NamedNativeQuery(name=\"compositekey\",\n"
+" query=\"select name, model, speed, lname as lastn, fname as firstn,
"
+"length, width, length * width as surface from SpaceShip\", \n"
+" resultSetMapping=\"compositekey\")\n"
+"} )\n"
+"public class SpaceShip {\n"
+" private String name;\n"
+" private String model;\n"
+" private double speed;\n"
+" private Captain captain;\n"
+" private Dimensions dimensions;\n"
+"\n"
+" @Id\n"
+" public String getName() {\n"
+" return name;\n"
+" }\n"
+"\n"
+" public void setName(String name) {\n"
+" this.name = name;\n"
+" }\n"
+"\n"
+" @ManyToOne(fetch= FetchType.LAZY)\n"
+" @JoinColumns( {\n"
+" @JoinColumn(name=\"fname\", referencedColumnName =
\"firstname"
+"\"),\n"
+" @JoinColumn(name=\"lname\", referencedColumnName =
\"lastname"
+"\")\n"
+" } )\n"
+" public Captain getCaptain() {\n"
+" return captain;\n"
+" }\n"
+"\n"
+" public void setCaptain(Captain captain) {\n"
+" this.captain = captain;\n"
+" }\n"
+"\n"
+" public String getModel() {\n"
+" return model;\n"
+" }\n"
+"\n"
+" public void setModel(String model) {\n"
+" this.model = model;\n"
+" }\n"
+"\n"
+" public double getSpeed() {\n"
+" return speed;\n"
+" }\n"
+"\n"
+" public void setSpeed(double speed) {\n"
+" this.speed = speed;\n"
+" }\n"
+"\n"
+" public Dimensions getDimensions() {\n"
+" return dimensions;\n"
+" }\n"
+"\n"
+" public void setDimensions(Dimensions dimensions) {\n"
+" this.dimensions = dimensions;\n"
+" }\n"
+"}\n"
+"\n"
+"@Entity\n"
+"(a)IdClass(Identity.class)\n"
+"public class Captain implements Serializable {\n"
+" private String firstname;\n"
+" private String lastname;\n"
+"\n"
+" @Id\n"
+" public String getFirstname() {\n"
+" return firstname;\n"
+" }\n"
+"\n"
+" public void setFirstname(String firstname) {\n"
+" this.firstname = firstname;\n"
+" }\n"
+"\n"
+" @Id\n"
+" public String getLastname() {\n"
+" return lastname;\n"
+" }\n"
+"\n"
+" public void setLastname(String lastname) {\n"
+" this.lastname = lastname;\n"
+" }\n"
+"}"
+
+#. Tag: para
+#: entity.xml:1453
+#, no-c-format
+msgid ""
+"If you look at the dimension property, you'll see that Hibernate supports
"
+"the dotted notation for embedded objects (you can even have nested embedded "
+"objects). EJB3 implementations do not have to support this feature, we do
:-)"
+msgstr "Si observa la propiedad de dimensión, verá que Hibernate soporta la notación
con puntos para objetos incluÃdos (incluso puede tener objetos incluÃdos anidados). Las
implementaciones EJB3 no tienen que soportar esta funcionalidad, nosotros lo hacemos.
"
+
+#. Tag: para
+#: entity.xml:1459
+#, no-c-format
+msgid ""
+"If you retrieve a single entity and if you use the default mapping, you can "
+"use the <literal>resultClass</literal> attribute instead of "
+"<literal>resultSetMapping</literal>:"
+msgstr "Si recupera una sola entidad y si usa el mapeo predeterminado, puede
utilizar el atributo <literal>resultClass</literal> en lugar de
<literal>resultSetMapping</literal>:"
+
+#. Tag: programlisting
+#: entity.xml:1463
+#, no-c-format
+msgid ""
+"<emphasis
role=\"bold\">@NamedNativeQuery(name=\"implicitSample\",
query="
+"\"select * from SpaceShip\", \n"
+" resultClass=SpaceShip.class)</emphasis>\n"
+"public class SpaceShip {"
+msgstr ""
+"<emphasis
role=\"bold\">@NamedNativeQuery(name=\"implicitSample\",
query="
+"\"select * from SpaceShip\", \n"
+" resultClass=SpaceShip.class)</emphasis>\n"
+"public class SpaceShip {"
+
+#. Tag: para
+#: entity.xml:1465
+#, no-c-format
+msgid ""
+"In some of your native queries, you'll have to return scalar values, for
"
+"example when building report queries. You can map them in the "
+"<literal>@SqlResultsetMapping</literal> through
<literal>@ColumnResult</"
+"literal>. You actually can even mix, entities and scalar returns in the same
"
+"native query (this is probably not that common though)."
+msgstr ""
+"En algunas de sus peticiones nativas, tendrá que retornar valores escalares, por
"
+"ejemplo, al construir peticiones de reportes. Puede mapearlas en el
<literal>@SqlResultsetMapping</literal> por medio de
<literal>@ColumnResult</"
+"literal>. De hecho puede mezclar entidades y valores retornados escalares en la
misma petición nativa (aunque probablemente esto no es tan común)."
+
+#. Tag: programlisting
+#: entity.xml:1472
+#, no-c-format
+msgid ""
+"<emphasis
role=\"bold\">@SqlResultSetMapping(name=\"scalar\", "
+"columns=@ColumnResult(name=\"dimension\"))\n"
+"@NamedNativeQuery(name=\"scalar\", query=\"select length*width as
dimension "
+"from SpaceShip\",
resultSetMapping=\"scalar\")</emphasis>"
+msgstr ""
+"<emphasis
role=\"bold\">@SqlResultSetMapping(name=\"scalar\", "
+"columns=@ColumnResult(name=\"dimension\"))\n"
+"@NamedNativeQuery(name=\"scalar\", query=\"select length*width as
dimension "
+"from SpaceShip\",
resultSetMapping=\"scalar\")</emphasis>"
+
+#. Tag: para
+#: entity.xml:1474
+#, no-c-format
+msgid ""
+"An other query hint specific to native queries has been introduced: "
+"<literal>org.hibernate.callable</literal> which can be true or false
"
+"depending on whether the query is a stored procedure or not."
+msgstr ""
+"Se introdujo otra pista de petición especifica de las peticiones nativas: "
+"<literal>org.hibernate.callable</literal>, la cual puede ser verdadero
o falsa dependiendo de si la petición es un procedimiento almacenado o no."
+
+#. Tag: title
+#: entity.xml:1482
+#, no-c-format
+msgid "Hibernate Annotation Extensions"
+msgstr "Extensiones de Hibernate Annotation"
+
+#. Tag: para
+#: entity.xml:1484
+#, no-c-format
+msgid ""
+"Hibernate 3.1 offers a variety of additional annotations that you can mix/"
+"match with your EJB 3 entities. They have been designed as a natural "
+"extension of EJB3 annotations."
+msgstr "Hibernate 3.1 ofrece una variedad de anotaciones adicionales que puede
mezclar con sus entidades EJB 3. Han sido diseñadas como una extensión natural de las
anotaciones EJB3."
+
+#. Tag: para
+#: entity.xml:1488
+#, no-c-format
+msgid ""
+"To empower the EJB3 capabilities, hibernate provides specific annotations "
+"that match hibernate features. The
<classname>org.hibernate.annotations</"
+"classname> package contains all these annotations extensions."
+msgstr ""
+"Para habilitar las funcionalidades EJB3, hibernate proporciona anotaciones
especificas que coinciden con las funcionalidades de hibernate. El paquete
<classname>org.hibernate.annotations</"
+"classname> contiene todas estas extensiones de anotaciones."
+
+#. Tag: title
+#: entity.xml:1494
+#, no-c-format
+msgid "Entity"
+msgstr "Entidad"
+
+#. Tag: para
+#: entity.xml:1496
+#, no-c-format
+msgid ""
+"You can fine tune some of the actions done by Hibernate on entities beyond "
+"what the EJB3 spec offers."
+msgstr "Puede ajustar algunas de las acciones realizadas por Hibernate en las
entidades mas allá de lo que la especificación EJB3 ofrece."
+
+#. Tag: para
+#: entity.xml:1499
+#, no-c-format
+msgid ""
+"<classname>(a)org.hibernate.annotations.Entity</classname> adds
additional "
+"metadata that may be needed beyond what is defined in the standard "
+"<literal>@Entity</literal>"
+msgstr "<classname>(a)org.hibernate.annotations.Entity</classname> agrega
metadatos adicionales que se pueden llegar a necesitar más allá de lo que se define en la
<literal>@Entity</literal> estándar."
+
+#. Tag: para
+#: entity.xml:1503
+#, no-c-format
+msgid "mutable: whether this entity is mutable or not"
+msgstr "mutable: si esta entidad es mutable o no"
+
+#. Tag: para
+#: entity.xml:1508
+#, no-c-format
+msgid "dynamicInsert: allow dynamic SQL for inserts"
+msgstr "dynamicInsert: permite SQL dinámico para inserts"
+
+#. Tag: para
+#: entity.xml:1513
+#, no-c-format
+msgid "dynamicUpdate: allow dynamic SQL for updates"
+msgstr "dynamicUpdate: permite SQL dinámico para actualizaciones"
+
+#. Tag: para
+#: entity.xml:1518
+#, no-c-format
+msgid ""
+"selectBeforeUpdate: Specifies that Hibernate should never perform an SQL "
+"UPDATE unless it is certain that an object is actually modified."
+msgstr "selectBeforeUpdate: Especifica que Hibernate nunca debe realizar un UPDATE
SQL a menos de que esté seguro de que un objeto es modificado."
+
+#. Tag: para
+#: entity.xml:1523
+#, no-c-format
+msgid ""
+"polymorphism: whether the entity polymorphism is of PolymorphismType."
+"IMPLICIT (default) or PolymorphismType.EXPLICIT"
+msgstr ""
+"polymorphism: si la entidad polymorphism es de PolymorphismType."
+"IMPLICIT (predeterminado) o PolymorphismType.EXPLICIT"
+
+#. Tag: para
+#: entity.xml:1528
+#, no-c-format
+msgid ""
+"optimisticLock: optimistic locking strategy (OptimisticLockType.VERSION, "
+"OptimisticLockType.NONE, OptimisticLockType.DIRTY or OptimisticLockType.ALL)"
+msgstr ""
+"optimisticLock: estrategia de bloqueo optimista (OptimisticLockType.VERSION,
"
+"OptimisticLockType.NONE, OptimisticLockType.DIRTY o OptimisticLockType.ALL)"
+
+#. Tag: para
+#: entity.xml:1534
+#, no-c-format
+msgid ""
+"(a)javax.persistence.Entity is still mandatory, @org.hibernate.annotations."
+"Entity is not a replacement."
+msgstr ""
+"(a)javax.persistence.Entity todavÃa es obligatorio,
@org.hibernate.annotations."
+"Entity no es un reemplazo."
+
+#. Tag: para
+#: entity.xml:1538
+#, no-c-format
+msgid "Here are some additional Hibernate annotation extensions"
+msgstr "Estas son algunas extensiones adicionales de anotaciones de Hibernate"
+
+#. Tag: para
+#: entity.xml:1540
+#, no-c-format
+#, fuzzy
+msgid ""
+"<literal>(a)org.hibernate.annotations.BatchSize</literal> allows you to
define "
+"the batch size when fetching instances of this entity ( eg. "
+"<literal>@BatchSize(size=4)</literal> ). When loading a given entity,
"
+"Hibernate will then load all the uninitialized entities of the same type in "
+"the persistence context up to the batch size."
+msgstr ""
+"<literal>(a)org.hibernate.annotations.BatchSize</literal> le permite
definir el tamaño de "
+"the batch size al buscar instancias de esta entidad (por ejemplo. "
+"<literal>@BatchSize(size=4)</literal> ). Al cargar una entidad dada,
"
+"Hibernate cargará todas las entidades no inicializadas del mismo tipo en el
contexto de persistencia e context up to the batch size."
+
+#. Tag: para
+#: entity.xml:1546
+#, no-c-format
+msgid ""
+"<literal>(a)org.hibernate.annotations.Proxy</literal> defines the
laziness "
+"attributes of the entity. lazy (default to true) define whether the class is
"
+"lazy or not. proxyClassName is the interface used to generate the proxy "
+"(default is the class itself)."
+msgstr ""
+"<literal>(a)org.hibernate.annotations.Proxy</literal> define los
atributos perezosos de la entidad. lazy (por defecto verdadero) define si la clase es
perezosa o no. proxyClassName es la interfaz utilizada para generar el proxy "
+"(por defecto es la clase misma)."
+
+#. Tag: para
+#: entity.xml:1551
+#, no-c-format
+msgid ""
+"<literal>(a)org.hibernate.annotations.Where</literal> defines an optional
SQL "
+"WHERE clause used when instances of this class is retrieved."
+msgstr "<literal>(a)org.hibernate.annotations.Where</literal> define una
cláusula optional WHERE SQL utilizada cuando las instancias de esta clase se
recuperan."
+
+#. Tag: para
+#: entity.xml:1555
+#, no-c-format
+msgid ""
+"<literal>(a)org.hibernate.annotations.Check</literal> defines an optional
"
+"check constraints defined in the DDL statetement."
+msgstr "<literal>(a)org.hibernate.annotations.Check</literal> define una
restricción de chequeo opcional definida en la declaración DDL."
+
+#. Tag: para
+#: entity.xml:1558
+#, no-c-format
+msgid ""
+"<literal>(a)OnDelete(action=OnDeleteAction.CASCADE)</literal> on joined
"
+"subclasses: use a SQL cascade delete on deletion instead of the regular "
+"Hibernate mechanism."
+msgstr "<literal>(a)OnDelete(action=OnDeleteAction.CASCADE)</literal> en
subclases unidas: use un borrado en cascada SQL al borra en lugar del mecanismo regular de
Hibernate."
+
+#. Tag: para
+#: entity.xml:1562
+#, no-c-format
+msgid ""
+"<literal>@Table(appliesTo=\"tableName\", indexes = {
@Index(name=\"index1\", "
+"columnNames={\"column1\", \"column2\"} ) } )</literal>
creates the defined "
+"indexes on the columns of table <literal>tableName</literal>. This can
be "
+"applied on the primary table or any secondary table. The
<literal>@Tables</"
+"literal> annotation allows your to apply indexes on different tables. This
"
+"annotation is expected where
<literal>(a)javax.persistence.Table</literal> or "
+"<literal>(a)javax.persistence.SecondaryTable</literal>(s) occurs."
+msgstr ""
+"<literal>@Table(appliesTo=\"tableName\", indexes = {
@Index(name=\"index1\", "
+"columnNames={\"column1\", \"column2\"} ) } )</literal>
crea los Ãndices definidos en las columnas de la tabla
<literal>tableName</literal>. Esto se puede aplicar en la tabla principal o en
cualquier tabla secundaria. La anotación <literal>@Tables</"
+"literal> le permite aplicar Ãndices en diferentes tablas. Esta anotación se
espera en donde se presente <literal>(a)javax.persistence.Table</literal> o
"
+"<literal>(a)javax.persistence.SecondaryTable</literal>."
+
+#. Tag: para
+#: entity.xml:1572
+#, no-c-format
+msgid ""
+"<literal>(a)org.hibernate.annotations.Table</literal> is a complement,
not a "
+"replacement to <literal>(a)javax.persistence.Table</literal>. Especially,
if "
+"you want to change the default name of a table, you must use
<literal>(a)javax."
+"persistence.Table</literal>, not
<literal>(a)org.hibernate.annotations.Table</"
+"literal>."
+msgstr ""
+"<literal>(a)org.hibernate.annotations.Table</literal> es un complemento,
no un reemplazo para <literal>(a)javax.persistence.Table</literal>.
Especialmente si quiere cambiar el nombre predeterminado de una tabla, tiene que usar
<literal>(a)javax."
+"persistence.Table</literal>, no
<literal>(a)org.hibernate.annotations.Table</"
+"literal>."
+
+#. Tag: para
+#: entity.xml:1580
+#, no-c-format
+msgid ""
+"<literal>(a)org.hibernate.annotations.Table</literal> can also be used to
"
+"define the following elements of secondary tables:"
+msgstr "<literal>(a)org.hibernate.annotations.Table</literal> también se
puede utilizar para definir los siguientes elementos de tablas secundarias:"
+
+#. Tag: para
+#: entity.xml:1585
+#, no-c-format
+msgid ""
+"<literal>fetch</literal>: If set to JOIN, the default, Hibernate will
use an "
+"inner join to retrieve a secondary table defined by a class or its "
+"superclasses and an outer join for a secondary table defined by a subclass. "
+"If set to select then Hibernate will use a sequential select for a secondary
"
+"table defined on a subclass, which will be issued only if a row turns out to
"
+"represent an instance of the subclass. Inner joins will still be used to "
+"retrieve a secondary defined by the class and its superclasses."
+msgstr "<literal>fetch</literal>: Si se configura como JOIN, el cual es
el valor predeterminado, entonces Hibernate usará una unión interna para recuperar una
tabla secundaria definida por una clase o sus superclases y una unión externa para una
tabla secundaria definida por una subclase. Si se configura como select entonces Hibernate
usará un select secuencial para una tabla secundaria definida en una subclase, la cual se
emitirá solo si una fila resulta representar una instancia de la subclase. Las uniones
interiores todavÃa se utilizarán para recuperar una secundaria definida por la clase y sus
superclases."
+
+#. Tag: para
+#: entity.xml:1597
+#, no-c-format
+msgid ""
+"<literal>inverse</literal>: If true, Hibernate will not try to insert
or "
+"update the properties defined by this join. Default to false."
+msgstr ""
+"<literal>inverse</literal>: Si es verdadero, Hibernate no tratará de
insertar o "
+"actualizar las propiedades definidas por esta unión. Por defecto es falso."
+
+#. Tag: para
+#: entity.xml:1603
+#, no-c-format
+msgid ""
+"<literal>optional</literal>: If enabled (the default), Hibernate will
insert "
+"a row only if the properties defined by this join are non-null and will "
+"always use an outer join to retrieve the properties."
+msgstr "<literal>optional</literal>: Si está habilitado (por defecto),
Hibernate insertará una fila solo si las propiedades definidas por esta unión son no-nulas
y siempre utilizará una unión externa para recuperar las propiedades."
+
+#. Tag: para
+#: entity.xml:1610
+#, no-c-format
+msgid ""
+"<literal>foreignKey</literal>: defines the Foreign Key name of a
secondary "
+"table pointing back to the primary table."
+msgstr "<literal>foreignKey</literal>: define el nombre de la clave
foránea de una tabla secundaria apuntando a la tabla principal."
+
+#. Tag: para
+#: entity.xml:1615
+#, no-c-format
+#, fuzzy
+msgid ""
+"<literal>@Immutable</literal> marks an entity or collection as
immutable. An "
+"immutable entity may not be updated by the application. This allows "
+"Hibernate to make some minor performance optimizations. Updates to an "
+"immutable entity will be ignored, but no exception is thrown. "
+"<literal>@Immutable</literal> must be used on root entities only.
"
+"<literal>@Immutable</literal> placed on a collection makes the
collection "
+"immutable, meaning additions and deletions to and from the collection are "
+"not allowed. A <literal>HibernateException</literal> is thrown in this
case."
+msgstr ""
+"<literal>@Immutable</literal> marca una entidad o colección como
inmutable. An "
+"immutable entity may not be updated by the application. This allows "
+"Hibernate to make some minor performance optimizations. Updates to an "
+"immutable entity will be ignored, but no exception is thrown. "
+"<literal>@Immutable</literal> must be used on root entities only.
"
+"<literal>@Immutable</literal> placed on a collection makes the
collection "
+"immutable, meaning additions and deletions to and from the collection are "
+"not allowed. A <literal>HibernateException</literal> is thrown in this
case."
+
+#. Tag: para
+#: entity.xml:1625
+#, no-c-format
+msgid ""
+"<literal>@Persister</literal> lets you define your own custom
persistence "
+"strategy. You may, for example, specify your own subclass of
<classname>org."
+"hibernate.persister.EntityPersister</classname> or you might even provide a
"
+"completely new implementation of the interface <literal>org.hibernate."
+"persister.ClassPersister</literal> that implements persistence via, for
"
+"example, stored procedure calls, serialization to flat files or LDAP."
+msgstr ""
+"<literal>@Persister</literal> le permite definir su propia estrategia
de persistencia personalizada. Por ejemplo, puede especificar su propia subclase de
<classname>org."
+"hibernate.persister.EntityPersister</classname> o incluso puede brindar una
implementación completamente nueva de la interfaz <literal>org.hibernate."
+"persister.ClassPersister</literal> que implementa la persistencia por medio
de, por "
+"ejemplo, llamadas de procedimiento almacenadas, serialización a archivos planos o
LDAP."
+
+#. Tag: programlisting
+#: entity.xml:1633
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@BatchSize(size=5)\n"
+"(a)org.hibernate.annotations.Entity(\n"
+" selectBeforeUpdate = true,\n"
+" dynamicInsert = true, dynamicUpdate = true,\n"
+" optimisticLock = OptimisticLockType.ALL,\n"
+" polymorphism = PolymorphismType.EXPLICIT)\n"
+"@Where(clause=\"1=1\")\n"
+"(a)org.hibernate.annotations.Table(name=\"Forest\", indexes = {
@Index(name="
+"\"idx\", columnNames = { \"name\", \"length\" } ) }
)\n"
+"(a)Persister(impl=MyEntityPersister.class)\n"
+"public class Forest { ... }"
+msgstr ""
+"@Entity\n"
+"@BatchSize(size=5)\n"
+"(a)org.hibernate.annotations.Entity(\n"
+" selectBeforeUpdate = true,\n"
+" dynamicInsert = true, dynamicUpdate = true,\n"
+" optimisticLock = OptimisticLockType.ALL,\n"
+" polymorphism = PolymorphismType.EXPLICIT)\n"
+"@Where(clause=\"1=1\")\n"
+"(a)org.hibernate.annotations.Table(name=\"Forest\", indexes = {
@Index(name="
+"\"idx\", columnNames = { \"name\", \"length\" } ) }
)\n"
+"(a)Persister(impl=MyEntityPersister.class)\n"
+"public class Forest { ... }"
+
+#. Tag: programlisting
+#: entity.xml:1633
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Inheritance(\n"
+" strategy=InheritanceType.JOINED\n"
+")\n"
+"public class Vegetable { ... }\n"
+"\n"
+"@Entity\n"
+"(a)OnDelete(action=OnDeleteAction.CASCADE)\n"
+"public class Carrot extends Vegetable { ... }"
+msgstr ""
+"@Entity\n"
+"@Inheritance(\n"
+" strategy=InheritanceType.JOINED\n"
+")\n"
+"public class Vegetable { ... }\n"
+"\n"
+"@Entity\n"
+"(a)OnDelete(action=OnDeleteAction.CASCADE)\n"
+"public class Carrot extends Vegetable { ... }"
+
+#. Tag: title
+#: entity.xml:1637
+#, no-c-format
+msgid "Identifier"
+msgstr "Identificador"
+
+#. Tag: para
+#: entity.xml:1639
+#, no-c-format
+msgid ""
+"Hibernate Annotations goes beyond the Java Persistence specification when "
+"defining identifiers."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1643
+#, no-c-format
+msgid "Generators"
+msgstr "Generadores"
+
+#. Tag: literal
+#: entity.xml:1645
+#, no-c-format
+msgid ""
+"<literal>(a)org.hibernate.annotations.GenericGenerator</literal> and
"
+"<literal>(a)org.hibernate.annotations.GenericGenerators</literal> allows
you "
+"to define an Hibernate specific id generator."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1650
+#, no-c-format
+msgid ""
+"@Id @GeneratedValue(generator=\"system-uuid\")\n"
+"@GenericGenerator(name=\"system-uuid\", strategy =
\"uuid\")\n"
+"public String getId() {\n"
+"\n"
+"@Id @GeneratedValue(generator=\"hibseq\")\n"
+"@GenericGenerator(name=\"hibseq\", strategy =
\"seqhilo\",\n"
+" parameters = {\n"
+" @Parameter(name=\"max_lo\", value = \"5\"),\n"
+" @Parameter(name=\"sequence\",
value=\"heybabyhey\")\n"
+" }\n"
+")\n"
+"public Integer getId() {"
+msgstr ""
+"@Id @GeneratedValue(generator=\"system-uuid\")\n"
+"@GenericGenerator(name=\"system-uuid\", strategy =
\"uuid\")\n"
+"public String getId() {\n"
+"\n"
+"@Id @GeneratedValue(generator=\"hibseq\")\n"
+"@GenericGenerator(name=\"hibseq\", strategy =
\"seqhilo\",\n"
+" parameters = {\n"
+" @Parameter(name=\"max_lo\", value = \"5\"),\n"
+" @Parameter(name=\"sequence\",
value=\"heybabyhey\")\n"
+" }\n"
+")\n"
+"public Integer getId() {"
+
+#. Tag: para
+#: entity.xml:1652
+#, no-c-format
+msgid ""
+"<literal>strategy</literal> is the short name of an Hibernate3
generator "
+"strategy or the fully qualified class name of an "
+"<classname>IdentifierGenerator</classname> implementation. You can add
some "
+"parameters through the <literal>parameters</literal> attribute."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1658
+#, no-c-format
+msgid ""
+"Contrary to their standard counterpart,
<literal>@GenericGenerator</literal> "
+"and <literal>@GenericGenerators</literal> can be used in package level
"
+"annotations, making them application level generators (just like if they "
+"were in a JPA XML file)."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1664
+#, no-c-format
+msgid ""
+"@GenericGenerators(\n"
+" {\n"
+" @GenericGenerator(\n"
+" name=\"hibseq\",\n"
+" strategy = \"seqhilo\",\n"
+" parameters = {\n"
+" @Parameter(name=\"max_lo\", value =
\"5\"),\n"
+" @Parameter(name=\"sequence\",
value=\"heybabyhey\")\n"
+" }\n"
+" ),\n"
+" @GenericGenerator(...)\n"
+" }\n"
+")\n"
+"package org.hibernate.test.model"
+msgstr ""
+"@GenericGenerators(\n"
+" {\n"
+" @GenericGenerator(\n"
+" name=\"hibseq\",\n"
+" strategy = \"seqhilo\",\n"
+" parameters = {\n"
+" @Parameter(name=\"max_lo\", value =
\"5\"),\n"
+" @Parameter(name=\"sequence\",
value=\"heybabyhey\")\n"
+" }\n"
+" ),\n"
+" @GenericGenerator(...)\n"
+" }\n"
+")\n"
+"package org.hibernate.test.model"
+
+#. Tag: title
+#: entity.xml:1668
+#, no-c-format
+msgid "@NaturalId"
+msgstr "@NaturalId"
+
+#. Tag: para
+#: entity.xml:1670
+#, no-c-format
+msgid ""
+"While not used as identifier property, some (group of) properties represent "
+"natural identifier of an entity. This is especially true when the schema "
+"uses the recommended approach of using surrogate primary key even if a "
+"natural business key exists. Hibernate allows to map such natural properties
"
+"and reuse them in a <classname>Criteria</classname> query. The natural
"
+"identifier is composed of all the properties marked
<classname>@NaturalId</"
+"classname>."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1679
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Citizen {\n"
+" @Id\n"
+" @GeneratedValue\n"
+" private Integer id;\n"
+" private String firstname;\n"
+" private String lastname;\n"
+" \n"
+" @NaturalId\n"
+" @ManyToOne\n"
+" private State state;\n"
+"\n"
+" @NaturalId\n"
+" private String ssn;\n"
+" ...\n"
+"}\n"
+"\n"
+"\n"
+"\n"
+"//and later on query\n"
+"List results = s.createCriteria( Citizen.class )\n"
+" .add( Restrictions.naturalId().set( \"ssn\",
\"1234\" ).set"
+"( \"state\", ste ) )\n"
+" .list();"
+msgstr ""
+"@Entity\n"
+"public class Citizen {\n"
+" @Id\n"
+" @GeneratedValue\n"
+" private Integer id;\n"
+" private String firstname;\n"
+" private String lastname;\n"
+" \n"
+" @NaturalId\n"
+" @ManyToOne\n"
+" private State state;\n"
+"\n"
+" @NaturalId\n"
+" private String ssn;\n"
+" ...\n"
+"}\n"
+"\n"
+"\n"
+"\n"
+"//and later on query\n"
+"List results = s.createCriteria( Citizen.class )\n"
+" .add( Restrictions.naturalId().set( \"ssn\",
\"1234\" ).set"
+"( \"state\", ste ) )\n"
+" .list();"
+
+#. Tag: para
+#: entity.xml:1681
+#, no-c-format
+msgid ""
+"Note that the group of properties representing the natural identifier have "
+"to be unique (Hibernate will generate a unique constraint if the database "
+"schema is generated)."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1688
+#, no-c-format
+msgid "Property"
+msgstr "Propiedad"
+
+#. Tag: title
+#: entity.xml:1691
+#, no-c-format
+msgid "Access type"
+msgstr "Tipo de acceso"
+
+#. Tag: para
+#: entity.xml:1693
+#, no-c-format
+msgid ""
+"The access type is guessed from the position of <literal>@Id</literal>
or "
+"<literal>@EmbeddedId</literal> in the entity hierarchy. Sub-entities,
"
+"embedded objects and mapped superclass inherit the access type from the root
"
+"entity."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1698
+#, no-c-format
+msgid "In Hibernate, you can override the access type to:"
+msgstr "En Hibernate, puede sobreescribir el tipo de acceso a:"
+
+#. Tag: para
+#: entity.xml:1702
+#, no-c-format
+msgid "use a custom access type strategy"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1706
+#, no-c-format
+msgid "fine tune the access type at the class level or at the property level"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1711
+#, no-c-format
+msgid ""
+"An @AccessType annotation has been introduced to support this behavior. You "
+"can define the access type on"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1716
+#, no-c-format
+msgid "an entity"
+msgstr "una entidad"
+
+#. Tag: para
+#: entity.xml:1720
+#, no-c-format
+msgid "a superclass"
+msgstr "una superclase"
+
+#. Tag: para
+#: entity.xml:1724
+#, no-c-format
+msgid "an embeddable object"
+msgstr "un objeto incluÃdo"
+
+#. Tag: para
+#: entity.xml:1728
+#, no-c-format
+msgid "a property"
+msgstr "una propiedad"
+
+#. Tag: para
+#: entity.xml:1732
+#, no-c-format
+msgid ""
+"The access type is overriden for the annotated element, if overriden on a "
+"class, all the properties of the given class inherit the access type. For "
+"root entities, the access type is considered to be the default one for the "
+"whole hierarchy (overridable at class or property level)."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1738
+#, no-c-format
+msgid ""
+"If the access type is marked as \"property\", the getters are scanned for
"
+"annotations, if the access type is marked as \"field\", the fields are
"
+"scanned for annotations. Otherwise the elements marked with @Id or "
+"@embeddedId are scanned."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1743
+#, no-c-format
+msgid ""
+"You can override an access type for a property, but the element to annotate "
+"will not be influenced: for example an entity having access type "
+"<literal>field</literal>, can annotate a field with
<literal>@AccessType"
+"(\"property\")</literal>, the access type will then be property for
this "
+"attribute, the the annotations still have to be carried on the field."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1750
+#, no-c-format
+msgid ""
+"If a superclass or an embeddable object is not annotated, the root entity "
+"access type is used (even if an access type has been define on an "
+"intermediate superclass or embeddable object). The russian doll principle "
+"does not apply."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1755
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Person implements Serializable {\n"
+" @Id @GeneratedValue //access type field\n"
+" Integer id;\n"
+"\n"
+" @Embedded\n"
+" @AttributeOverrides({\n"
+" @AttributeOverride(name = \"iso2\", column = @Column(name =
\"bornIso2"
+"\")),\n"
+" @AttributeOverride(name = \"name\", column = @Column(name = "
+"\"bornCountryName\"))\n"
+" })\n"
+" Country bornIn;\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"<emphasis
role=\"bold\">@AccessType(\"property\")</emphasis> //override
"
+"access type for all properties in Country\n"
+"public class Country implements Serializable {\n"
+" private String iso2;\n"
+" private String name;\n"
+"\n"
+" public String getIso2() {\n"
+" return iso2;\n"
+" }\n"
+"\n"
+" public void setIso2(String iso2) {\n"
+" this.iso2 = iso2;\n"
+" }\n"
+"\n"
+" @Column(name = \"countryName\")\n"
+" public String getName() {\n"
+" return name;\n"
+" }\n"
+"\n"
+" public void setName(String name) {\n"
+" this.name = name;\n"
+" }\n"
+"}"
+msgstr ""
+"@Entity\n"
+"public class Person implements Serializable {\n"
+" @Id @GeneratedValue //access type field\n"
+" Integer id;\n"
+"\n"
+" @Embedded\n"
+" @AttributeOverrides({\n"
+" @AttributeOverride(name = \"iso2\", column = @Column(name =
\"bornIso2"
+"\")),\n"
+" @AttributeOverride(name = \"name\", column = @Column(name = "
+"\"bornCountryName\"))\n"
+" })\n"
+" Country bornIn;\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"<emphasis
role=\"bold\">@AccessType(\"property\")</emphasis> //override
"
+"access type for all properties in Country\n"
+"public class Country implements Serializable {\n"
+" private String iso2;\n"
+" private String name;\n"
+"\n"
+" public String getIso2() {\n"
+" return iso2;\n"
+" }\n"
+"\n"
+" public void setIso2(String iso2) {\n"
+" this.iso2 = iso2;\n"
+" }\n"
+"\n"
+" @Column(name = \"countryName\")\n"
+" public String getName() {\n"
+" return name;\n"
+" }\n"
+"\n"
+" public void setName(String name) {\n"
+" this.name = name;\n"
+" }\n"
+"}"
+
+#. Tag: title
+#: entity.xml:1759
+#, no-c-format
+msgid "Formula"
+msgstr "Fórmula"
+
+#. Tag: para
+#: entity.xml:1761
+#, no-c-format
+msgid ""
+"Sometimes, you want the Database to do some computation for you rather than "
+"in the JVM, you might also create some kind of virtual column. You can use a
"
+"SQL fragment (aka formula) instead of mapping a property into a column. This
"
+"kind of property is read only (its value is calculated by your formula "
+"fragment)."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1767
+#, no-c-format
+msgid ""
+"@Formula(\"obj_length * obj_height * obj_width\")\n"
+"public long getObjectVolume()"
+msgstr ""
+"@Formula(\"obj_length * obj_height * obj_width\")\n"
+"public long getObjectVolume()"
+
+#. Tag: para
+#: entity.xml:1769
+#, no-c-format
+msgid "The SQL fragment can be as complex as you want and even include
subselects."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1774
+#, no-c-format
+msgid "Type"
+msgstr "Tipo"
+
+#. Tag: para
+#: entity.xml:1776
+#, no-c-format
+msgid ""
+"<literal>(a)org.hibernate.annotations.Type</literal> overrides the
default "
+"hibernate type used: this is generally not necessary since the type is "
+"correctly inferred by Hibernate. Please refer to the Hibernate reference "
+"guide for more informations on the Hibernate types."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1781
+#, no-c-format
+msgid ""
+"<literal>(a)org.hibernate.annotations.TypeDef</literal> and
<literal>(a)org."
+"hibernate.annotations.TypeDefs</literal> allows you to declare type "
+"definitions. These annotations can be placed at the class or package level. "
+"Note that these definitions are be global for the session factory (even when
"
+"defined at the class level). Type definitions have to be defined before any "
+"usage. If the type is used on a single entity, you can plance the definition
"
+"on the entity itself. Otherwise, it is recommended to place the definition a
"
+"the package level since the entity processing order is not guaranteed."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1790
+#, no-c-format
+msgid ""
+"Package level annotations are placed in a file named
<filename>package-info."
+"java</filename> in the appropriate package. Place your annotations before
"
+"the package declaration."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1793
+#, no-c-format
+msgid ""
+"//in org/hibernate/test/annotations/entity/package-info.java\n"
+"@TypeDefs(\n"
+" {\n"
+" @TypeDef(\n"
+" name=\"caster\",\n"
+" typeClass = CasterStringType.class,\n"
+" parameters = {\n"
+" @Parameter(name=\"cast\", value=\"lower\")\n"
+" }\n"
+" )\n"
+" }\n"
+")\n"
+"package org.hibernate.test.annotations.entity;\n"
+"\n"
+"//in org/hibernate/test/annotations/entity/Forest.java\n"
+"public class Forest {\n"
+" @Type(type=\"caster\")\n"
+" public String getSmallText() {\n"
+" ...\n"
+"}"
+msgstr ""
+"//in org/hibernate/test/annotations/entity/package-info.java\n"
+"@TypeDefs(\n"
+" {\n"
+" @TypeDef(\n"
+" name=\"caster\",\n"
+" typeClass = CasterStringType.class,\n"
+" parameters = {\n"
+" @Parameter(name=\"cast\", value=\"lower\")\n"
+" }\n"
+" )\n"
+" }\n"
+")\n"
+"package org.hibernate.test.annotations.entity;\n"
+"\n"
+"//in org/hibernate/test/annotations/entity/Forest.java\n"
+"public class Forest {\n"
+" @Type(type=\"caster\")\n"
+" public String getSmallText() {\n"
+" ...\n"
+"}"
+
+#. Tag: para
+#: entity.xml:1795
+#, no-c-format
+msgid ""
+"When using composite user type, you will have to express column definitions.
"
+"The <literal>@Columns</literal> has been introduced for that
purpose."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1799
+#, no-c-format
+msgid ""
+"(a)Type(type=\"org.hibernate.test.annotations.entity.MonetaryAmountUserType"
+"\")\n"
+"@Columns(columns = {\n"
+" @Column(name=\"r_amount\"),\n"
+" @Column(name=\"r_currency\")\n"
+"})\n"
+"public MonetaryAmount getAmount() {\n"
+" return amount;\n"
+"}\n"
+"\n"
+"\n"
+"public class MonetaryAmount implements Serializable {\n"
+" private BigDecimal amount;\n"
+" private Currency currency;\n"
+" ...\n"
+"}"
+msgstr ""
+"(a)Type(type=\"org.hibernate.test.annotations.entity.MonetaryAmountUserType"
+"\")\n"
+"@Columns(columns = {\n"
+" @Column(name=\"r_amount\"),\n"
+" @Column(name=\"r_currency\")\n"
+"})\n"
+"public MonetaryAmount getAmount() {\n"
+" return amount;\n"
+"}\n"
+"\n"
+"\n"
+"public class MonetaryAmount implements Serializable {\n"
+" private BigDecimal amount;\n"
+" private Currency currency;\n"
+" ...\n"
+"}"
+
+#. Tag: title
+#: entity.xml:1803
+#, no-c-format
+msgid "Index"
+msgstr "Indice"
+
+#. Tag: para
+#: entity.xml:1805
+#, no-c-format
+msgid ""
+"You can define an index on a particular column using the
<literal>@Index</"
+"literal> annotation on a one column property, the columnNames attribute will
"
+"then be ignored"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1809
+#, no-c-format
+msgid ""
+"@Column(secondaryTable=\"Cat1\")\n"
+"@Index(name=\"story1index\")\n"
+"public String getStoryPart1() {\n"
+" return storyPart1;\n"
+"}"
+msgstr ""
+"@Column(secondaryTable=\"Cat1\")\n"
+"@Index(name=\"story1index\")\n"
+"public String getStoryPart1() {\n"
+" return storyPart1;\n"
+"}"
+
+#. Tag: title
+#: entity.xml:1813
+#, no-c-format
+msgid "@Parent"
+msgstr "@Parent"
+
+#. Tag: para
+#: entity.xml:1815
+#, no-c-format
+msgid ""
+"When inside an embeddable object, you can define one of the properties as a "
+"pointer back to the owner element."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1818
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Person {\n"
+" @Embeddable public Address address;\n"
+" ...\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"public class Address {\n"
+" @Parent public Person owner;\n"
+" ...\n"
+"}\n"
+"\n"
+"\n"
+"person == person.address.owner"
+msgstr ""
+"@Entity\n"
+"public class Person {\n"
+" @Embeddable public Address address;\n"
+" ...\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"public class Address {\n"
+" @Parent public Person owner;\n"
+" ...\n"
+"}\n"
+"\n"
+"\n"
+"person == person.address.owner"
+
+#. Tag: title
+#: entity.xml:1822
+#, no-c-format
+msgid "Generated properties"
+msgstr "Propiedades generadas"
+
+#. Tag: para
+#: entity.xml:1824
+#, no-c-format
+msgid ""
+"Some properties are generated at insert or update time by your database. "
+"Hibernate can deal with such properties and triggers a subsequent select to "
+"read these properties."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1828
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Antenna {\n"
+" @Id public Integer id;\n"
+" @Generated(GenerationTime.ALWAYS) @Column(insertable = false, updatable "
+"= false)\n"
+" public String longitude;\n"
+"\n"
+" @Generated(GenerationTime.INSERT) @Column(insertable = false)\n"
+" public String latitude;\n"
+"}"
+msgstr ""
+"@Entity\n"
+"public class Antenna {\n"
+" @Id public Integer id;\n"
+" @Generated(GenerationTime.ALWAYS) @Column(insertable = false, updatable "
+"= false)\n"
+" public String longitude;\n"
+"\n"
+" @Generated(GenerationTime.INSERT) @Column(insertable = false)\n"
+" public String latitude;\n"
+"}"
+
+#. Tag: para
+#: entity.xml:1830
+#, no-c-format
+msgid ""
+"Annotate your property as <literal>@Generated</literal> You have to
make "
+"sure your insertability or updatability does not conflict with the "
+"generation strategy you have chosen. When GenerationTime.INSERT is chosen, "
+"the property must not contains insertable columns, when GenerationTime."
+"ALWAYS is chosen, the property must not contains insertable nor updatable "
+"columns."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1837
+#, no-c-format
+msgid ""
+"<literal>@Version</literal> properties cannot be
<literal>@Generated(INSERT)"
+"</literal> by design, it has to be either
<literal>NEVER</literal> or "
+"<literal>ALWAYS</literal>."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1843
+#, no-c-format
+msgid "@Target"
+msgstr "@Target"
+
+#. Tag: para
+#: entity.xml:1845
+#, no-c-format
+msgid ""
+"Sometimes, the type guessed by reflection is not the one you want Hibernate "
+"to use. This is especially true on components when an interface is used. You
"
+"can use <literal>@Target</literal> to by pass the reflection guessing
"
+"mechanism (very much like the <literal>targetEntity</literal> attribute
"
+"available on associations."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1852
+#, no-c-format
+msgid ""
+"@Embedded\n"
+" <emphasis
role=\"bold\">(a)Target(OwnerImpl.class)</emphasis>\n"
+" public Owner getOwner() {\n"
+" return owner;\n"
+" }"
+msgstr ""
+"@Embedded\n"
+" <emphasis
role=\"bold\">(a)Target(OwnerImpl.class)</emphasis>\n"
+" public Owner getOwner() {\n"
+" return owner;\n"
+" }"
+
+#. Tag: title
+#: entity.xml:1858
+#, no-c-format
+msgid "Optimistic lock"
+msgstr "Bloqueo optimista"
+
+#. Tag: para
+#: entity.xml:1860
+#, no-c-format
+msgid ""
+"It is sometimes useful to avoid increasing the version number even if a "
+"given property is dirty (particularly collections). You can do that by "
+"annotating the property (or collection) with <literal>@OptimisticLock"
+"(excluded=true)</literal>."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1865
+#, no-c-format
+msgid ""
+"More formally, specifies that updates to this property do not require "
+"acquisition of the optimistic lock."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1871
+#, no-c-format
+msgid "Inheritance"
+msgstr "Herencia"
+
+#. Tag: para
+#: entity.xml:1873
+#, no-c-format
+msgid ""
+"SINGLE_TABLE is a very powerful strategy but sometimes, and especially for "
+"legacy systems, you cannot add an additional discriminator column. For that "
+"purpose Hibernate has introduced the notion of discriminator formula: "
+"<literal>@DiscriminatorFormula</literal> is a replacement of "
+"<literal>@DiscriminatorColumn</literal> and use a SQL fragment as a
formula "
+"for discriminator resolution (no need to have a dedicated column)."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1882
+#, no-c-format
+msgid ""
+"@Entity\n"
+"<emphasis role=\"bold\">@DiscriminatorFormula(\"case when
forest_type is "
+"null then 0 else forest_type end\")</emphasis>\n"
+"public class Forest { ... }"
+msgstr ""
+"@Entity\n"
+"<emphasis role=\"bold\">@DiscriminatorFormula(\"case when
forest_type is "
+"null then 0 else forest_type end\")</emphasis>\n"
+"public class Forest { ... }"
+
+#. Tag: para
+#: entity.xml:1884
+#, no-c-format
+msgid ""
+"By default, when querying the top entities, Hibernate does not put a "
+"restriction clause on the discriminator column. This can be inconvenient if "
+"this column contains values not mapped in your hierarchy (through "
+"<literal>@DiscriminatorValue</literal>). To work around that you can
use "
+"<literal>@ForceDiscriminator</literal> (at the class level, next to
"
+"<literal>@DiscriminatorColumn</literal>). Hibernate will then list the
"
+"available values when loading the entities."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1892
+#, no-c-format
+msgid ""
+"You can define the foreign key name generated by Hibernate for subclass "
+"tables in the JOINED inheritance strategy."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1895
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Inheritance(strategy = InheritanceType.JOINED)\n"
+"public abstract class File { ... }\n"
+"\n"
+"@Entity\n"
+"@ForeignKey(name = \"FK_DOCU_FILE\")\n"
+"public class Document extends File {"
+msgstr ""
+"@Entity\n"
+"@Inheritance(strategy = InheritanceType.JOINED)\n"
+"public abstract class File { ... }\n"
+"\n"
+"@Entity\n"
+"@ForeignKey(name = \"FK_DOCU_FILE\")\n"
+"public class Document extends File {"
+
+#. Tag: para
+#: entity.xml:1897
+#, no-c-format
+msgid ""
+"The foreign key from the <literal>Document</literal> table to the
"
+"<literal>File</literal> table will be named
<literal>FK_DOCU_FILE</literal>."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1903
+#, no-c-format
+msgid "Single Association related annotations"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1905
+#, no-c-format
+msgid ""
+"By default, when Hibernate cannot resolve the association because the "
+"expected associated element is not in database (wrong id on the association "
+"column), an exception is raised by Hibernate. This might be inconvenient for
"
+"legacy and badly maintained schemas. You can ask Hibernate to ignore such "
+"elements instead of raising an exception using the
<literal>@NotFound</"
+"literal> annotation. This annotation can be used on a
<literal>@OneToOne</"
+"literal> (with FK), <literal>@ManyToOne</literal>,
<literal>@OneToMany</"
+"literal> or <literal>@ManyToMany</literal> association."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1915
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Child {\n"
+" ...\n"
+" @ManyToOne\n"
+" @NotFound(action=NotFoundAction.IGNORE)\n"
+" public Parent getParent() { ... }\n"
+" ...\n"
+"}"
+msgstr ""
+"@Entity\n"
+"public class Child {\n"
+" ...\n"
+" @ManyToOne\n"
+" @NotFound(action=NotFoundAction.IGNORE)\n"
+" public Parent getParent() { ... }\n"
+" ...\n"
+"}"
+
+#. Tag: para
+#: entity.xml:1917
+#, no-c-format
+msgid ""
+"Sometimes you want to delegate to your database the deletion of cascade when
"
+"a given entity is deleted."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1920
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Child {\n"
+" ...\n"
+" @ManyToOne\n"
+" @OnDelete(action=OnDeleteAction.CASCADE)\n"
+" public Parent getParent() { ... }\n"
+" ...\n"
+"}"
+msgstr ""
+"@Entity\n"
+"public class Child {\n"
+" ...\n"
+" @ManyToOne\n"
+" @OnDelete(action=OnDeleteAction.CASCADE)\n"
+" public Parent getParent() { ... }\n"
+" ...\n"
+"}"
+
+#. Tag: para
+#: entity.xml:1922
+#, no-c-format
+msgid ""
+"In this case Hibernate generates a cascade delete constraint at the database
"
+"level."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1925
+#, no-c-format
+msgid ""
+"Foreign key constraints, while generated by Hibernate, have a fairly "
+"unreadable name. You can override the constraint name by use "
+"<literal>(a)ForeignKey</literal>."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1929
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Child {\n"
+" ...\n"
+" @ManyToOne\n"
+" <emphasis
role=\"bold\">@ForeignKey(name=\"FK_PARENT\")</emphasis>\n"
+" public Parent getParent() { ... }\n"
+" ...\n"
+"}\n"
+"\n"
+"alter table Child add constraint FK_PARENT foreign key (parent_id) "
+"references Parent"
+msgstr ""
+"@Entity\n"
+"public class Child {\n"
+" ...\n"
+" @ManyToOne\n"
+" <emphasis
role=\"bold\">@ForeignKey(name=\"FK_PARENT\")</emphasis>\n"
+" public Parent getParent() { ... }\n"
+" ...\n"
+"}\n"
+"\n"
+"alter table Child add constraint FK_PARENT foreign key (parent_id) "
+"references Parent"
+
+#. Tag: title
+#: entity.xml:1932
+#, no-c-format
+msgid "Lazy options and fetching modes"
+msgstr "Opciones perezosas y modos de búsqueda"
+
+#. Tag: para
+#: entity.xml:1934
+#, no-c-format
+msgid ""
+"EJB3 comes with the <literal>fetch</literal> option to define lazy
loading "
+"and fetching modes, however Hibernate has a much more option set in this "
+"area. To fine tune the lazy loading and fetching strategies, some additional
"
+"annotations have been introduced:"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1941
+#, no-c-format
+msgid ""
+"<literal>@LazyToOne</literal>: defines the lazyness option on "
+"<literal>@ManyToOne</literal> and
<literal>@OneToOne</literal> associations. "
+"<literal>LazyToOneOption</literal> can be
<literal>PROXY</literal> (ie use a "
+"proxy based lazy loading), <literal>NO_PROXY</literal> (use a bytecode
"
+"enhancement based lazy loading - note that build time bytecode processing is
"
+"necessary) and <literal>FALSE</literal> (association not lazy)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1951
+#, no-c-format
+msgid ""
+"<literal>@LazyCollection</literal>: defines the lazyness option on
"
+"<literal>@ManyTo</literal>Many and
<literal>@OneToMany</literal> "
+"associations. LazyCollectionOption can be <literal>TRUE</literal> (the
"
+"collection is lazy and will be loaded when its state is accessed), "
+"<literal>EXTRA</literal> (the collection is lazy and all operations
will try "
+"to avoid the collection loading, this is especially useful for huge "
+"collections when loading all the elements is not necessary) and FALSE "
+"(association not lazy)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1963
+#, no-c-format
+msgid ""
+"<literal>@Fetch</literal>: defines the fetching strategy used to load
the "
+"association. <literal>FetchMode</literal> can be
<literal>SELECT</literal> "
+"(a select is triggered when the association needs to be loaded), "
+"<literal>SUBSELECT</literal> (only available for collections, use a
"
+"subselect strategy - please refers to the Hibernate Reference Documentation "
+"for more information) or <literal>JOIN</literal> (use a SQL JOIN to
load the "
+"association while loading the owner entity). <literal>JOIN</literal>
"
+"overrides any lazy attribute (an association loaded through a
<literal>JOIN</"
+"literal> strategy cannot be lazy)."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1977
+#, no-c-format
+msgid "The Hibernate annotations overrides the EJB3 fetching options."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1981
+#, no-c-format
+msgid "Lazy and fetch options equivalent"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1986
+#, no-c-format
+msgid "Annotations"
+msgstr "Anotaciones"
+
+#. Tag: entry
+#: entity.xml:1988
+#, no-c-format
+msgid "Lazy"
+msgstr "Perezoso"
+
+#. Tag: entry
+#: entity.xml:1990
+#, no-c-format
+msgid "Fetch"
+msgstr "Búsqueda"
+
+#. Tag: entry
+#: entity.xml:1996
+#, no-c-format
+msgid "(a)[One|Many]ToOne](fetch=FetchType.LAZY)"
+msgstr "(a)[One|Many]ToOne](fetch=FetchType.LAZY)"
+
+#. Tag: entry
+#: entity.xml:1998
+#, no-c-format
+msgid "@LazyToOne(PROXY)"
+msgstr "@LazyToOne(PROXY)"
+
+#. Tag: entry
+#: entity.xml:2000 entity.xml:2016
+#, no-c-format
+msgid "@Fetch(SELECT)"
+msgstr "@Fetch(SELECT)"
+
+#. Tag: entry
+#: entity.xml:2004
+#, no-c-format
+msgid "(a)[One|Many]ToOne](fetch=FetchType.EAGER)"
+msgstr "(a)[One|Many]ToOne](fetch=FetchType.EAGER)"
+
+#. Tag: entry
+#: entity.xml:2006
+#, no-c-format
+msgid "@LazyToOne(FALSE)"
+msgstr "@LazyToOne(FALSE)"
+
+#. Tag: entry
+#: entity.xml:2008 entity.xml:2024
+#, no-c-format
+msgid "@Fetch(JOIN)"
+msgstr "@Fetch(JOIN)"
+
+#. Tag: entry
+#: entity.xml:2012
+#, no-c-format
+msgid "(a)ManyTo[One|Many](fetch=FetchType.LAZY)"
+msgstr "(a)ManyTo[One|Many](fetch=FetchType.LAZY)"
+
+#. Tag: entry
+#: entity.xml:2014
+#, no-c-format
+msgid "@LazyCollection(TRUE)"
+msgstr "@LazyCollection(TRUE)"
+
+#. Tag: entry
+#: entity.xml:2020
+#, no-c-format
+msgid "(a)ManyTo[One|Many](fetch=FetchType.EAGER)"
+msgstr "(a)ManyTo[One|Many](fetch=FetchType.EAGER)"
+
+#. Tag: entry
+#: entity.xml:2022
+#, no-c-format
+msgid "@LazyCollection(FALSE)"
+msgstr "@LazyCollection(FALSE)"
+
+#. Tag: title
+#: entity.xml:2032
+#, no-c-format
+msgid "@Any"
+msgstr "@Any"
+
+#. Tag: para
+#: entity.xml:2034
+#, no-c-format
+msgid ""
+"The <classname>@Any</classname> annotation defines a polymorphic
association "
+"to classes from multiple tables. This type of mapping always requires more "
+"than one column. The first column holds the type of the associated entity. "
+"The remaining columns hold the identifier. It is impossible to specify a "
+"foreign key constraint for this kind of association, so this is most "
+"certainly not meant as the usual way of mapping (polymorphic) associations. "
+"You should use this only in very special cases (eg. audit logs, user session
"
+"data, etc)."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2043
+#, no-c-format
+msgid ""
+"The @Any annotation describes the column holding the metadata information. "
+"To link the value of the metadata information and an actual entity type, The
"
+"<classname>@AnyDef</classname> and
<classname>@AnyDefs</classname> "
+"annotations are used."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2048
+#, no-c-format
+msgid ""
+"@Any( metaColumn = @Column( name = \"property_type\" ),
fetch=FetchType."
+"EAGER )\n"
+" @AnyMetaDef( \n"
+" idType = \"integer\", \n"
+" metaType = \"string\", \n"
+" metaValues = {\n"
+" @MetaValue( value = \"S\", targetEntity =
StringProperty."
+"class ),\n"
+" @MetaValue( value = \"I\", targetEntity =
IntegerProperty."
+"class )\n"
+" } )\n"
+" @JoinColumn( name = \"property_id\" )\n"
+" public Property getMainProperty() {\n"
+" return mainProperty;\n"
+" }"
+msgstr ""
+"@Any( metaColumn = @Column( name = \"property_type\" ),
fetch=FetchType."
+"EAGER )\n"
+" @AnyMetaDef( \n"
+" idType = \"integer\", \n"
+" metaType = \"string\", \n"
+" metaValues = {\n"
+" @MetaValue( value = \"S\", targetEntity =
StringProperty."
+"class ),\n"
+" @MetaValue( value = \"I\", targetEntity =
IntegerProperty."
+"class )\n"
+" } )\n"
+" @JoinColumn( name = \"property_id\" )\n"
+" public Property getMainProperty() {\n"
+" return mainProperty;\n"
+" }"
+
+#. Tag: para
+#: entity.xml:2050
+#, no-c-format
+msgid ""
+"<methodname>idType</methodname> represents the target entities
identifier "
+"property type and <methodname>metaType</methodname> the metadata type
"
+"(usually String)."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2054
+#, no-c-format
+msgid ""
+"Note that <classname>@AnyDef</classname> can be mutualized and reused.
It is "
+"recommended to place it as a package metadata in this case."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2058
+#, no-c-format
+msgid ""
+"//on a package\n"
+"@AnyMetaDef( name=\"property\" \n"
+" idType = \"integer\", \n"
+" metaType = \"string\", \n"
+" metaValues = {\n"
+" @MetaValue( value = \"S\", targetEntity = StringProperty.class
),\n"
+" @MetaValue( value = \"I\", targetEntity = IntegerProperty.class
)\n"
+" } )\n"
+"package org.hibernate.test.annotations.any;\n"
+"\n"
+"\n"
+"//in a class\n"
+" @Any( metaDef=\"property\", metaColumn = @Column( name =
\"property_type"
+"\" ), fetch=FetchType.EAGER )\n"
+" @JoinColumn( name = \"property_id\" )\n"
+" public Property getMainProperty() {\n"
+" return mainProperty;\n"
+" }"
+msgstr ""
+"//on a package\n"
+"@AnyMetaDef( name=\"property\" \n"
+" idType = \"integer\", \n"
+" metaType = \"string\", \n"
+" metaValues = {\n"
+" @MetaValue( value = \"S\", targetEntity = StringProperty.class
),\n"
+" @MetaValue( value = \"I\", targetEntity = IntegerProperty.class
)\n"
+" } )\n"
+"package org.hibernate.test.annotations.any;\n"
+"\n"
+"\n"
+"//in a class\n"
+" @Any( metaDef=\"property\", metaColumn = @Column( name =
\"property_type"
+"\" ), fetch=FetchType.EAGER )\n"
+" @JoinColumn( name = \"property_id\" )\n"
+" public Property getMainProperty() {\n"
+" return mainProperty;\n"
+" }"
+
+#. Tag: title
+#: entity.xml:2063
+#, no-c-format
+msgid "Collection related annotations"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:2066
+#, no-c-format
+msgid "Enhance collection settings"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2068
+#, no-c-format
+msgid "It is possible to set"
+msgstr "Es posible configurar"
+
+#. Tag: para
+#: entity.xml:2070
+#, no-c-format
+msgid "the batch size for collections using @BatchSize"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2075
+#, no-c-format
+msgid ""
+"the where clause, using @Where (applied on the target entity) or "
+"@WhereJoinTable (applied on the association table)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2080
+#, no-c-format
+msgid "the check clause, using @Check"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2085
+#, no-c-format
+msgid "the SQL order by clause, using @OrderBy"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2090
+#, no-c-format
+msgid "the delete cascade strategy through
@OnDelete(action=OnDeleteAction.CASCADE)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2095
+#, no-c-format
+msgid ""
+"the collection immutability using @Immutable: if set specifies that the "
+"elements of the collection never change (a minor performance optimization in
"
+"some cases)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2100
+#, no-c-format
+msgid ""
+"a custom collection persister (ie the persistence strategy used) using "
+"<literal>@Persister</literal>: the class must implement
<classname>org."
+"hibernate.persister.collectionCollectionPersister</classname>"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2107
+#, no-c-format
+msgid ""
+"You can also declare a sort comparator. Use the
<literal>@Sort</literal> "
+"annotation. Expressing the comparator type you want between unsorted, "
+"natural or custom comparator. If you want to use your own comparator "
+"implementation, you'll also have to express the implementation class using
"
+"the <literal>comparator</literal> attribute. Note that you need to use
"
+"either a <classname>SortedSet</classname> or a
<classname>SortedMap</"
+"classname> interface."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2116
+#, no-c-format
+msgid ""
+"(a)OneToMany(cascade=CascadeType.ALL, fetch=FetchType.EAGER)\n"
+" @JoinColumn(name=\"CUST_ID\")\n"
+" @Sort(type = SortType.COMPARATOR, comparator = TicketComparator.class)\n"
+" @Where(clause=\"1=1\")\n"
+" @OnDelete(action=OnDeleteAction.CASCADE)\n"
+" public SortedSet<Ticket> getTickets() {\n"
+" return tickets;\n"
+" }"
+msgstr ""
+"(a)OneToMany(cascade=CascadeType.ALL, fetch=FetchType.EAGER)\n"
+" @JoinColumn(name=\"CUST_ID\")\n"
+" @Sort(type = SortType.COMPARATOR, comparator = TicketComparator.class)\n"
+" @Where(clause=\"1=1\")\n"
+" @OnDelete(action=OnDeleteAction.CASCADE)\n"
+" public SortedSet<Ticket> getTickets() {\n"
+" return tickets;\n"
+" }"
+
+#. Tag: para
+#: entity.xml:2118
+#, no-c-format
+msgid ""
+"Please refer to the previous descriptions of these annotations for more "
+"informations."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2121
+#, no-c-format
+msgid ""
+"Foreign key constraints, while generated by Hibernate, have a fairly "
+"unreadable name. You can override the constraint name by use "
+"<literal>@ForeignKey</literal>. Note that this annotation has to be
placed "
+"on the owning side of the relationship, <literal>inverseName</literal>
"
+"referencing to the other side constraint."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2128
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Woman {\n"
+" ...\n"
+" @ManyToMany(cascade = {CascadeType.ALL})\n"
+" <emphasis role=\"bold\">@ForeignKey(name =
\"TO_WOMAN_FK\", inverseName "
+"= \"TO_MAN_FK\")</emphasis>\n"
+" public Set<Man> getMens() {\n"
+" return mens;\n"
+" }\n"
+"}\n"
+"\n"
+"alter table Man_Woman add constraint TO_WOMAN_FK foreign key (woman_id) "
+"references Woman\n"
+"alter table Man_Woman add constraint TO_MAN_FK foreign key (man_id) "
+"references Man"
+msgstr ""
+"@Entity\n"
+"public class Woman {\n"
+" ...\n"
+" @ManyToMany(cascade = {CascadeType.ALL})\n"
+" <emphasis role=\"bold\">@ForeignKey(name =
\"TO_WOMAN_FK\", inverseName "
+"= \"TO_MAN_FK\")</emphasis>\n"
+" public Set<Man> getMens() {\n"
+" return mens;\n"
+" }\n"
+"}\n"
+"\n"
+"alter table Man_Woman add constraint TO_WOMAN_FK foreign key (woman_id) "
+"references Woman\n"
+"alter table Man_Woman add constraint TO_MAN_FK foreign key (man_id) "
+"references Man"
+
+#. Tag: title
+#: entity.xml:2132
+#, no-c-format
+msgid "Extra collection types"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:2135
+#, no-c-format
+msgid "List"
+msgstr "List"
+
+#. Tag: para
+#: entity.xml:2137
+#, no-c-format
+msgid ""
+"Beyond EJB3, Hibernate Annotations supports true
<classname>List</classname> "
+"and <classname>Array</classname>. Map your collection the same way as
usual "
+"and add the @<literal>IndexColumn</literal>. This annotation allows you
to "
+"describe the column that will hold the index. You can also declare the index
"
+"value in DB that represent the first element (aka as base index). The usual "
+"value is <literal>0</literal> or
<literal>1</literal>."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2146
+#, no-c-format
+msgid ""
+"@OneToMany(cascade = CascadeType.ALL)\n"
+"@IndexColumn(name = \"drawer_position\", base=1)\n"
+"public List<Drawer> getDrawers() {\n"
+" return drawers;\n"
+"}"
+msgstr ""
+"@OneToMany(cascade = CascadeType.ALL)\n"
+"@IndexColumn(name = \"drawer_position\", base=1)\n"
+"public List<Drawer> getDrawers() {\n"
+" return drawers;\n"
+"}"
+
+#. Tag: para
+#: entity.xml:2149
+#, no-c-format
+msgid ""
+"If you forgot to set <literal>@IndexColumn</literal>, the bag semantic
is "
+"applied. If you want the bag semantic without the limitations of it, "
+"consider using <literal>(a)CollectionId</literal>."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:2157
+#, no-c-format
+msgid "<title>Map</title>"
+msgstr "<title>Map</title>"
+
+#. Tag: para
+#: entity.xml:2159
+#, no-c-format
+msgid ""
+"Hibernate Annotations also supports true Map mappings, if
<literal>(a)javax."
+"persistence.MapKey</literal> is not set, hibernate will map the key element
"
+"or embeddable object in its/their own columns. To override the default "
+"columns, you can use
<literal>(a)org.hibernate.annotations.MapKey</literal> if "
+"your key is a basic type (defaulted to <literal>mapkey</literal>) or an
"
+"embeddable object, or you can use <literal>(a)org.hibernate.annotations."
+"MapKeyManyToMany</literal> if your key is an entity."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2169
+#, no-c-format
+msgid ""
+"Both <literal>(a)org.hibernate.annotations.MapKey</literal> and
<literal>(a)org."
+"hibernate.annotations.MapKeyManyToMany</literal> allows you to override the
"
+"target element to be used. This is especially useful if your collection does
"
+"not use generics (or if you use interfaces)."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2175
+#, no-c-format
+msgid ""
+"@CollectionOfElements(targetElement = SizeImpl.class)\n"
+" @MapKeyManyToMany(<emphasis role=\"bold\">targetEntity =
LuggageImpl."
+"class</emphasis>)\n"
+" private Map<Luggage, Size> sizePerLuggage = new
HashMap<"
+"Luggage, Size>();"
+msgstr ""
+"@CollectionOfElements(targetElement = SizeImpl.class)\n"
+" @MapKeyManyToMany(<emphasis role=\"bold\">targetEntity =
LuggageImpl."
+"class</emphasis>)\n"
+" private Map<Luggage, Size> sizePerLuggage = new
HashMap<"
+"Luggage, Size>();"
+
+#. Tag: title
+#: entity.xml:2182
+#, no-c-format
+msgid "Bidirectional association with indexed collections"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2184
+#, no-c-format
+msgid ""
+"A bidirectional association where one end is an indexed collection (ie. "
+"represented as a <literal>@IndexColumn</literal>,
<literal>(a)org.hibernate."
+"annotations.MapKey</literal> or
<classname>(a)org.hibernate.annotations."
+"MapKeyManyToMany</classname>) requires special consideration. If a property
"
+"on the associated class explicitly maps the indexed value, the use of "
+"<methodname>mappedBy</methodname> is permitted:"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2192
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Parent {\n"
+" @OneToMany(mappedBy=\"parent\")\n"
+" @org.hibernate.annotations.IndexColumn(name=\"order\")\n"
+" private List<Child> children;\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Child {\n"
+" ...\n"
+" //the index column is mapped as a property in the associated entity\n"
+" @Column(name=\"order\")\n"
+" private int order;\n"
+"\n"
+" @ManyToOne\n"
+" @JoinColumn(name=\"parent_id\", nullable=false)\n"
+" private Parent parent;\n"
+" ...\n"
+"}"
+msgstr ""
+"@Entity\n"
+"public class Parent {\n"
+" @OneToMany(mappedBy=\"parent\")\n"
+" @org.hibernate.annotations.IndexColumn(name=\"order\")\n"
+" private List<Child> children;\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Child {\n"
+" ...\n"
+" //the index column is mapped as a property in the associated entity\n"
+" @Column(name=\"order\")\n"
+" private int order;\n"
+"\n"
+" @ManyToOne\n"
+" @JoinColumn(name=\"parent_id\", nullable=false)\n"
+" private Parent parent;\n"
+" ...\n"
+"}"
+
+#. Tag: para
+#: entity.xml:2194
+#, no-c-format
+msgid ""
+"But, if there is no such property on the child class, we can't think of the
"
+"association as truly bidirectional (there is information available at one "
+"end of the association that is not available at the other end: the index). "
+"In this case, we can't map the collection as
<literal>mappedBy</literal>. "
+"Instead, we could use the following mapping:"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2201
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Parent {\n"
+" @OneToMany\n"
+" @org.hibernate.annotations.IndexColumn(name=\"order\")\n"
+" @JoinColumn(name=\"parent_id\", nullable=false)\n"
+" private List<Child> children;\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Child {\n"
+" ...\n"
+" @ManyToOne\n"
+" @JoinColumn(name=\"parent_id\", insertable=false, updatable=false,
"
+"nullable=false)\n"
+" private Parent parent;\n"
+" ...\n"
+"}"
+msgstr ""
+"@Entity\n"
+"public class Parent {\n"
+" @OneToMany\n"
+" @org.hibernate.annotations.IndexColumn(name=\"order\")\n"
+" @JoinColumn(name=\"parent_id\", nullable=false)\n"
+" private List<Child> children;\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Child {\n"
+" ...\n"
+" @ManyToOne\n"
+" @JoinColumn(name=\"parent_id\", insertable=false, updatable=false,
"
+"nullable=false)\n"
+" private Parent parent;\n"
+" ...\n"
+"}"
+
+#. Tag: para
+#: entity.xml:2203
+#, no-c-format
+msgid ""
+"Note that in this mapping, the collection-valued end of the association is "
+"responsible for updating the foreign key."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:2208
+#, no-c-format
+msgid "Bag with primary key"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2210
+#, no-c-format
+msgid ""
+"Another interesting feature is the ability to define a surrogate primary key
"
+"to a bag collection. This remove pretty much all of the drawbacks of bags: "
+"update and removal are efficient, more than one
<literal>EAGER</literal> bag "
+"per query or per entity. This primary key will be contained in a additional "
+"column of your collection table but will not be visible to the Java "
+"application. @CollectionId is used to mark a collection as id bag, it also "
+"allow to override the primary key column(s), the primary key type and the "
+"generator strategy. The strategy can be <literal>identity</literal>, or
any "
+"defined generator name of your application."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2221
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@TableGenerator(name=\"ids_generator\", table=\"IDS\")\n"
+"public class Passport {\n"
+" ...\n"
+"\n"
+" @ManyToMany(cascade = CascadeType.ALL)\n"
+" @JoinTable(name=\"PASSPORT_VISASTAMP\")\n"
+" <emphasis role=\"bold\">@CollectionId(\n"
+" columns = @Column(name=\"COLLECTION_ID\"), \n"
+" type=@Type(type=\"long\"), \n"
+" generator = \"ids_generator\"\n"
+" )</emphasis>\n"
+" private Collection<Stamp> visaStamp = new ArrayList();\n"
+" ...\n"
+"}"
+msgstr ""
+"@Entity\n"
+"@TableGenerator(name=\"ids_generator\", table=\"IDS\")\n"
+"public class Passport {\n"
+" ...\n"
+"\n"
+" @ManyToMany(cascade = CascadeType.ALL)\n"
+" @JoinTable(name=\"PASSPORT_VISASTAMP\")\n"
+" <emphasis role=\"bold\">@CollectionId(\n"
+" columns = @Column(name=\"COLLECTION_ID\"), \n"
+" type=@Type(type=\"long\"), \n"
+" generator = \"ids_generator\"\n"
+" )</emphasis>\n"
+" private Collection<Stamp> visaStamp = new ArrayList();\n"
+" ...\n"
+"}"
+
+#. Tag: title
+#: entity.xml:2225
+#, no-c-format
+msgid "Collection of element or composite elements"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2227
+#, no-c-format
+msgid ""
+"Hibernate Annotations also supports collections of core types (Integer, "
+"String, Enums, ...), collections of embeddable objects and even arrays of "
+"primitive types. This is known as collection of elements."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2232
+#, no-c-format
+msgid ""
+"A collection of elements has to be annotated as "
+"<literal>@CollectionOfElements</literal> (as a replacement of "
+"<literal>@OneToMany</literal>) To define the collection table, the
"
+"<literal>@JoinTable</literal> annotation is used on the association
"
+"property, <literal>joinColumns</literal> defines the join columns
between "
+"the entity primary table and the collection table (inverseJoincolumn is "
+"useless and should be left empty). For collection of core types or array of "
+"primitive types, you can override the element column definition using a "
+"<literal>@Column</literal> on the association property. You can also
"
+"override the columns of a collection of embeddable object using "
+"<literal>@AttributeOverride</literal>. To reach the collection element,
you "
+"need to append \"element\" to the attribute override name (eg
\"element\" "
+"for core types, or \"element.serial\" for the serial property of an
"
+"embeddable element). To reach the index/key of a collection, append
\"key\" "
+"instead."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2249
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Boy {\n"
+" private Integer id;\n"
+" private Set<String> nickNames = new
HashSet<String>();\n"
+" private int[] favoriteNumbers;\n"
+" private Set<Toy> favoriteToys = new
HashSet<Toy>();\n"
+" private Set<Character> characters = new
HashSet<Character>"
+"();\n"
+"\n"
+" @Id @GeneratedValue\n"
+" public Integer getId() {\n"
+" return id;\n"
+" }\n"
+"\n"
+" <emphasis role=\"bold\">@CollectionOfElements\n"
+" public Set<String></emphasis> getNickNames() {\n"
+" return nickNames;\n"
+" }\n"
+"\n"
+" <emphasis role=\"bold\">@CollectionOfElements\n"
+" @JoinTable(\n"
+" table=@Table(name=\"BoyFavoriteNumbers\"),\n"
+" joinColumns = @JoinColumn(name=\"BoyId\")\n"
+" )\n"
+" @Column(name=\"favoriteNumber\",
nullable=false)</emphasis>\n"
+" @IndexColumn(name=\"nbr_index\")\n"
+" public int[] getFavoriteNumbers() {\n"
+" return favoriteNumbers;\n"
+" }\n"
+"\n"
+" <emphasis role=\"bold\">@CollectionOfElements\n"
+" @AttributeOverride( name=\"element.serial\",
column=@Column(name="
+"\"serial_nbr\") )</emphasis>\n"
+" public Set<Toy> getFavoriteToys() {\n"
+" return favoriteToys;\n"
+" }\n"
+"\n"
+" <emphasis role=\"bold\">@CollectionOfElements\n"
+" public Set<Character></emphasis> getCharacters() {\n"
+" return characters;\n"
+" }\n"
+" ...\n"
+"}\n"
+"\n"
+"public enum Character {\n"
+" GENTLE,\n"
+" NORMAL,\n"
+" AGGRESSIVE,\n"
+" ATTENTIVE,\n"
+" VIOLENT,\n"
+" CRAFTY\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"public class Toy {\n"
+" public String name;\n"
+" public String serial;\n"
+" public Boy owner;\n"
+"\n"
+" public String getName() {\n"
+" return name;\n"
+" }\n"
+"\n"
+" public void setName(String name) {\n"
+" this.name = name;\n"
+" }\n"
+"\n"
+" public String getSerial() {\n"
+" return serial;\n"
+" }\n"
+"\n"
+" public void setSerial(String serial) {\n"
+" this.serial = serial;\n"
+" }\n"
+"\n"
+" <emphasis role=\"bold\">@Parent</emphasis>\n"
+" public Boy getOwner() {\n"
+" return owner;\n"
+" }\n"
+"\n"
+" public void setOwner(Boy owner) {\n"
+" this.owner = owner;\n"
+" }\n"
+"\n"
+" public boolean equals(Object o) {\n"
+" if ( this == o ) return true;\n"
+" if ( o == null || getClass() != o.getClass() ) return false;\n"
+"\n"
+" final Toy toy = (Toy) o;\n"
+"\n"
+" if ( !name.equals( toy.name ) ) return false;\n"
+" if ( !serial.equals( toy.serial ) ) return false;\n"
+"\n"
+" return true;\n"
+" }\n"
+"\n"
+" public int hashCode() {\n"
+" int result;\n"
+" result = name.hashCode();\n"
+" result = 29 * result + serial.hashCode();\n"
+" return result;\n"
+" }\n"
+"}"
+msgstr ""
+"@Entity\n"
+"public class Boy {\n"
+" private Integer id;\n"
+" private Set<String> nickNames = new
HashSet<String>();\n"
+" private int[] favoriteNumbers;\n"
+" private Set<Toy> favoriteToys = new
HashSet<Toy>();\n"
+" private Set<Character> characters = new
HashSet<Character>"
+"();\n"
+"\n"
+" @Id @GeneratedValue\n"
+" public Integer getId() {\n"
+" return id;\n"
+" }\n"
+"\n"
+" <emphasis role=\"bold\">@CollectionOfElements\n"
+" public Set<String></emphasis> getNickNames() {\n"
+" return nickNames;\n"
+" }\n"
+"\n"
+" <emphasis role=\"bold\">@CollectionOfElements\n"
+" @JoinTable(\n"
+" table=@Table(name=\"BoyFavoriteNumbers\"),\n"
+" joinColumns = @JoinColumn(name=\"BoyId\")\n"
+" )\n"
+" @Column(name=\"favoriteNumber\",
nullable=false)</emphasis>\n"
+" @IndexColumn(name=\"nbr_index\")\n"
+" public int[] getFavoriteNumbers() {\n"
+" return favoriteNumbers;\n"
+" }\n"
+"\n"
+" <emphasis role=\"bold\">@CollectionOfElements\n"
+" @AttributeOverride( name=\"element.serial\",
column=@Column(name="
+"\"serial_nbr\") )</emphasis>\n"
+" public Set<Toy> getFavoriteToys() {\n"
+" return favoriteToys;\n"
+" }\n"
+"\n"
+" <emphasis role=\"bold\">@CollectionOfElements\n"
+" public Set<Character></emphasis> getCharacters() {\n"
+" return characters;\n"
+" }\n"
+" ...\n"
+"}\n"
+"\n"
+"public enum Character {\n"
+" GENTLE,\n"
+" NORMAL,\n"
+" AGGRESSIVE,\n"
+" ATTENTIVE,\n"
+" VIOLENT,\n"
+" CRAFTY\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"public class Toy {\n"
+" public String name;\n"
+" public String serial;\n"
+" public Boy owner;\n"
+"\n"
+" public String getName() {\n"
+" return name;\n"
+" }\n"
+"\n"
+" public void setName(String name) {\n"
+" this.name = name;\n"
+" }\n"
+"\n"
+" public String getSerial() {\n"
+" return serial;\n"
+" }\n"
+"\n"
+" public void setSerial(String serial) {\n"
+" this.serial = serial;\n"
+" }\n"
+"\n"
+" <emphasis role=\"bold\">@Parent</emphasis>\n"
+" public Boy getOwner() {\n"
+" return owner;\n"
+" }\n"
+"\n"
+" public void setOwner(Boy owner) {\n"
+" this.owner = owner;\n"
+" }\n"
+"\n"
+" public boolean equals(Object o) {\n"
+" if ( this == o ) return true;\n"
+" if ( o == null || getClass() != o.getClass() ) return false;\n"
+"\n"
+" final Toy toy = (Toy) o;\n"
+"\n"
+" if ( !name.equals( toy.name ) ) return false;\n"
+" if ( !serial.equals( toy.serial ) ) return false;\n"
+"\n"
+" return true;\n"
+" }\n"
+"\n"
+" public int hashCode() {\n"
+" int result;\n"
+" result = name.hashCode();\n"
+" result = 29 * result + serial.hashCode();\n"
+" return result;\n"
+" }\n"
+"}"
+
+#. Tag: para
+#: entity.xml:2251
+#, no-c-format
+msgid ""
+"On a collection of embeddable objects, the embeddable object can have a "
+"property annotated with <literal>@Parent</literal>. This property will
then "
+"point back to the entity containing the collection."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2257
+#, no-c-format
+msgid ""
+"Previous versions of Hibernate Annotations used the
<literal>@OneToMany</"
+"literal> to mark a collection of elements. Due to semantic inconsistencies,
"
+"we've introduced the annotation
<literal>@CollectionOfElements</literal>. "
+"Marking collections of elements the old way still work but is considered "
+"deprecated and is going to be unsupported in future releases"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:2267
+#, no-c-format
+msgid "@ManyToAny"
+msgstr "@ManyToAny"
+
+#. Tag: para
+#: entity.xml:2269
+#, no-c-format
+msgid ""
+"<classname>@ManyToAny</classname> allows polymorphic associations to
classes "
+"from multiple tables. This type of mapping always requires more than one "
+"column. The first column holds the type of the associated entity. The "
+"remaining columns hold the identifier. It is impossible to specify a foreign
"
+"key constraint for this kind of association, so this is most certainly not "
+"meant as the usual way of mapping (polymorphic) associations. You should use
"
+"this only in very special cases (eg. audit logs, user session data, etc)."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2279
+#, no-c-format
+msgid ""
+"@ManyToAny(\n"
+" metaColumn = @Column( name = \"property_type\" ) )\n"
+" @AnyMetaDef( \n"
+" idType = \"integer\", \n"
+" metaType = \"string\",\n"
+" metaValues = {\n"
+" @MetaValue( value = \"S\", targetEntity =
StringProperty."
+"class ),\n"
+" @MetaValue( value = \"I\", targetEntity =
IntegerProperty."
+"class ) } )\n"
+" @Cascade( { org.hibernate.annotations.CascadeType.ALL } )\n"
+" @JoinTable( name = \"obj_properties\", joinColumns = @JoinColumn(
name = "
+"\"obj_id\" ),\n"
+" inverseJoinColumns = @JoinColumn( name = \"property_id\" )
)\n"
+" public List<Property> getGeneralProperties() {"
+msgstr ""
+"@ManyToAny(\n"
+" metaColumn = @Column( name = \"property_type\" ) )\n"
+" @AnyMetaDef( \n"
+" idType = \"integer\", \n"
+" metaType = \"string\",\n"
+" metaValues = {\n"
+" @MetaValue( value = \"S\", targetEntity =
StringProperty."
+"class ),\n"
+" @MetaValue( value = \"I\", targetEntity =
IntegerProperty."
+"class ) } )\n"
+" @Cascade( { org.hibernate.annotations.CascadeType.ALL } )\n"
+" @JoinTable( name = \"obj_properties\", joinColumns = @JoinColumn(
name = "
+"\"obj_id\" ),\n"
+" inverseJoinColumns = @JoinColumn( name = \"property_id\" )
)\n"
+" public List<Property> getGeneralProperties() {"
+
+#. Tag: para
+#: entity.xml:2281
+#, no-c-format
+msgid ""
+"Like <classname>@Any</classname>,
<classname>@ManyToAny</classname> can use "
+"named <classname>@AnyDef</classname>s, see <xref
linkend=\"entity-hibspec-"
+"singleassoc-any\"/> for more info."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:2290
+#, no-c-format
+msgid "Cascade"
+msgstr "Cascada"
+
+#. Tag: para
+#: entity.xml:2292
+#, no-c-format
+msgid ""
+"Hibernate offers more operations than the Java Persistence specification. "
+"You can use the <literal>@Cascade</literal> annotation to cascade the
"
+"following operations:"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2298
+#, no-c-format
+msgid "PERSIST"
+msgstr "PERSIST"
+
+#. Tag: para
+#: entity.xml:2302
+#, no-c-format
+msgid "MERGE"
+msgstr "MERGE"
+
+#. Tag: para
+#: entity.xml:2306
+#, no-c-format
+msgid "REMOVE"
+msgstr "REMOVE"
+
+#. Tag: para
+#: entity.xml:2310
+#, no-c-format
+msgid "REFRESH"
+msgstr "REFRESH"
+
+#. Tag: para
+#: entity.xml:2314
+#, no-c-format
+msgid "DELETE"
+msgstr "DELETE"
+
+#. Tag: para
+#: entity.xml:2318
+#, no-c-format
+msgid "SAVE_UPDATE"
+msgstr "SAVE_UPDATE"
+
+#. Tag: para
+#: entity.xml:2322
+#, no-c-format
+msgid "REPLICATE"
+msgstr "REPLICATE"
+
+#. Tag: para
+#: entity.xml:2326
+#, no-c-format
+msgid "DELETE_ORPHAN"
+msgstr "DELETE_ORPHAN"
+
+#. Tag: para
+#: entity.xml:2330
+#, no-c-format
+msgid "LOCK"
+msgstr "LOCK"
+
+#. Tag: para
+#: entity.xml:2334
+#, no-c-format
+msgid "EVICT"
+msgstr "EVICT"
+
+#. Tag: para
+#: entity.xml:2338
+#, no-c-format
+msgid ""
+"This is especially useful for <literal>SAVE_UPDATE</literal> (which is
the "
+"operation cascaded at flush time if you use plain Hibernate Annotations - "
+"Hibernate EntityManager cascade <literal>PERSIST</literal> at flush
time as "
+"per the specification). DELETE_ORPHAN applies only to
<literal>@OneToMany</"
+"literal> associations, and indicates that the
<methodname>delete()/remove()</"
+"methodname> operation should be applied to any child object that is removed
"
+"from the association. In other words, if a child is dereferenced by a "
+"persistent parent and if <literal>DELETE_ORPHAN</literal> is used, the
"
+"\"orphaned\" child is deleted."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2350
+#, no-c-format
+msgid ""
+"@OneToMany( cascade = {CascadeType.PERSIST, CascadeType.MERGE}
<emphasis\n"
+" role=\"bold\">)\n"
+"(a)Cascade({org.hibernate.annotations.CascadeType.SAVE_UPDATE,\n"
+"
org.hibernate.annotations.CascadeType.DELETE_ORPHAN})</emphasis>\n"
+"public Collection<Employer> getEmployers()"
+msgstr ""
+"@OneToMany( cascade = {CascadeType.PERSIST, CascadeType.MERGE}
<emphasis\n"
+" role=\"bold\">)\n"
+"(a)Cascade({org.hibernate.annotations.CascadeType.SAVE_UPDATE,\n"
+"
org.hibernate.annotations.CascadeType.DELETE_ORPHAN})</emphasis>\n"
+"public Collection<Employer> getEmployers()"
+
+#. Tag: para
+#: entity.xml:2352
+#, no-c-format
+msgid ""
+"It is recommended to use @Cascade to compliment @*To*(cascade=...) as shown "
+"in the previous example."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:2357
+#, no-c-format
+msgid "Cache"
+msgstr "Cache"
+
+#. Tag: para
+#: entity.xml:2359
+#, no-c-format
+msgid ""
+"In order to optimize your database accesses, you can activate the so called "
+"second level cache of Hibernate. This cache is configurable on a per entity "
+"and per collection basis."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2363
+#, no-c-format
+msgid ""
+"<literal>(a)org.hibernate.annotations.Cache</literal> defines the caching
"
+"strategy and region of a given second level cache. This annotation can be "
+"applied on the root entity (not the sub entities), and on the collections."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2368
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)\n"
+"public class Forest { ... }"
+msgstr ""
+"@Entity\n"
+"@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)\n"
+"public class Forest { ... }"
+
+#. Tag: programlisting
+#: entity.xml:2370
+#, no-c-format
+msgid ""
+"(a)OneToMany(cascade=CascadeType.ALL, fetch=FetchType.EAGER)\n"
+" @JoinColumn(name=\"CUST_ID\")\n"
+" @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)\n"
+" public SortedSet<Ticket> getTickets() {\n"
+" return tickets;\n"
+" }"
+msgstr ""
+"(a)OneToMany(cascade=CascadeType.ALL, fetch=FetchType.EAGER)\n"
+" @JoinColumn(name=\"CUST_ID\")\n"
+" @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)\n"
+" public SortedSet<Ticket> getTickets() {\n"
+" return tickets;\n"
+" }"
+
+#. Tag: programlisting
+#: entity.xml:2383
+#, no-c-format
+msgid ""
+"@Cache(\n"
+" CacheConcurrencyStrategy usage();\n"
+" String region() default \"\";\n"
+" String include() default \"all\";\n"
+")"
+msgstr ""
+"@Cache(\n"
+" CacheConcurrencyStrategy usage();\n"
+" String region() default \"\";\n"
+" String include() default \"all\";\n"
+")"
+
+#. Tag: para
+#: entity.xml:2387
+#, no-c-format
+msgid ""
+"usage: the given cache concurrency strategy (NONE, READ_ONLY, "
+"NONSTRICT_READ_WRITE, READ_WRITE, TRANSACTIONAL)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2392
+#, no-c-format
+msgid ""
+"region (optional): the cache region (default to the fqcn of the class or the
"
+"fq role name of the collection)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2397
+#, no-c-format
+msgid ""
+"<literal>include</literal> (optional): all to include all properties,
non-"
+"lazy to only include non lazy properties (default all)."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:2406
+#, no-c-format
+msgid "Filters"
+msgstr "Filtros"
+
+#. Tag: para
+#: entity.xml:2408
+#, no-c-format
+msgid ""
+"Hibernate has the ability to apply arbitrary filters on top of your data. "
+"Those filters are applied at runtime on a given session. First, you need to "
+"define them."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2412
+#, no-c-format
+msgid ""
+"<literal>(a)org.hibernate.annotations.FilterDef</literal> or "
+"<literal>@FilterDefs</literal> define filter definition(s) used by
filter(s) "
+"using the same name. A filter definition has a name() and an array of "
+"parameters(). A parameter will allow you to adjust the behavior of the "
+"filter at runtime. Each parameter is defined by a
<literal>@ParamDef</"
+"literal> which has a name and a type. You can also define a
defaultCondition"
+"() parameter for a given <literal>@FilterDef</literal> to set the
default "
+"condition to use when none are defined in each individual
<literal>@Filter</"
+"literal>. A <literal>@FilterDef</literal>(s) can be defined at the
class or "
+"package level."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2424
+#, no-c-format
+msgid ""
+"We now need to define the SQL filter clause applied to either the entity "
+"load or the collection load. <literal>@Filter</literal> is used and
placed "
+"either on the entity or the collection element"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2428
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@FilterDef(name=\"minLength\", parameters=@ParamDef(
name=\"minLength\", "
+"type=\"integer\" ) )\n"
+"@Filters( {\n"
+" @Filter(name=\"betweenLength\", condition=\":minLength <=
length and :"
+"maxLength >= length\"),\n"
+" @Filter(name=\"minLength\", condition=\":minLength <=
length\")\n"
+"} )\n"
+"public class Forest { ... }"
+msgstr ""
+"@Entity\n"
+"@FilterDef(name=\"minLength\", parameters=@ParamDef(
name=\"minLength\", "
+"type=\"integer\" ) )\n"
+"@Filters( {\n"
+" @Filter(name=\"betweenLength\", condition=\":minLength <=
length and :"
+"maxLength >= length\"),\n"
+" @Filter(name=\"minLength\", condition=\":minLength <=
length\")\n"
+"} )\n"
+"public class Forest { ... }"
+
+#. Tag: para
+#: entity.xml:2430
+#, no-c-format
+msgid ""
+"When the collection use an association table as a relational representation,
"
+"you might want to apply the filter condition to the association table itself
"
+"or to the target entity table. To apply the constraint on the target entity,
"
+"use the regular <literal>@Filter</literal> annotation. However, if you
wan "
+"to target the association table, use the
<literal>@FilterJoinTable</literal> "
+"annotation."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2438
+#, no-c-format
+msgid ""
+"@OneToMany\n"
+" @JoinTable\n"
+" //filter on the target entity table\n"
+" @Filter(name=\"betweenLength\", condition=\":minLength <=
length and :"
+"maxLength >= length\")\n"
+" //filter on the association table\n"
+" @FilterJoinTable(name=\"security\", condition=\":userlevel
>= "
+"requredLevel\")\n"
+" public Set<Forest> getForests() { ... }"
+msgstr ""
+"@OneToMany\n"
+" @JoinTable\n"
+" //filter on the target entity table\n"
+" @Filter(name=\"betweenLength\", condition=\":minLength <=
length and :"
+"maxLength >= length\")\n"
+" //filter on the association table\n"
+" @FilterJoinTable(name=\"security\", condition=\":userlevel
>= "
+"requredLevel\")\n"
+" public Set<Forest> getForests() { ... }"
+
+#. Tag: title
+#: entity.xml:2442
+#, no-c-format
+msgid "Queries"
+msgstr "Peticiones"
+
+#. Tag: para
+#: entity.xml:2444
+#, no-c-format
+msgid ""
+"Since Hibernate has more features on named queries than the one defined in "
+"the EJB3 specification,
<literal>(a)org.hibernate.annotations.NamedQuery</"
+"literal>,
<literal>(a)org.hibernate.annotations.NamedQueries</literal>, "
+"<literal>(a)org.hibernate.annotations.NamedNativeQuery</literal> and
"
+"<literal>(a)org.hibernate.annotations.NamedNativeQueries</literal> have
been "
+"introduced. They add some attributes to the standard version and can be used
"
+"as a replacement:"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2455
+#, no-c-format
+msgid "flushMode: define the query flush mode (Always, Auto, Commit or
Manual)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2460
+#, no-c-format
+msgid "cacheable: whether the query should be cached or not"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2464
+#, no-c-format
+msgid "cacheRegion: cache region used if the query is cached"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2468
+#, no-c-format
+msgid "fetchSize: JDBC statement fetch size for this query"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2472
+#, no-c-format
+msgid "timeout: query time out"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2476
+#, no-c-format
+msgid "callable: for native queries only, to be set to true for stored
procedures"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2481
+#, no-c-format
+msgid ""
+"comment: if comments are activated, the comment seen when the query is sent "
+"to the database."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2486
+#, no-c-format
+msgid "cacheMode: Cache interaction mode (get, ignore, normal, put or
refresh)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2491
+#, no-c-format
+msgid ""
+"readOnly: whether or not the elements retrievent from the query are in read "
+"only mode."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2496
+#, no-c-format
+msgid ""
+"Those hints can be set in a standard
<literal>(a)javax.persistence.NamedQuery</"
+"literal> annotations through the detyped
<literal>@QueryHint</literal>. "
+"Another key advantage is the ability to set those annotations at a package "
+"level."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:2503
+#, no-c-format
+msgid "Custom SQL for CRUD operations"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2505
+#, no-c-format
+msgid ""
+"Hibernate gives you the ability to override every single SQL statement "
+"generated. We have seen native SQL query usage already, but you can also "
+"override the SQL statement used to load or change the state of entities."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2510
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Table(name=\"CHAOS\")\n"
+"<emphasis role=\"bold\">@SQLInsert( sql=\"INSERT INTO
CHAOS(size, name, "
+"nickname, id) VALUES(?,upper(?),?,?)\")\n"
+"@SQLUpdate( sql=\"UPDATE CHAOS SET size = ?, name = upper(?), nickname = ?
"
+"WHERE id = ?\")\n"
+"@SQLDelete( sql=\"DELETE CHAOS WHERE id = ?\")\n"
+"@SQLDeleteAll( sql=\"DELETE CHAOS\")\n"
+"</emphasis><emphasis role=\"bold\">@Loader(namedQuery =
\"chaos\")</"
+"emphasis>\n"
+"@NamedNativeQuery(name=\"chaos\", query=\"select id, size, name,
lower"
+"( nickname ) as nickname from CHAOS where id= ?\", resultClass = Chaos."
+"class)\n"
+"public class Chaos {\n"
+" @Id\n"
+" private Long id;\n"
+" private Long size;\n"
+" private String name;\n"
+" private String nickname;"
+msgstr ""
+"@Entity\n"
+"@Table(name=\"CHAOS\")\n"
+"<emphasis role=\"bold\">@SQLInsert( sql=\"INSERT INTO
CHAOS(size, name, "
+"nickname, id) VALUES(?,upper(?),?,?)\")\n"
+"@SQLUpdate( sql=\"UPDATE CHAOS SET size = ?, name = upper(?), nickname = ?
"
+"WHERE id = ?\")\n"
+"@SQLDelete( sql=\"DELETE CHAOS WHERE id = ?\")\n"
+"@SQLDeleteAll( sql=\"DELETE CHAOS\")\n"
+"</emphasis><emphasis role=\"bold\">@Loader(namedQuery =
\"chaos\")</"
+"emphasis>\n"
+"@NamedNativeQuery(name=\"chaos\", query=\"select id, size, name,
lower"
+"( nickname ) as nickname from CHAOS where id= ?\", resultClass = Chaos."
+"class)\n"
+"public class Chaos {\n"
+" @Id\n"
+" private Long id;\n"
+" private Long size;\n"
+" private String name;\n"
+" private String nickname;"
+
+#. Tag: para
+#: entity.xml:2512
+#, no-c-format
+msgid ""
+"<literal>@SQLInsert</literal>,
<literal>@SQLUpdate</literal>, "
+"<literal>@SQLDelete</literal>,
<literal>@SQLDeleteAll</literal> respectively "
+"override the INSERT statement, UPDATE statement, DELETE statement, DELETE "
+"statement to remove all entities."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2517
+#, no-c-format
+msgid ""
+"If you expect to call a store procedure, be sure to set the "
+"<literal>callable</literal> attribute to true
(<literal>@SQLInsert"
+"(callable=true, ...)</literal>)."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2521
+#, no-c-format
+msgid ""
+"To check that the execution happens correctly, Hibernate allows you to "
+"define one of those three strategies:"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2526
+#, no-c-format
+msgid ""
+"NONE: no check is performed: the store procedure is expected to fail upon "
+"issues"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2531
+#, no-c-format
+msgid "COUNT: use of rowcount to check that the update is successful"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2536
+#, no-c-format
+msgid ""
+"PARAM: like COUNT but using an output parameter rather that the standard "
+"mechanism"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2541
+#, no-c-format
+msgid ""
+"To define the result check style, use the <literal>check</literal>
parameter "
+"(<literal>(a)SQLUpdate(check=ResultCheckStyle.COUNT,
...)</literal>)."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2545
+#, no-c-format
+msgid ""
+"You can also override the SQL load statement by a native SQL query or a HQL "
+"query. You just have to refer to a named query with the "
+"<literal><literal>@Loader</literal></literal>
annotation."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2549
+#, no-c-format
+msgid ""
+"You can use the exact same set of annotations to override the collection "
+"related statements."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2552
+#, no-c-format
+msgid ""
+"@OneToMany\n"
+"@JoinColumn(name=\"chaos_fk\")\n"
+"<emphasis role=\"bold\">@SQLInsert( sql=\"UPDATE
CASIMIR_PARTICULE SET "
+"chaos_fk = ? where id = ?\")\n"
+"@SQLDelete( sql=\"UPDATE CASIMIR_PARTICULE SET chaos_fk = null where id =
?"
+"\")</emphasis>\n"
+"private Set<CasimirParticle> particles = new HashSet<"
+"CasimirParticle>();"
+msgstr ""
+"@OneToMany\n"
+"@JoinColumn(name=\"chaos_fk\")\n"
+"<emphasis role=\"bold\">@SQLInsert( sql=\"UPDATE
CASIMIR_PARTICULE SET "
+"chaos_fk = ? where id = ?\")\n"
+"@SQLDelete( sql=\"UPDATE CASIMIR_PARTICULE SET chaos_fk = null where id =
?"
+"\")</emphasis>\n"
+"private Set<CasimirParticle> particles = new HashSet<"
+"CasimirParticle>();"
+
+#. Tag: para
+#: entity.xml:2554
+#, no-c-format
+msgid ""
+"The parameters order is important and is defined by the order Hibernate "
+"handle properties. You can see the expected order by enabling debug logging "
+"for the <literal>org.hibernate.persister.entity</literal> level. With
this "
+"level enabled Hibernate will print out the static SQL that is used to "
+"create, update, delete etc. entities. (To see the expected sequence, "
+"remember to not include your custom SQL through annotations as that will "
+"override the Hibernate generated static sql.)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2563
+#, no-c-format
+msgid ""
+"Overriding SQL statements for secondary tables is also possible using "
+"<literal>(a)org.hibernate.annotations.Table</literal> and either (or all)
"
+"attributes <literal>sqlInsert</literal>,
<literal>sqlUpdate</literal>, "
+"<literal>sqlDelete</literal>:"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2568
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@SecondaryTables({\n"
+" @SecondaryTable(name = \"`Cat nbr1`\"),\n"
+" @SecondaryTable(name = \"Cat2\"})\n"
+"(a)org.hibernate.annotations.Tables( {\n"
+" @Table(appliesTo = \"Cat\", comment = \"My cat table\"
),\n"
+" @Table(appliesTo = \"Cat2\", foreignKey =
@ForeignKey(name=\"FK_CAT2_CAT"
+"\"), fetch = FetchMode.SELECT,\n"
+" <emphasis
role=\"bold\">sqlInsert=@SQLInsert(sql=\"insert into Cat2"
+"(storyPart2, id) values(upper(?), ?)\") )</emphasis>\n"
+"} )\n"
+"public class Cat implements Serializable {"
+msgstr ""
+"@Entity\n"
+"@SecondaryTables({\n"
+" @SecondaryTable(name = \"`Cat nbr1`\"),\n"
+" @SecondaryTable(name = \"Cat2\"})\n"
+"(a)org.hibernate.annotations.Tables( {\n"
+" @Table(appliesTo = \"Cat\", comment = \"My cat table\"
),\n"
+" @Table(appliesTo = \"Cat2\", foreignKey =
@ForeignKey(name=\"FK_CAT2_CAT"
+"\"), fetch = FetchMode.SELECT,\n"
+" <emphasis
role=\"bold\">sqlInsert=@SQLInsert(sql=\"insert into Cat2"
+"(storyPart2, id) values(upper(?), ?)\") )</emphasis>\n"
+"} )\n"
+"public class Cat implements Serializable {"
+
+#. Tag: para
+#: entity.xml:2570
+#, no-c-format
+msgid ""
+"The previous example also show that you can give a comment to a given table "
+"(promary or secondary): This comment will be used for DDL generation."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:2576
+#, no-c-format
+msgid "Tuplizer"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2578
+#, no-c-format
+msgid ""
+"<classname>org.hibernate.tuple.Tuplizer</classname>, and its
sub-interfaces, "
+"are responsible for managing a particular representation of a piece of data,
"
+"given that representation's
<literal>org.hibernate.EntityMode</literal>. If "
+"a given piece of data is thought of as a data structure, then a tuplizer is "
+"the thing which knows how to create such a data structure and how to extract
"
+"values from and inject values into such a data structure. For example, for "
+"the POJO entity mode, the correpsonding tuplizer knows how create the POJO "
+"through its constructor and how to access the POJO properties using the "
+"defined property accessors. There are two high-level types of Tuplizers, "
+"represented by the
<classname>org.hibernate.tuple.EntityTuplizer</classname> "
+"and <classname>org.hibernate.tuple.ComponentTuplizer</classname>
interfaces. "
+"EntityTuplizers are responsible for managing the above mentioned contracts "
+"in regards to entities, while <classname>ComponentTuplizers</classname>
do "
+"the same for components. Check the Hibernate reference documentation for "
+"more information."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2596
+#, no-c-format
+msgid ""
+"To define tuplixer in annotations, simply use the
<literal>@Tuplizer</"
+"literal> annotation on the according element"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2599
+#, no-c-format
+msgid ""
+"@Entity\n"
+"<emphasis role=\"bold\">@Tuplizer(impl =
DynamicEntityTuplizer.class)</"
+"emphasis>\n"
+"public interface Cuisine {\n"
+" @Id\n"
+" @GeneratedValue\n"
+" public Long getId();\n"
+" public void setId(Long id);\n"
+"\n"
+" public String getName();\n"
+" public void setName(String name);\n"
+"\n"
+" <emphasis role=\"bold\">@Tuplizer(impl =
DynamicComponentTuplizer.class)"
+"</emphasis>\n"
+" public Country getCountry();\n"
+" public void setCountry(Country country);\n"
+"\n"
+"\n"
+"}"
+msgstr ""
+"@Entity\n"
+"<emphasis role=\"bold\">@Tuplizer(impl =
DynamicEntityTuplizer.class)</"
+"emphasis>\n"
+"public interface Cuisine {\n"
+" @Id\n"
+" @GeneratedValue\n"
+" public Long getId();\n"
+" public void setId(Long id);\n"
+"\n"
+" public String getName();\n"
+" public void setName(String name);\n"
+"\n"
+" <emphasis role=\"bold\">@Tuplizer(impl =
DynamicComponentTuplizer.class)"
+"</emphasis>\n"
+" public Country getCountry();\n"
+" public void setCountry(Country country);\n"
+"\n"
+"\n"
+"}"
+
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/es-ES/setup.po
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/es-ES/setup.po
(rev 0)
+++ annotations/branches/v3_4_0_GA_CP/src/main/docbook/es-ES/setup.po 2009-12-22 06:50:19
UTC (rev 18313)
@@ -0,0 +1,391 @@
+# translation of setup.po to
+# Header entry was created by KBabel!
+#
+#. Tag: title
+#: setup.xml:28
+#, no-c-format
+# Angela Garcia <agarcia(a)redhat.com>, 2009.
+msgid ""
+msgstr ""
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Last-Translator: Angela Garcia <agarcia(a)redhat.com>\n"
+"PO-Revision-Date: 2009-11-19 15:26+1000\n"
+"Project-Id-Version: setup\n"
+"Language-Team: <en(a)li.org>\n"
+"X-Generator: KBabel 1.11.4\n"
+"MIME-Version: 1.0\n"
+
+#. Tag: title
+#: setup.xml:28
+#, no-c-format
+msgid "Setting up an annotations project"
+msgstr ""
+
+#. Tag: title
+#: setup.xml:31
+#, no-c-format
+msgid "Requirements"
+msgstr "Requerimientos"
+
+#. Tag: para
+#: setup.xml:35
+#, no-c-format
+msgid ""
+"<ulink
url=\"http://www.hibernate.org/6.html\">Download</ulink> and unpack
"
+"the Hibernate Annotations distribution from the Hibernate website."
+msgstr ""
+
+#. Tag: emphasis
+#: setup.xml:41
+#, no-c-format
+msgid "This release requires Hibernate Core 3.3 and above."
+msgstr ""
+
+#. Tag: para
+#: setup.xml:46
+#, no-c-format
+msgid "This release is known to work on Hibernate Core 3.3.0.SP1"
+msgstr ""
+
+#. Tag: para
+#: setup.xml:50
+#, no-c-format
+msgid ""
+"Make sure you have JDK 5.0 installed or above. You can of course continue "
+"using XDoclet and get some of the benefits of annotation-based metadata with
"
+"older JDK versions. Note that this document only describes JDK 5.0 "
+"annotations and you have to refer to the XDoclet documentation for more "
+"information."
+msgstr ""
+
+#. Tag: title
+#: setup.xml:60
+#, no-c-format
+msgid "Configuration"
+msgstr "Configuración"
+
+#. Tag: para
+#: setup.xml:62
+#, no-c-format
+msgid ""
+"First, set up your classpath (after you have created a new project in your "
+"favorite IDE):"
+msgstr ""
+
+#. Tag: para
+#: setup.xml:65
+#, no-c-format
+msgid ""
+"Copy all Hibernate3 core and required 3rd party library files (see lib/"
+"README.txt in Hibernate)."
+msgstr ""
+
+#. Tag: para
+#: setup.xml:70
+#, no-c-format
+msgid ""
+"Copy <filename>hibernate-annotations.jar</filename>,
<filename>lib/hibernate-"
+"comons-annotations.jar</filename> and
<filename>lib/ejb3-persistence.jar</"
+"filename> from the Hibernate Annotations distribution to your classpath as
"
+"well."
+msgstr ""
+
+#. Tag: para
+#: setup.xml:77
+#, no-c-format
+msgid ""
+"If you wish to use <ulink
url=\"http://validator.hibernate.org\">Hibernate "
+"Validator</ulink>, download it from the Hibernate website and add "
+"<filename>hibernate-validator.jar</filename> in your classpath."
+msgstr ""
+
+#. Tag: para
+#: setup.xml:82
+#, no-c-format
+msgid ""
+"If you wish to use <ulink
url=\"http://search.hibernate.org\">Hibernate "
+"Search</ulink>, download it from the Hibernate website and add "
+"<filename>hibernate-search.jar</filename> and
<filename>lucene-core-x.y.z."
+"jar</filename> in your classpath."
+msgstr ""
+
+#. Tag: para
+#: setup.xml:88
+#, no-c-format
+msgid ""
+"We also recommend a small wrapper class to startup Hibernate in a static "
+"initializer block, known as <classname>HibernateUtil</classname>. You
might "
+"have seen this class in various forms in other areas of the Hibernate "
+"documentation. For Annotation support you have to enhance this helper class "
+"as follows:"
+msgstr ""
+
+#. Tag: programlisting
+#: setup.xml:92
+#, no-c-format
+msgid ""
+"package hello;\n"
+"\n"
+"import org.hibernate.*;\n"
+"import org.hibernate.cfg.*;\n"
+"import test.*;\n"
+"import test.animals.Dog;\n"
+"\n"
+"public class HibernateUtil {\n"
+"\n"
+"private static final SessionFactory sessionFactory;\n"
+"\n"
+" static {\n"
+" try {\n"
+"\n"
+" sessionFactory = new <emphasis role=\"bold"
+"\">AnnotationConfiguration()</emphasis>\n"
+" configure().buildSessionFactory();\n"
+" } catch (Throwable ex) {\n"
+" // Log exception!\n"
+" throw new ExceptionInInitializerError(ex);\n"
+" }\n"
+" }\n"
+"\n"
+" public static Session getSession()\n"
+" throws HibernateException {\n"
+" return sessionFactory.openSession();\n"
+" }\n"
+"}"
+msgstr ""
+"package hello;\n"
+"\n"
+"import org.hibernate.*;\n"
+"import org.hibernate.cfg.*;\n"
+"import test.*;\n"
+"import test.animals.Dog;\n"
+"\n"
+"public class HibernateUtil {\n"
+"\n"
+"private static final SessionFactory sessionFactory;\n"
+"\n"
+" static {\n"
+" try {\n"
+"\n"
+" sessionFactory = new <emphasis role=\"bold"
+"\">AnnotationConfiguration()</emphasis>\n"
+" configure().buildSessionFactory();\n"
+" } catch (Throwable ex) {\n"
+" // Log exception!\n"
+" throw new ExceptionInInitializerError(ex);\n"
+" }\n"
+" }\n"
+"\n"
+" public static Session getSession()\n"
+" throws HibernateException {\n"
+" return sessionFactory.openSession();\n"
+" }\n"
+"}"
+
+#. Tag: para
+#: setup.xml:94
+#, no-c-format
+msgid ""
+"Interesting here is the use of <classname>AnnotationConfiguration</"
+"classname>. The packages and annotated classes are declared in your regular
"
+"XML configuration file (usually
<filename>hibernate.cfg.xml</filename>). "
+"Here is the equivalent of the above declaration:"
+msgstr ""
+
+#. Tag: programlisting
+#: setup.xml:100
+#, no-c-format
+msgid ""
+"<!DOCTYPE hibernate-configuration PUBLIC\n"
+" \"-//Hibernate/Hibernate Configuration DTD 3.0//EN\"\n"
+" \"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"
+"\">\n"
+"\n"
+" <hibernate-configuration>\n"
+" <session-factory>\n"
+" <emphasis role=\"bold\"><mapping
package=\"test.animals\"/"
+">\n"
+" <mapping class=\"test.Flight\"/>\n"
+" <mapping class=\"test.Sky\"/>\n"
+" <mapping class=\"test.Person\"/>\n"
+" <mapping
class=\"test.animals.Dog\"/></emphasis>\n"
+"<emphasis role=\"bold\"> <mapping
resource=\"test/animals/orm."
+"xml\"/></emphasis>\n"
+" </session-factory>\n"
+" </hibernate-configuration>"
+msgstr ""
+"<!DOCTYPE hibernate-configuration PUBLIC\n"
+" \"-//Hibernate/Hibernate Configuration DTD 3.0//EN\"\n"
+" \"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"
+"\">\n"
+"\n"
+" <hibernate-configuration>\n"
+" <session-factory>\n"
+" <emphasis role=\"bold\"><mapping
package=\"test.animals\"/"
+">\n"
+" <mapping class=\"test.Flight\"/>\n"
+" <mapping class=\"test.Sky\"/>\n"
+" <mapping class=\"test.Person\"/>\n"
+" <mapping
class=\"test.animals.Dog\"/></emphasis>\n"
+"<emphasis role=\"bold\"> <mapping
resource=\"test/animals/orm."
+"xml\"/></emphasis>\n"
+" </session-factory>\n"
+" </hibernate-configuration>"
+
+#. Tag: para
+#: setup.xml:102
+#, no-c-format
+msgid ""
+"Note that you can mix the hbm.xml use and the new annotation one. The "
+"resource element can be either an hbm file or an EJB3 XML deployment "
+"descriptor. The distinction is transparent for your configuration process."
+msgstr ""
+
+#. Tag: para
+#: setup.xml:107
+#, no-c-format
+msgid ""
+"Alternatively, you can define the annotated classes and packages using the "
+"programmatic API"
+msgstr ""
+
+#. Tag: programlisting
+#: setup.xml:110
+#, no-c-format
+msgid ""
+"sessionFactory = new <emphasis
role=\"bold\">AnnotationConfiguration()\n"
+" .addPackage(\"test.animals\") //the fully qualified package
name\n"
+" .addAnnotatedClass(Flight.class)\n"
+" .addAnnotatedClass(Sky.class)\n"
+" .addAnnotatedClass(Person.class)\n"
+" .addAnnotatedClass(Dog.class)</emphasis>\n"
+"<emphasis
role=\"bold\">.addResource(\"test/animals/orm.xml\")</emphasis>\n"
+" configure()..buildSessionFactory();"
+msgstr ""
+"sessionFactory = new <emphasis
role=\"bold\">AnnotationConfiguration()\n"
+" .addPackage(\"test.animals\") //the fully qualified package
name\n"
+" .addAnnotatedClass(Flight.class)\n"
+" .addAnnotatedClass(Sky.class)\n"
+" .addAnnotatedClass(Person.class)\n"
+" .addAnnotatedClass(Dog.class)</emphasis>\n"
+"<emphasis
role=\"bold\">.addResource(\"test/animals/orm.xml\")</emphasis>\n"
+" configure()..buildSessionFactory();"
+
+#. Tag: para
+#: setup.xml:112
+#, no-c-format
+msgid ""
+"You can also use the Hibernate EntityManager which has its own configuration
"
+"mechanism. Please refer to this project documentation for more details."
+msgstr ""
+
+#. Tag: para
+#: setup.xml:116
+#, no-c-format
+msgid ""
+"There is no other difference in the way you use Hibernate APIs with "
+"annotations, except for this startup routine change or in the configuration "
+"file. You can use your favorite configuration method for other properties "
+"( <filename>hibernate.properties</filename>,
<filename>hibernate.cfg.xml</"
+"filename>, programmatic APIs, etc). You can even mix annotated persistent
"
+"classes and classic <filename>hbm.cfg.xml</filename> declarations with
the "
+"same <classname>SessionFactory</classname>. You can however not declare
a "
+"class several times (whether annotated or through hbm.xml). You cannot mix "
+"configuration strategies (hbm vs annotations) in a mapped entity hierarchy "
+"either."
+msgstr ""
+
+#. Tag: para
+#: setup.xml:128
+#, no-c-format
+msgid ""
+"To ease the migration process from hbm files to annotations, the "
+"configuration mechanism detects the mapping duplication between annotations "
+"and hbm files. HBM files are then prioritized over annotated metadata on a "
+"class to class basis. You can change the priority using
<literal>hibernate."
+"mapping.precedence</literal> property. The default is <literal>hbm,
class</"
+"literal>, changing it to <literal>class, hbm</literal> will
prioritize the "
+"annotated classes over hbm files when a conflict occurs."
+msgstr ""
+
+#. Tag: title
+#: setup.xml:139
+#, no-c-format
+msgid "Properties"
+msgstr "Propiedades"
+
+#. Tag: para
+#: setup.xml:141
+#, no-c-format
+msgid ""
+"Asides from the Hibernate core properties, Hibernate Annotations reacts to "
+"the following one"
+msgstr ""
+
+#. Tag: title
+#: setup.xml:146
+#, no-c-format
+msgid "Logging"
+msgstr "Registros"
+
+#. Tag: para
+#: setup.xml:148
+#, no-c-format
+msgid ""
+"Hibernate Annotations utilizes <ulink
url=\"http://www.slf4j.org/\">Simple "
+"Logging Facade for Java</ulink> (SLF4J) in order to log various system
"
+"events. SLF4J can direct your logging output to several logging frameworks "
+"(NOP, Simple, log4j version 1.2, JDK 1.4 logging, JCL or logback) depending "
+"on your chosen binding. In order to setup logging properly you will need "
+"<filename>slf4j-api.jar</filename> in your classpath together with the
jar "
+"file for your preferred binding -
<filename>slf4j-log4j12.jar</filename> in "
+"the case of Log4J. See the SLF4J <ulink type=\"\"
url=\"http://www.slf4j.org/"
+"manual.html\">documentation</ulink> for more detail."
+msgstr ""
+
+#. Tag: para
+#: setup.xml:160
+#, no-c-format
+msgid "The logging categories interesting for Hibernate Annotations are:"
+msgstr ""
+
+#. Tag: title
+#: setup.xml:164
+#, no-c-format
+msgid "Hibernate Annotations Log Categories"
+msgstr ""
+
+#. Tag: entry
+#: setup.xml:169
+#, no-c-format
+msgid "Category"
+msgstr "CategorÃa"
+
+#. Tag: entry
+#: setup.xml:171
+#, no-c-format
+msgid "Function"
+msgstr "Función"
+
+#. Tag: emphasis
+#: setup.xml:177
+#, no-c-format
+msgid "org.hibernate.cfg"
+msgstr "org.hibernate.cfg"
+
+#. Tag: entry
+#: setup.xml:179
+#, no-c-format
+msgid "Log all configuration related events (not only annotations)."
+msgstr ""
+
+#. Tag: para
+#: setup.xml:186
+#, no-c-format
+msgid ""
+"For further category configuration refer to the <ulink
url=\"http://www."
+"hibernate.org/hib_docs/v3/reference/en/html_single/#configuration-logging"
+"\">Logging</ulink> in the Hibernate Core documentation."
+msgstr ""
+
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/es-ES/xml-overriding.po
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/es-ES/xml-overriding.po
(rev 0)
+++ annotations/branches/v3_4_0_GA_CP/src/main/docbook/es-ES/xml-overriding.po 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,657 @@
+# translation of xml-overriding.po to
+# Header entry was created by KBabel!
+#
+#. Tag: title
+#: xml-overriding.xml:28
+#, no-c-format
+# Angela Garcia <agarcia(a)redhat.com>, 2009.
+msgid ""
+msgstr ""
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Last-Translator: Angela Garcia <agarcia(a)redhat.com>\n"
+"PO-Revision-Date: 2009-11-19 15:26+1000\n"
+"Project-Id-Version: xml-overriding\n"
+"Language-Team: <en(a)li.org>\n"
+"X-Generator: KBabel 1.11.4\n"
+"MIME-Version: 1.0\n"
+
+#. Tag: title
+#: xml-overriding.xml:28
+#, no-c-format
+msgid "Overriding metadata through XML"
+msgstr ""
+
+#. Tag: para
+#: xml-overriding.xml:30
+#, no-c-format
+msgid ""
+"The primary target for metadata in EJB3 is annotations, but the EJB3 "
+"specification provides a way to override or replace the annotation defined "
+"metadata through an XML deployment descriptor. In the current release only "
+"pure EJB3 annotations overriding are supported. If you wish to use Hibernate
"
+"specific features in some entities, you'll have to either use annotations or
"
+"fallback to hbm files. You can of course mix and match annotated entities "
+"and entities describes in hbm files."
+msgstr ""
+
+#. Tag: para
+#: xml-overriding.xml:38
+#, no-c-format
+msgid "The unit test suite shows some additional XML file samples."
+msgstr ""
+
+#. Tag: title
+#: xml-overriding.xml:41
+#, no-c-format
+msgid "Principles"
+msgstr ""
+
+#. Tag: para
+#: xml-overriding.xml:43
+#, no-c-format
+msgid ""
+"The XML deployment descriptor structure has been designed to reflect the "
+"annotations one. So if you know the annotations structure, using the XML "
+"schema will be straightforward for you."
+msgstr ""
+
+#. Tag: para
+#: xml-overriding.xml:47
+#, no-c-format
+msgid ""
+"You can define one ot more XML files describing your metadata, these files "
+"will be merged by the overriding engine."
+msgstr ""
+
+#. Tag: title
+#: xml-overriding.xml:51
+#, no-c-format
+msgid "Global level metadata"
+msgstr ""
+
+#. Tag: para
+#: xml-overriding.xml:53
+#, no-c-format
+msgid ""
+"You can define global level metadata available for all XML files. You must "
+"not define these metadata more than once per deployment."
+msgstr ""
+
+#. Tag: programlisting
+#: xml-overriding.xml:56
+#, no-c-format
+msgid ""
+"<?xml version=\"1.0\"
encoding=\"UTF-8\"?>\n"
+"\n"
+"<entity-mappings \n"
+"
xmlns=\"http://java.sun.com/xml/ns/persistence/orm\"\n"
+"
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
+"
xsi:schemaLocation=\"http://java.sun.com/xml/ns/persistence/orm
orm_1_0.xsd"
+"\"\n"
+" version=\"1.0\">\n"
+"\n"
+" <persistence-unit-metadata>\n"
+" <xml-mapping-metadata-complete/>\n"
+" <persistence-unit-defaults>\n"
+" <schema>myschema</schema>\n"
+" <catalog>mycatalog</catalog>\n"
+" <cascade-persist/>\n"
+" </persistence-unit-defaults>\n"
+" </persistence-unit-metadata>"
+msgstr ""
+"<?xml version=\"1.0\"
encoding=\"UTF-8\"?>\n"
+"\n"
+"<entity-mappings \n"
+"
xmlns=\"http://java.sun.com/xml/ns/persistence/orm\"\n"
+"
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
+"
xsi:schemaLocation=\"http://java.sun.com/xml/ns/persistence/orm
orm_1_0.xsd"
+"\"\n"
+" version=\"1.0\">\n"
+"\n"
+" <persistence-unit-metadata>\n"
+" <xml-mapping-metadata-complete/>\n"
+" <persistence-unit-defaults>\n"
+" <schema>myschema</schema>\n"
+" <catalog>mycatalog</catalog>\n"
+" <cascade-persist/>\n"
+" </persistence-unit-defaults>\n"
+" </persistence-unit-metadata>"
+
+#. Tag: para
+#: xml-overriding.xml:58
+#, no-c-format
+msgid ""
+"<literal>xml-mapping-metadata-complete</literal> means that all entity,
"
+"mapped-superclasses and embeddable metadata should be picked up from XML (ie
"
+"ignore annotations)."
+msgstr ""
+
+#. Tag: para
+#: xml-overriding.xml:62
+#, no-c-format
+msgid ""
+"<literal>schema / catalog</literal> will override all default
definitions of "
+"schema and catalog in the metadata (both XML and annotations)."
+msgstr ""
+
+#. Tag: para
+#: xml-overriding.xml:66
+#, no-c-format
+msgid ""
+"<literal>cascade-persist</literal> means that all associations have
PERSIST "
+"as a cascade type. We recommend you to not use this feature."
+msgstr ""
+
+#. Tag: title
+#: xml-overriding.xml:72
+#, no-c-format
+msgid "Entity level metadata"
+msgstr ""
+
+#. Tag: para
+#: xml-overriding.xml:74
+#, no-c-format
+msgid "You can either define or override metadata informations on a given
entity."
+msgstr ""
+
+#. Tag: section
+#: xml-overriding.xml:75
+#, no-c-format
+msgid ""
+"<programlistingco> <areaspec> <area coords=\"3 85\"
id=\"aa1\"/> <area "
+"coords=\"9 85\" id=\"aa2\"/> <area coords=\"10
85\" id=\"aa3\"/> <area "
+"coords=\"11 85\" id=\"aa4\"/> <area coords=\"17
85\" id=\"aa5\"/> <area "
+"coords=\"23 85\" id=\"aa6\"/> <area coords=\"24
85\" id=\"aa7\"/> <area "
+"coords=\"25 85\" id=\"aa8\"/> <area coords=\"26
85\" id=\"aa9\"/> <area "
+"coords=\"31 85\" id=\"aa10\"/> </areaspec>
<programlisting><?xml version="
+"\"1.0\" encoding=\"UTF-8\"?>\n"
+"\n"
+"<entity-mappings \n"
+"
xmlns=\"http://java.sun.com/xml/ns/persistence/orm\"\n"
+"
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
+"
xsi:schemaLocation=\"http://java.sun.com/xml/ns/persistence/orm
orm_1_0.xsd"
+"\"\n"
+" version=\"1.0\">\n"
+"\n"
+"
<package>org.hibernate.test.annotations.reflection</"
+"package>\n"
+" <entity class=\"Administration\" access=\"PROPERTY\"
metadata-"
+"complete=\"true\">\n"
+" <table name=\"tbl_admin\">\n"
+" <unique-constraint>\n"
+"
<column-name>firstname</column-name>\n"
+"
<column-name>lastname</column-name>\n"
+" </unique-constraint>\n"
+" </table>\n"
+" <secondary-table name=\"admin2\">\n"
+" <primary-key-join-column name=\"admin_id\"
referenced-column-"
+"name=\"id\"/>\n"
+" <unique-constraint>\n"
+"
<column-name>address</column-name>\n"
+" </unique-constraint>\n"
+" </secondary-table>\n"
+" <id-class class=\"SocialSecurityNumber\"/>\n"
+" <inheritance strategy=\"JOINED\"/>\n"
+" <sequence-generator name=\"seqhilo\"
sequence-name=\"seqhilo\"/"
+">\n"
+" <table-generator name=\"table\"
table=\"tablehilo\"/>\n"
+" ...\n"
+" </entity>\n"
+"\n"
+" <entity class=\"PostalAdministration\">\n"
+" <primary-key-join-column name=\"id\"/>\n"
+" ...\n"
+" </entity>\n"
+"</entity-mappings></programlisting> <calloutlist>
<callout arearefs="
+"\"aa1\"> <para><literal>entity-mappings</literal>:
entity-mappings is the "
+"root element for all XML files. You must declare the xml schema, the schema "
+"file is included in the hibernate-annotations.jar file, no internet access "
+"will be processed by Hibernate Annotations.</para> </callout>
<callout "
+"arearefs=\"aa2\"> <para><literal>package</literal>
(optional): default "
+"package used for all non qualified class names in the given deployment "
+"descriptor file.</para> </callout> <callout
arearefs=\"aa3\"> "
+"<para><literal>entity</literal>: desribes an entity.</para>
"
+"<para><literal>metadata-complete</literal> defines whether the
metadata "
+"description for this element is complete or not (in other words, if "
+"annotations present at the class level should be considered or not).</para>
"
+"<para>An entity has to have a <literal>class</literal> attribute
refering "
+"the java class the metadata applies on.</para> <para>You can overrides
"
+"entity name through the <literal>name</literal> attribute, if none is
"
+"defined and if an <literal>(a)Entity.name</literal> is present, then it
is "
+"used (provided that metadata complete is not set).</para> <para>For
metadata "
+"complete (see below) element, you can define an
<literal>access</literal> "
+"(either <literal>FIELD</literal> or
<literal>PROPERTY</literal> (default)). "
+"For non medatada complete element, if <literal>access</literal> is not
"
+"defined, the @Id position will lead position, if
<literal>access</literal> "
+"is defined, the value is used.</para> </callout> <callout
arearefs=\"aa4\"> "
+"<para><literal>table</literal>: you can declare table properties
(name, "
+"schema, catalog), if none is defined, the java annotation is used.</para>
"
+"<para>You can define one or several unique constraints as seen in the "
+"example</para> </callout> <callout arearefs=\"aa5\">
"
+"<para><literal>secondary-table</literal>: defines a secondary
table very "
+"much like a regular table except that you can define the primary key / "
+"foreign key column(s) through the
<literal>primary-key-join-column</literal> "
+"element. On non metadata complete, annotation secondary tables are used only
"
+"if there is no <literal>secondary-table</literal> definition,
annotations "
+"are ignored otherwise.</para> </callout> <callout
arearefs=\"aa6\"> "
+"<para><literal>id-class</literal>: defines the id class in a
similar way "
+"<literal>@IdClass</literal> does</para> </callout>
<callout arearefs=\"aa7"
+"\"> <para><literal>inheritance</literal>: defines the
inheritance strategy "
+"(<literal>JOINED</literal>,
<literal>TABLE_PER_CLASS</literal>, "
+"<literal>SINGLE_TABLE</literal>), Available only at the root entity
level</"
+"para> </callout> <callout arearefs=\"aa8\">
<para><literal>sequence-"
+"generator</literal>: defines a sequence generator</para>
</callout> <callout "
+"arearefs=\"aa9\">
<para><literal>table-generator</literal>: defines a table "
+"generator</para> </callout> <callout arearefs=\"aa10\">
"
+"<para><literal><literal>primary-key-join-column</literal></literal>:
defines "
+"the primary key join column for sub entities when JOINED inheritance "
+"strategy is used</para> </callout> </calloutlist>
</programlistingco> "
+"<programlistingco> <areaspec> <area coords=\"11 85\"
id=\"ab1\"/> <area "
+"coords=\"18 85\" id=\"ab2\"/> <area coords=\"22
85\" id=\"ab3\"/> <area "
+"coords=\"28 85\" id=\"ab4\"/> <area coords=\"34
85\" id=\"ab5\"/> </"
+"areaspec> <programlisting><?xml version=\"1.0\"
encoding=\"UTF-8\"?>\n"
+"\n"
+"<entity-mappings \n"
+"
xmlns=\"http://java.sun.com/xml/ns/persistence/orm\"\n"
+"
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
+"
xsi:schemaLocation=\"http://java.sun.com/xml/ns/persistence/orm
orm_1_0.xsd"
+"\"\n"
+" version=\"1.0\">\n"
+"\n"
+"
<package>org.hibernate.test.annotations.reflection</"
+"package>\n"
+" <entity class=\"Music\" access=\"PROPERTY\"
metadata-complete=\"true"
+"\">\n"
+"
<discriminator-value>Generic</discriminator-value>\n"
+" <discriminator-column length=\"34\"/>\n"
+" ...\n"
+" </entity>\n"
+"\n"
+" <entity class=\"PostalAdministration\">\n"
+" <primary-key-join-column name=\"id\"/>\n"
+" <named-query name=\"adminById\">\n"
+" <query>select m from Administration m where m.id =
:id</"
+"query>\n"
+" <hint name=\"org.hibernate.timeout\"
value=\"200\"/>\n"
+" </named-query>\n"
+" <named-native-query name=\"allAdmin\"
result-set-mapping=\"adminrs"
+"\">\n"
+" <query>select *, count(taxpayer_id) as taxPayerNumber
\n"
+" from Administration, TaxPayer\n"
+" where taxpayer_admin_id = admin_id group by
...</query>\n"
+" <hint name=\"org.hibernate.timeout\"
value=\"200\"/>\n"
+" </named-native-query>\n"
+" <sql-result-set-mapping name=\"adminrs\">\n"
+" <entity-result
entity-class=\"Administration\">\n"
+" <field-result name=\"name\"
column=\"fld_name\"/>\n"
+" </entity-result>\n"
+" <column-result
name=\"taxPayerNumber\"/>\n"
+" </sql-result-set-mapping>\n"
+" <attribute-override name=\"ground\">\n"
+" <column name=\"fld_ground\" unique=\"true\"
scale=\"2\"/>\n"
+" </attribute-override>\n"
+" <association-override name=\"referer\">\n"
+" <join-column name=\"referer_id\"
referenced-column-name=\"id"
+"\"/>\n"
+" </association-override>\n"
+" ...\n"
+" </entity>\n"
+"</entity-mappings></programlisting> <calloutlist>
<callout arearefs="
+"\"ab1\"> <para><literal>discriminator-value /
discriminator-column</"
+"literal>: defines the discriminator value and the column holding it when the
"
+"SINGLE_TABLE inheritance strategy is chosen</para> </callout>
<callout "
+"arearefs=\"ab2\">
<para><literal>named-query</literal>: defines named "
+"queries and possibly the hints associated to them. Those definitions are "
+"additive to the one defined in annotations, if two definitions have the same
"
+"name, the XML one has priority.</para> </callout> <callout
arearefs=\"ab3\"> "
+"<para><literal>named-native-query</literal>: defines an named
native query "
+"and its sql result set mapping. Alternatively, you can define the "
+"<literal>result-class</literal>. Those definitions are additive to the
one "
+"defined in annotations, if two definitions have the same name, the XML one "
+"has priority.</para> </callout> <callout
arearefs=\"ab4\"> "
+"<para><literal>sql-result-set-mapping</literal>: describes the
result set "
+"mapping structure. You can define both entity and column mappings. Those "
+"definitions are additive to the one defined in annotations, if two "
+"definitions have the same name, the XML one has priority</para>
</callout> "
+"<callout arearefs=\"ab5\">
<para><literal>attribute-override / association-"
+"override</literal>: defines a column or join column overriding. This "
+"overriding is additive to the one defined in annotations</para>
</callout> </"
+"calloutlist> </programlistingco>"
+msgstr ""
+"<programlistingco> <areaspec> <area coords=\"3 85\"
id=\"aa1\"/> <area "
+"coords=\"9 85\" id=\"aa2\"/> <area coords=\"10
85\" id=\"aa3\"/> <area "
+"coords=\"11 85\" id=\"aa4\"/> <area coords=\"17
85\" id=\"aa5\"/> <area "
+"coords=\"23 85\" id=\"aa6\"/> <area coords=\"24
85\" id=\"aa7\"/> <area "
+"coords=\"25 85\" id=\"aa8\"/> <area coords=\"26
85\" id=\"aa9\"/> <area "
+"coords=\"31 85\" id=\"aa10\"/> </areaspec>
<programlisting><?xml version="
+"\"1.0\" encoding=\"UTF-8\"?>\n"
+"\n"
+"<entity-mappings \n"
+"
xmlns=\"http://java.sun.com/xml/ns/persistence/orm\"\n"
+"
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
+"
xsi:schemaLocation=\"http://java.sun.com/xml/ns/persistence/orm
orm_1_0.xsd"
+"\"\n"
+" version=\"1.0\">\n"
+"\n"
+"
<package>org.hibernate.test.annotations.reflection</"
+"package>\n"
+" <entity class=\"Administration\" access=\"PROPERTY\"
metadata-"
+"complete=\"true\">\n"
+" <table name=\"tbl_admin\">\n"
+" <unique-constraint>\n"
+"
<column-name>firstname</column-name>\n"
+"
<column-name>lastname</column-name>\n"
+" </unique-constraint>\n"
+" </table>\n"
+" <secondary-table name=\"admin2\">\n"
+" <primary-key-join-column name=\"admin_id\"
referenced-column-"
+"name=\"id\"/>\n"
+" <unique-constraint>\n"
+"
<column-name>address</column-name>\n"
+" </unique-constraint>\n"
+" </secondary-table>\n"
+" <id-class class=\"SocialSecurityNumber\"/>\n"
+" <inheritance strategy=\"JOINED\"/>\n"
+" <sequence-generator name=\"seqhilo\"
sequence-name=\"seqhilo\"/"
+">\n"
+" <table-generator name=\"table\"
table=\"tablehilo\"/>\n"
+" ...\n"
+" </entity>\n"
+"\n"
+" <entity class=\"PostalAdministration\">\n"
+" <primary-key-join-column name=\"id\"/>\n"
+" ...\n"
+" </entity>\n"
+"</entity-mappings></programlisting> <calloutlist>
<callout arearefs="
+"\"aa1\"> <para><literal>entity-mappings</literal>:
entity-mappings is the "
+"root element for all XML files. You must declare the xml schema, the schema "
+"file is included in the hibernate-annotations.jar file, no internet access "
+"will be processed by Hibernate Annotations.</para> </callout>
<callout "
+"arearefs=\"aa2\"> <para><literal>package</literal>
(optional): default "
+"package used for all non qualified class names in the given deployment "
+"descriptor file.</para> </callout> <callout
arearefs=\"aa3\"> "
+"<para><literal>entity</literal>: desribes an entity.</para>
"
+"<para><literal>metadata-complete</literal> defines whether the
metadata "
+"description for this element is complete or not (in other words, if "
+"annotations present at the class level should be considered or not).</para>
"
+"<para>An entity has to have a <literal>class</literal> attribute
refering "
+"the java class the metadata applies on.</para> <para>You can overrides
"
+"entity name through the <literal>name</literal> attribute, if none is
"
+"defined and if an <literal>(a)Entity.name</literal> is present, then it
is "
+"used (provided that metadata complete is not set).</para> <para>For
metadata "
+"complete (see below) element, you can define an
<literal>access</literal> "
+"(either <literal>FIELD</literal> or
<literal>PROPERTY</literal> (default)). "
+"For non medatada complete element, if <literal>access</literal> is not
"
+"defined, the @Id position will lead position, if
<literal>access</literal> "
+"is defined, the value is used.</para> </callout> <callout
arearefs=\"aa4\"> "
+"<para><literal>table</literal>: you can declare table properties
(name, "
+"schema, catalog), if none is defined, the java annotation is used.</para>
"
+"<para>You can define one or several unique constraints as seen in the "
+"example</para> </callout> <callout arearefs=\"aa5\">
"
+"<para><literal>secondary-table</literal>: defines a secondary
table very "
+"much like a regular table except that you can define the primary key / "
+"foreign key column(s) through the
<literal>primary-key-join-column</literal> "
+"element. On non metadata complete, annotation secondary tables are used only
"
+"if there is no <literal>secondary-table</literal> definition,
annotations "
+"are ignored otherwise.</para> </callout> <callout
arearefs=\"aa6\"> "
+"<para><literal>id-class</literal>: defines the id class in a
similar way "
+"<literal>@IdClass</literal> does</para> </callout>
<callout arearefs=\"aa7"
+"\"> <para><literal>inheritance</literal>: defines the
inheritance strategy "
+"(<literal>JOINED</literal>,
<literal>TABLE_PER_CLASS</literal>, "
+"<literal>SINGLE_TABLE</literal>), Available only at the root entity
level</"
+"para> </callout> <callout arearefs=\"aa8\">
<para><literal>sequence-"
+"generator</literal>: defines a sequence generator</para>
</callout> <callout "
+"arearefs=\"aa9\">
<para><literal>table-generator</literal>: defines a table "
+"generator</para> </callout> <callout arearefs=\"aa10\">
"
+"<para><literal><literal>primary-key-join-column</literal></literal>:
defines "
+"the primary key join column for sub entities when JOINED inheritance "
+"strategy is used</para> </callout> </calloutlist>
</programlistingco> "
+"<programlistingco> <areaspec> <area coords=\"11 85\"
id=\"ab1\"/> <area "
+"coords=\"18 85\" id=\"ab2\"/> <area coords=\"22
85\" id=\"ab3\"/> <area "
+"coords=\"28 85\" id=\"ab4\"/> <area coords=\"34
85\" id=\"ab5\"/> </"
+"areaspec> <programlisting><?xml version=\"1.0\"
encoding=\"UTF-8\"?>\n"
+"\n"
+"<entity-mappings \n"
+"
xmlns=\"http://java.sun.com/xml/ns/persistence/orm\"\n"
+"
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
+"
xsi:schemaLocation=\"http://java.sun.com/xml/ns/persistence/orm
orm_1_0.xsd"
+"\"\n"
+" version=\"1.0\">\n"
+"\n"
+"
<package>org.hibernate.test.annotations.reflection</"
+"package>\n"
+" <entity class=\"Music\" access=\"PROPERTY\"
metadata-complete=\"true"
+"\">\n"
+"
<discriminator-value>Generic</discriminator-value>\n"
+" <discriminator-column length=\"34\"/>\n"
+" ...\n"
+" </entity>\n"
+"\n"
+" <entity class=\"PostalAdministration\">\n"
+" <primary-key-join-column name=\"id\"/>\n"
+" <named-query name=\"adminById\">\n"
+" <query>select m from Administration m where m.id =
:id</"
+"query>\n"
+" <hint name=\"org.hibernate.timeout\"
value=\"200\"/>\n"
+" </named-query>\n"
+" <named-native-query name=\"allAdmin\"
result-set-mapping=\"adminrs"
+"\">\n"
+" <query>select *, count(taxpayer_id) as taxPayerNumber
\n"
+" from Administration, TaxPayer\n"
+" where taxpayer_admin_id = admin_id group by
...</query>\n"
+" <hint name=\"org.hibernate.timeout\"
value=\"200\"/>\n"
+" </named-native-query>\n"
+" <sql-result-set-mapping name=\"adminrs\">\n"
+" <entity-result
entity-class=\"Administration\">\n"
+" <field-result name=\"name\"
column=\"fld_name\"/>\n"
+" </entity-result>\n"
+" <column-result
name=\"taxPayerNumber\"/>\n"
+" </sql-result-set-mapping>\n"
+" <attribute-override name=\"ground\">\n"
+" <column name=\"fld_ground\" unique=\"true\"
scale=\"2\"/>\n"
+" </attribute-override>\n"
+" <association-override name=\"referer\">\n"
+" <join-column name=\"referer_id\"
referenced-column-name=\"id"
+"\"/>\n"
+" </association-override>\n"
+" ...\n"
+" </entity>\n"
+"</entity-mappings></programlisting> <calloutlist>
<callout arearefs="
+"\"ab1\"> <para><literal>discriminator-value /
discriminator-column</"
+"literal>: defines the discriminator value and the column holding it when the
"
+"SINGLE_TABLE inheritance strategy is chosen</para> </callout>
<callout "
+"arearefs=\"ab2\">
<para><literal>named-query</literal>: defines named "
+"queries and possibly the hints associated to them. Those definitions are "
+"additive to the one defined in annotations, if two definitions have the same
"
+"name, the XML one has priority.</para> </callout> <callout
arearefs=\"ab3\"> "
+"<para><literal>named-native-query</literal>: defines an named
native query "
+"and its sql result set mapping. Alternatively, you can define the "
+"<literal>result-class</literal>. Those definitions are additive to the
one "
+"defined in annotations, if two definitions have the same name, the XML one "
+"has priority.</para> </callout> <callout
arearefs=\"ab4\"> "
+"<para><literal>sql-result-set-mapping</literal>: describes the
result set "
+"mapping structure. You can define both entity and column mappings. Those "
+"definitions are additive to the one defined in annotations, if two "
+"definitions have the same name, the XML one has priority</para>
</callout> "
+"<callout arearefs=\"ab5\">
<para><literal>attribute-override / association-"
+"override</literal>: defines a column or join column overriding. This "
+"overriding is additive to the one defined in annotations</para>
</callout> </"
+"calloutlist> </programlistingco>"
+
+#. Tag: para
+#: xml-overriding.xml:246
+#, no-c-format
+msgid ""
+"Same applies for <literal><embeddable></literal> and
<literal><"
+"mapped-superclass></literal>."
+msgstr ""
+
+#. Tag: title
+#: xml-overriding.xml:251
+#, no-c-format
+msgid "Property level metadata"
+msgstr "Metadatos a nivel de propiedades"
+
+#. Tag: para
+#: xml-overriding.xml:253
+#, no-c-format
+msgid ""
+"You can of course defines XML overriding for properties. If metadata "
+"complete is defined, then additional properties (ie at the Java level) will "
+"be ignored. Otherwise, once you start overriding a property, all annotations
"
+"on the given property are ignored. All property level metadata behave in "
+"<literal>entity/attributes</literal>,
<literal>mapped-superclass/attributes</"
+"literal> or <literal>embeddable/attributes</literal>."
+msgstr ""
+
+#. Tag: programlisting
+#: xml-overriding.xml:261
+#, no-c-format
+msgid ""
+"<attributes>\n"
+" <id name=\"id\">\n"
+" <column name=\"fld_id\"/>\n"
+" <generated-value generator=\"generator\"
strategy=\"SEQUENCE"
+"\"/>\n"
+" <temporal>DATE</temporal>\n"
+" <sequence-generator name=\"generator\"
sequence-name=\"seq\"/"
+">\n"
+" </id>\n"
+" <version name=\"version\"/>\n"
+" <embedded name=\"embeddedObject\">\n"
+" <attribute-override
name\"subproperty\">\n"
+" <column name=\"my_column\"/>\n"
+" </attribute-override>\n"
+" </embedded>\n"
+" <basic name=\"status\"
optional=\"false\">\n"
+" <enumerated>STRING</enumerated>\n"
+" </basic>\n"
+" <basic name=\"serial\"
optional=\"true\">\n"
+" <column name=\"serialbytes\"/>\n"
+" <lob/>\n"
+" </basic>\n"
+" <basic name=\"terminusTime\"
fetch=\"LAZY\">\n"
+" <temporal>TIMESTAMP</temporal>\n"
+" </basic>\n"
+" </attributes>"
+msgstr ""
+"<attributes>\n"
+" <id name=\"id\">\n"
+" <column name=\"fld_id\"/>\n"
+" <generated-value generator=\"generator\"
strategy=\"SEQUENCE"
+"\"/>\n"
+" <temporal>DATE</temporal>\n"
+" <sequence-generator name=\"generator\"
sequence-name=\"seq\"/"
+">\n"
+" </id>\n"
+" <version name=\"version\"/>\n"
+" <embedded name=\"embeddedObject\">\n"
+" <attribute-override
name\"subproperty\">\n"
+" <column name=\"my_column\"/>\n"
+" </attribute-override>\n"
+" </embedded>\n"
+" <basic name=\"status\"
optional=\"false\">\n"
+" <enumerated>STRING</enumerated>\n"
+" </basic>\n"
+" <basic name=\"serial\"
optional=\"true\">\n"
+" <column name=\"serialbytes\"/>\n"
+" <lob/>\n"
+" </basic>\n"
+" <basic name=\"terminusTime\"
fetch=\"LAZY\">\n"
+" <temporal>TIMESTAMP</temporal>\n"
+" </basic>\n"
+" </attributes>"
+
+#. Tag: para
+#: xml-overriding.xml:263
+#, no-c-format
+msgid ""
+"You can override a property through <literal>id</literal>,
<literal>embedded-"
+"id</literal>, <literal>version</literal>,
<literal>embedded</literal> and "
+"<literal>basic</literal>. Each of these elements can have subelements
"
+"accordingly: <literal>lob</literal>,
<literal>temporal</literal>, "
+"<literal>enumerated</literal>,
<literal>column</literal>."
+msgstr ""
+
+#. Tag: title
+#: xml-overriding.xml:272
+#, no-c-format
+msgid "Association level metadata"
+msgstr "Metadatos a nivel de asociaciones"
+
+#. Tag: para
+#: xml-overriding.xml:274
+#, no-c-format
+msgid ""
+"You can define XML overriding for associations. All association level "
+"metadata behave in <literal>entity/attributes</literal>,
<literal>mapped-"
+"superclass/attributes</literal> or
<literal>embeddable/attributes</literal>."
+msgstr ""
+
+#. Tag: programlisting
+#: xml-overriding.xml:279
+#, no-c-format
+msgid ""
+"<attributes>\n"
+" <one-to-many name=\"players\"
fetch=\"EAGER\">\n"
+" <map-key name=\"name\"/>\n"
+" <join-column name=\"driver\"/>\n"
+" <join-column name=\"number\"/>\n"
+" </one-to-many>\n"
+" <many-to-many name=\"roads\"
target-entity=\"Administration"
+"\">\n"
+" <order-by>maxSpeed</order-by>\n"
+" <join-table name=\"bus_road\">\n"
+" <join-column name=\"driver\"/>\n"
+" <join-column name=\"number\"/>\n"
+" <inverse-join-column
name=\"road_id\"/>\n"
+" <unique-constraint>\n"
+"
<column-name>driver</column-name>\n"
+"
<column-name>number</column-name>\n"
+" </unique-constraint>\n"
+" </join-table>\n"
+" </many-to-many>\n"
+" <many-to-many name=\"allTimeDrivers\"
mapped-by=\"drivenBuses"
+"\">\n"
+" </attributes>"
+msgstr ""
+"<attributes>\n"
+" <one-to-many name=\"players\"
fetch=\"EAGER\">\n"
+" <map-key name=\"name\"/>\n"
+" <join-column name=\"driver\"/>\n"
+" <join-column name=\"number\"/>\n"
+" </one-to-many>\n"
+" <many-to-many name=\"roads\"
target-entity=\"Administration"
+"\">\n"
+" <order-by>maxSpeed</order-by>\n"
+" <join-table name=\"bus_road\">\n"
+" <join-column name=\"driver\"/>\n"
+" <join-column name=\"number\"/>\n"
+" <inverse-join-column
name=\"road_id\"/>\n"
+" <unique-constraint>\n"
+"
<column-name>driver</column-name>\n"
+"
<column-name>number</column-name>\n"
+" </unique-constraint>\n"
+" </join-table>\n"
+" </many-to-many>\n"
+" <many-to-many name=\"allTimeDrivers\"
mapped-by=\"drivenBuses"
+"\">\n"
+" </attributes>"
+
+#. Tag: para
+#: xml-overriding.xml:281
+#, no-c-format
+msgid ""
+"You can override an association through <literal>one-to-many</literal>,
"
+"<literal>one-to-one</literal>,
<literal>many-to-one</literal>, and "
+"<literal>many-to-many</literal>. Each of these elements can have
subelements "
+"accordingly: <literal>join-table</literal> (which can have
<literal>join-"
+"column</literal>s and <literal>inverse-join-column</literal>s),
"
+"<literal><literal>join-column</literal>s</literal>,
<literal>map-key</"
+"literal>, and <literal>order-by</literal>.
<literal>mapped-by</literal> and "
+"<literal>target-entity</literal> can be defined as attributes when it
makes "
+"sense. Once again the structure is reflects the annotations structure. You "
+"can find all semantic informations in the chapter describing annotations."
+msgstr ""
+
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/fr-FR/Author_Group.po
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/fr-FR/Author_Group.po
(rev 0)
+++ annotations/branches/v3_4_0_GA_CP/src/main/docbook/fr-FR/Author_Group.po 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,25 @@
+# translation of Author_Group.po to French
+# Language /tmp/mike/JBEAP420/Annotations translations for JBEAP package.
+# Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+#
+# Automatically generated, 2007.
+# Corina Roe <croe(a)redhat.com>, 2009.
+msgid ""
+msgstr ""
+"Project-Id-Version: Author_Group\n"
+"Report-Msgid-Bugs-To:
http://bugs.kde.org\n"
+"POT-Creation-Date: 2009-09-15 03:08+0000\n"
+"PO-Revision-Date: 2009-11-18 11:27+1000\n"
+"Last-Translator: Corina Roe <croe(a)redhat.com>\n"
+"Language-Team: French <i18(a)redhat.com>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: KBabel 1.11.4\n"
+
+#. Tag: author
+#: Author_Group.xml:6
+#, no-c-format
+msgid "<firstname>Red Hat Documentation Group</firstname>
<surname></surname>"
+msgstr "<firstname>Red Hat Documentation Group</firstname>
<surname></surname>"
+
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/fr-FR/Book_Info.po
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/fr-FR/Book_Info.po
(rev 0)
+++ annotations/branches/v3_4_0_GA_CP/src/main/docbook/fr-FR/Book_Info.po 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,47 @@
+# translation of Book_Info.po to French
+# Language /tmp/mike/JBEAP420/Annotations translations for JBEAP package.
+# Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+#
+# Automatically generated, 2007.
+# Corina Roe <croe(a)redhat.com>, 2009.
+msgid ""
+msgstr ""
+"Project-Id-Version: Book_Info\n"
+"Report-Msgid-Bugs-To:
http://bugs.kde.org\n"
+"POT-Creation-Date: 2009-09-15 03:08+0000\n"
+"PO-Revision-Date: 2009-11-18 11:28+1000\n"
+"Last-Translator: Corina Roe <croe(a)redhat.com>\n"
+"Language-Team: French <i18(a)redhat.com>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: KBabel 1.11.4\n"
+
+#. Tag: title
+#: Book_Info.xml:6
+#, no-c-format
+msgid "Hibernate Annotations Reference Guide"
+msgstr "Guide de référence d'annotations Hibernate"
+
+#. Tag: subtitle
+#: Book_Info.xml:7
+#, no-c-format
+msgid "for Use with JBoss Enterprise Application Platform 5.0"
+msgstr "Ã utiliser avec la plateforme JBoss Enterprise Application Platform
5.0"
+
+#. Tag: para
+#: Book_Info.xml:14
+#, no-c-format
+msgid ""
+"The JBoss Enterprise Application Platform Edition of the Hibernate "
+"Annotations Reference Guide"
+msgstr ""
+"L'édition de la plateforme JBoss Enterprise Application du Guide de "
+"références d'annotations Hibernate"
+
+#. Tag: holder
+#: Book_Info.xml:25
+#, no-c-format
+msgid "&HOLDER;"
+msgstr "&HOLDER;"
+
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/fr-FR/Feedback.po
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/fr-FR/Feedback.po
(rev 0)
+++ annotations/branches/v3_4_0_GA_CP/src/main/docbook/fr-FR/Feedback.po 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,42 @@
+# translation of Feedback.po to French
+# Language /tmp/mike/JBEAP420/Annotations translations for JBEAP package.
+# Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+#
+# Automatically generated, 2007.
+# Corina Roe <croe(a)redhat.com>, 2009.
+msgid ""
+msgstr ""
+"Project-Id-Version: Feedback\n"
+"Report-Msgid-Bugs-To:
http://bugs.kde.org\n"
+"POT-Creation-Date: 2009-09-15 03:08+0000\n"
+"PO-Revision-Date: 2009-11-18 11:30+1000\n"
+"Last-Translator: Corina Roe <croe(a)redhat.com>\n"
+"Language-Team: French <i18(a)redhat.com>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: KBabel 1.11.4\n"
+
+#. Tag: title
+#: Feedback.xml:6
+#, no-c-format
+msgid "Feedback"
+msgstr "Commentaires "
+
+#. Tag: para
+#: Feedback.xml:7
+#, no-c-format
+msgid ""
+"If you spot a typo in this guide, or if you have thought of a way to make "
+"this manual better, we would love to hear from you! Submit a report in "
+"<ulink
url=\"http://jira.jboss.com/jira/browse/JBPAPP\">JIRA</ul... against
"
+"the Product: JBoss Enterprise Application Platform, Version: "
+"<replaceable><version></replaceable>, Component:
<emphasis>Doc</"
+"emphasis>. If you have a suggestion for improving the documentation, try to
"
+"be as specific as possible. If you have found an error, include the section "
+"number and some of the surrounding text so we can find it easily."
+msgstr ""
+"Si vous découvrez une erreur, ou bien si vous pensez à un moyen d'améliorer ce
manuel, faîtes-nous en part! Envoyez-nous un rapport dans <ulink
url=\"http://jira.jboss.com/jira/browse/JBPAPP\">JIRA</ul... en
référençant le produit dont il s'agit, comme par exemple : JBoss Enterprise
Application Platform, Version: "
+"<replaceable><version></replaceable>, Composant:
<emphasis>Doc</"
+"emphasis>. Si vous avez trouvé une erreur, notez le numéro de la section et un
extrait de texte enveloppant, de façon à ce que nous puissions retrouver l'erreur
facilement. "
+
Added:
annotations/branches/v3_4_0_GA_CP/src/main/docbook/fr-FR/Hibernate_Annotations_Reference_Guide.po
===================================================================
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/fr-FR/Preface.po
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/fr-FR/Preface.po
(rev 0)
+++ annotations/branches/v3_4_0_GA_CP/src/main/docbook/fr-FR/Preface.po 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,67 @@
+# translation of Preface.po to French
+# Language /tmp/mike/JBEAP420/Annotations translations for JBEAP package.
+# Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+#
+# Automatically generated, 2007.
+# Corina Roe <croe(a)redhat.com>, 2009.
+msgid ""
+msgstr ""
+"Project-Id-Version: Preface\n"
+"Report-Msgid-Bugs-To:
http://bugs.kde.org\n"
+"POT-Creation-Date: 2009-09-15 03:08+0000\n"
+"PO-Revision-Date: 2009-11-18 11:58+1000\n"
+"Last-Translator: Corina Roe <croe(a)redhat.com>\n"
+"Language-Team: French <i18(a)redhat.com>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: KBabel 1.11.4\n"
+
+#. Tag: title
+#: Preface.xml:2
+#, no-c-format
+msgid "Preface"
+msgstr "Préface"
+
+#. Tag: para
+#: Preface.xml:4
+#, no-c-format
+msgid ""
+"Hibernate, like all other object/relational mapping tools, requires metadata
"
+"that governs the transformation of data from one representation to the "
+"other. In Hibernate 2.x mapping metadata is most of the time declared in XML
"
+"text files. Alternatively XDoclet can be used utilizing Javadoc source code "
+"annotations together with a compile time preprocessor."
+msgstr "Hibernate, comme tous les autres outils de mappage objet/relationnel, ont
besoin de métadonnées qui contrôlent la transformation de données d'une représentation
à une autre. Dans Hibernate 2.x, le mappage des métadonnées est souvent annoncé dans les
fichiers de texte XML. Sinon XDoclet peut également être utilisé avec des annotations de
code source de Javadoc et un préprocesseur de temps de compilation."
+
+#. Tag: para
+#: Preface.xml:11
+#, no-c-format
+msgid ""
+"The same kind of annotation support is now available in the standard JDK, "
+"although more powerful and with better tools support. IntelliJ IDEA and "
+"Eclipse for example, support auto-completion and syntax highlighting of JDK "
+"5.0 annotations which are compiled into the bytecode and read at runtime "
+"using reflection. No external XML files are needed."
+msgstr "Le même type de prise en charge d'annotation est maintenant disponible
dans le JDK standard, bien qu'avec des outils plus puissants. IntelliJ IDEA et Eclipse
par exemple, supportent la saisie semi-automatique et la coloration syntaxique des
annotations JDK 5.0 qui sont compilées dans le pseudo-code binaire et lisent à l'aide
de réflexion en cours d'exécution. Aucun des fichiers XML externes ne sont
nécessaires."
+
+#. Tag: para
+#: Preface.xml:17
+#, no-c-format
+msgid ""
+"The EJB3 specification recognizes the interest and the success of the "
+"transparent object/relational mapping paradigm. It standardizes the basic "
+"APIs and the metadata needed for any object/relational persistence "
+"mechanism. <emphasis>Hibernate EntityManager</emphasis> implements the
"
+"programming interfaces and lifecycle rules as defined by the EJB3 "
+"persistence specification and together with <emphasis>Hibernate
Annotations</"
+"emphasis> offers a complete (and standalone) EJB3 persistence solution on
"
+"top of the mature Hibernate core. You may use a combination of all three "
+"together, annotations without EJB3 programming interfaces and lifecycle, or "
+"even pure native Hibernate, depending on the business and technical needs of
"
+"your project. At all times you cann fall back to Hibernate native APIs, or "
+"if required, even to native JDBC and SQL."
+msgstr ""
+"La spécification EJB3 reconnaît l'intérêt et le succès du paradigme de mappage
transparent objet/relationnelles. Il normalise les API de base et les métadonnées
nécessaires pour tout mécanisme de persistance objet/relationnel.
<emphasis>Hibernate EntityManager</emphasis> implémente les interfaces de
programmation et les règles du cycle de vie ainsi que définies par la spécification de
persistance de EJB3 et en collaboration avec <emphasis>Hibernate
Annotations</emphasis>"
+" offre une solution de persistance EJB3 complète (et autonome) au-dessus du cœur
Hibernate mature. Vous pouvez utiliser une combinaison des trois, d'annotations sans
cycle de vie et sans interfaces de programmation EJB3, ou même pure Hibernate natif, selon
les besoins commerciaux et techniques de votre projet. À tout moment vous pourrez
reveniraux l'API natifs Hibernate, ou si nécessaire, même à JDBC et à SQL
natifs."
+
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/fr-FR/Revision_History.po
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/fr-FR/Revision_History.po
(rev 0)
+++
annotations/branches/v3_4_0_GA_CP/src/main/docbook/fr-FR/Revision_History.po 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,41 @@
+# translation of Revision_History.po to French
+# Language /tmp/mike/JBEAP420/Annotations translations for JBEAP package.
+# Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+#
+# Automatically generated, 2007.
+# Corina Roe <croe(a)redhat.com>, 2009.
+msgid ""
+msgstr ""
+"Project-Id-Version: Revision_History\n"
+"Report-Msgid-Bugs-To:
http://bugs.kde.org\n"
+"POT-Creation-Date: 2009-11-10 02:15+0000\n"
+"PO-Revision-Date: 2009-11-18 11:58+1000\n"
+"Last-Translator: Corina Roe <croe(a)redhat.com>\n"
+"Language-Team: French <i18(a)redhat.com>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: KBabel 1.11.4\n"
+
+#. Tag: title
+#: Revision_History.xml:6
+#, no-c-format
+msgid "Revision History"
+msgstr "Historique de révision "
+
+#. Tag: author
+#: Revision_History.xml:12
+#, no-c-format
+msgid ""
+"<firstname>Laura</firstname> <surname>Bailey</surname>
<email>lbailey(a)redhat."
+"com</email>"
+msgstr ""
+"<firstname>Laura</firstname> <surname>Bailey</surname>
<email>lbailey(a)redhat."
+"com</email>"
+
+#. Tag: member
+#: Revision_History.xml:19
+#, no-c-format
+msgid "Initial draft."
+msgstr "Initial draft."
+
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/fr-FR/additionalmodules.po
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/fr-FR/additionalmodules.po
(rev 0)
+++
annotations/branches/v3_4_0_GA_CP/src/main/docbook/fr-FR/additionalmodules.po 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,232 @@
+# translation of additionalmodules.po to French
+# Language /tmp/mike/JBEAP420/Annotations translations for JBEAP package.
+# Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+#
+# Automatically generated, 2007.
+# Corina Roe <croe(a)redhat.com>, 2009.
+msgid ""
+msgstr ""
+"Project-Id-Version: additionalmodules\n"
+"Report-Msgid-Bugs-To:
http://bugs.kde.org\n"
+"POT-Creation-Date: 2009-09-15 03:08+0000\n"
+"PO-Revision-Date: 2009-11-18 11:27+1000\n"
+"Last-Translator: Corina Roe <croe(a)redhat.com>\n"
+"Language-Team: French <i18(a)redhat.com>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: KBabel 1.11.4\n"
+
+#. Tag: title
+#: additionalmodules.xml:28
+#, no-c-format
+msgid "Additional modules"
+msgstr "Modules supplémentaires"
+
+#. Tag: para
+#: additionalmodules.xml:30
+#, no-c-format
+msgid ""
+"Hibernate Annotations mainly focus on persistence metadata. The project also
"
+"have a nice integration with two Hibernate modules."
+msgstr "Hibernate Annotations porte principalement sur les métadonnées de
persistance. Le projet comprend également une bonne intégration avec deux modules
d'Hibernate."
+
+#. Tag: title
+#: additionalmodules.xml:34
+#, no-c-format
+msgid "Hibernate Validator"
+msgstr "Hibernate Validator"
+
+#. Tag: title
+#: additionalmodules.xml:37 additionalmodules.xml:117
+#, no-c-format
+msgid "Description"
+msgstr "Description"
+
+#. Tag: para
+#: additionalmodules.xml:39
+#, no-c-format
+msgid ""
+"Annotations are a very convenient and elegant way to specify invariant "
+"constraints for a domain model. You can, for example, express that a "
+"property should never be null, that the account balance should be strictly "
+"positive, etc. These domain model constraints are declared in the bean "
+"itself by annotating its properties. A validator can then read them and "
+"check for constraint violations. The validation mechanism can be executed in
"
+"different layers in your application without having to duplicate any of "
+"these rules (presentation layer, data access layer). Following the DRY "
+"principle, Hibernate Validator has been designed for that purpose."
+msgstr ""
+"Annotations représente une façon pratique et élégante de spécifier les "
+"contraintes invariables pour un modèle de domaine. Vous pouvez, par exemple,
"
+"exprimer le fait qu'une propriété ne doit jamais être null, que le solde du
"
+"compte doit être strictement positif, etc. Ces contraintes de modèle de "
+"domaine sont déclarées dans le bean lui-même par l'annotation de ses "
+"propriétés. Le mécanisme de validation peut être exécuté sur différentes "
+"couches de votre application, sans avoir à dupliquer aucune de ces règles "
+"(couche de présentation, couche d'accès aux données). Hibernate Validator a
"
+"été conçu dans ce but, tout en se modelant sur le principe DRY."
+
+#. Tag: para
+#: additionalmodules.xml:50
+#, no-c-format
+msgid ""
+"Hibernate Validator works at two levels. First, it is able to check in-"
+"memory instances of a class for constraint violations. Second, it can apply "
+"the constraints to the Hibernate metamodel and incorporate them into the "
+"generated database schema."
+msgstr ""
+"Hibernate Validator fonctionne sur deux niveaux. Tout d'abord, il est à même
"
+"de pouvoir vérifier les violations de contraintes des instances en-mémoire "
+"d'une classe. Deuxièmement, il est en mesure d'appliquer les contraintes du
"
+"metamodel d'Hibernate et de les incorporer dans le schéma de bases de "
+"données généré."
+
+#. Tag: para
+#: additionalmodules.xml:55
+#, no-c-format
+msgid ""
+"Each constraint annotation is associated to a validator implementation "
+"responsible for checking the constraint on the entity instance. A validator "
+"can also (optionally) apply the constraint to the Hibernate metamodel, "
+"allowing Hibernate to generate DDL that expresses the constraint. With the "
+"appropriate event listener, you can execute the checking operation on "
+"inserts and updates done by Hibernate. Hibernate Validator is not limited to
"
+"use with Hibernate. You can easily use it anywhere in your application."
+msgstr ""
+"Chaque annotation de contrainte est associée à l'implémentation d'un
"
+"validator responsable de vérifier la contrainte pour l'instance d'entité.
Un "
+"validator peut également (optionnellement) appliquer la contrainte du "
+"metamodel Hibernate, permettant à Hibernate de générer DDL qui exprime la "
+"contrainte. Avec le listener d'événement qui convient, vous pouvez exécuter
"
+"l'opération de vérification sur les insertions et sur les mises à jour "
+"effectuées par Hibernate. Hibernate Validator n'est pas limité à "
+"l'utilisation d'Hibernate. Vous pouvez facilement l'utiliser
n'importe où "
+"dans votre application."
+
+#. Tag: para
+#: additionalmodules.xml:64
+#, no-c-format
+msgid ""
+"When checking instances at runtime, Hibernate Validator returns information "
+"about constraint violations in an array of
<classname>InvalidValue</"
+"classname> s. Among other information, the
<classname>InvalidValue</"
+"classname> contains an error description message that can embed the "
+"parameter values bundle with the annotation (eg. length limit), and message "
+"strings that may be externalized to a
<classname>ResourceBundle</classname> ."
+msgstr ""
+"Quand vous vérifiez des instances en cours d'exécution, Hibernate Validator
"
+"retourne des informations sur les violations de contrainte sous forme "
+"d'<classname>InvalidValue</classname>s. Entre autres informations,
"
+"<classname>InvalidValue</classname> contient un message de description
"
+"d'erreurs qui peut intégrer l'ensemble des valeurs de paramètres avec
"
+"l'annotation ( comme par exemple la limite de longueur), et les strings de
"
+"messages qui peuvent être externalisés en
<classname>ResourceBundle</"
+"classname>. "
+
+#. Tag: title
+#: additionalmodules.xml:74 additionalmodules.xml:132
+#, no-c-format
+msgid "Integration with Hibernate Annotations"
+msgstr "Intégration avec Hibernate Annotations"
+
+#. Tag: para
+#: additionalmodules.xml:76
+#, no-c-format
+msgid ""
+"If Hibernate Validator (<filename>hibernate-validator.jar</filename>)
is "
+"available in the classpath, Hibernate Annotations will integrate in two
ways:"
+msgstr "Si Hibernate Validator
(<filename>hibernate-validator.jar</filename>) est disponible dans le chemin
de classe, Hibernate Annotations intégrera de deux façons :"
+
+#. Tag: para
+#: additionalmodules.xml:82
+#, no-c-format
+msgid ""
+"Constraints will be applied to the Data Definition Language. In other words,
"
+"the database schema will reflect the constraints (provided that you use the "
+"hbm2ddl tool)."
+msgstr "Les contraintes s'appliqueront au Langage de définition des données (DDL
de l'anglais Data Definition Langage). En d'autres termes, le schéma de base de
données reflétera les contraintes (dans la mesure où vous utiliserez l'outil
hbm2ddl)."
+
+#. Tag: para
+#: additionalmodules.xml:88
+#, no-c-format
+msgid ""
+"Before an entity change is applied to the database (insert or update), the "
+"entity is validated. Validation errors, if any, will be carried over through
"
+"an <classname>InvalidStateException</classname>."
+msgstr "Avant qu'un changement d'entité ne soit appliqué à la base de
données (insertion ou de mise à jour), l'entité est validée. Les erreurs de
validation, le cas échéant, seront reportées à travers une
<classname>InvalidStateException</classname>."
+
+#. Tag: para
+#: additionalmodules.xml:95
+#, no-c-format
+msgid "For entities free of validation rules, the runtime performance cost is
null."
+msgstr "Pour les entités sans règles de validation, le coût de performance
d'exécution est null."
+
+#. Tag: para
+#: additionalmodules.xml:98
+#, no-c-format
+msgid ""
+"To disable constraint propagation to DDL, set up <literal>hibernate."
+"validator.apply_to_ddl</literal> to false in the configuration file. Such a
"
+"need is very uncommon and not recommended."
+msgstr ""
+"Pour désactiver la propagation de la contrainte de DDL, paramétrer
<literal>hibernate."
+"validator.apply_to_ddl</literal> Ã false dans le fichier de configuration. Un
tel besoin est très rare et n'est pas recommandé."
+
+#. Tag: para
+#: additionalmodules.xml:103
+#, no-c-format
+msgid ""
+"To disable pre-entity change validation, set up
<literal>hibernate.validator."
+"autoregister_listeners</literal> to false in the configuration file. Such a
"
+"need is very uncommon and not recommended."
+msgstr ""
+"Pour désactiver la validation de la modification pré-entity, installer
<literal>hibernate.validator."
+"autoregister_listeners</literal> Ã false dans le fichier de configuration. Un
tel besoin est très rare et n'est pas recommandé."
+
+#. Tag: para
+#: additionalmodules.xml:108
+#, no-c-format
+msgid "Check the Hibernate Validator reference documentation for more
information."
+msgstr "Vérifier la documentation de référence d'Hibernate Validator pour
obtenir davantage d'informations."
+
+#. Tag: title
+#: additionalmodules.xml:114
+#, no-c-format
+msgid "Hibernate Search"
+msgstr "Hibernate Search"
+
+#. Tag: para
+#: additionalmodules.xml:119
+#, no-c-format
+msgid ""
+"Full text search engines like <productname>Apache Lucene</productname>
are a "
+"very powerful technology to bring free text/efficient queries to "
+"applications. If suffers several mismatches when dealing with a object "
+"domain model (keeping the index up to date, mismatch between the index "
+"structure and the domain model, querying mismatch...) Hibernate Search "
+"indexes your domain model thanks to a few annotations, takes care of the "
+"database / index synchronization and brings you back regular managed objects
"
+"from free text queries. Hibernate Search is using <ulink
url=\"http://lucene."
+"apache.org\">Apache Lucene</ulink> under the cover."
+msgstr ""
+"Les moteurs de recherche plein texte comme <productname>Apache
Lucene</productname> représentent une technologie très puissante pour permettre les
requêtes de texte libre/efficace au niveau applications. Apache Lucene souffre de
nombreuses incohérences lorsqu'il a affaire à un modèle de domaine objet (garder
l'index à jour, incompatibilité entre la structure d'index et le modèle de
domaine, en questionnant les incompatibilités...). Hibernate Search indexera votre modèle
de domaine grâce à quelques annotations, prendra en charge la synchronisation de la base
de données / index et vous rapportera régulièrement les objets gérés standards des
requêtes en texte libre. Hibernate Search utilise <ulink
url=\"http://lucene."
+"apache.org\">Apache Lucene</ulink> sous couvert."
+
+#. Tag: para
+#: additionalmodules.xml:134
+#, no-c-format
+msgid ""
+"Hibernate Search integrates with Hibernate Annotations transparently "
+"provided that hibernate-search.jar is present in the classpath. If you do "
+"not wish to automatically register Hibernate Search event listeners, you can
"
+"set <literal>hibernate.search.autoregister_listeners</literal> to
false. "
+"Such a need is very uncommon and not recommended."
+msgstr "Hibernate Search s'intègre de façon transparente avec Hibernate
Annotations, dans la mesure où hibernate-search.jar est présent dans le chemin de classe.
Si vous ne souhaitez pas enregistrer automatiquement les listeners d'événement
Hibernate Search, vous pourrez configurer les
<literal>hibernate.search.autoregister_listeners</literal> Ã false. Ce genre
de configuration n'est pas commune et n'est pas recommandée."
+
+#. Tag: para
+#: additionalmodules.xml:141
+#, no-c-format
+msgid "Check the Hibernate Search reference documentation for more
information."
+msgstr "Vérifier la documentation de référence d'Hibernate Search pour obtenir
davantage d'informations."
+
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/fr-FR/entity.po
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/fr-FR/entity.po
(rev 0)
+++ annotations/branches/v3_4_0_GA_CP/src/main/docbook/fr-FR/entity.po 2009-12-22 06:50:19
UTC (rev 18313)
@@ -0,0 +1,8014 @@
+# translation of entity.po to French
+# Language /tmp/mike/JBEAP420/Annotations translations for JBEAP package.
+# Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+#
+# Automatically generated, 2007.
+# Corina Roe <croe(a)redhat.com>, 2009.
+msgid ""
+msgstr ""
+"Project-Id-Version: entity\n"
+"Report-Msgid-Bugs-To:
http://bugs.kde.org\n"
+"POT-Creation-Date: 2009-11-10 02:15+0000\n"
+"PO-Revision-Date: 2009-11-19 08:51+1000\n"
+"Last-Translator: Corina Roe <croe(a)redhat.com>\n"
+"Language-Team: French <i18(a)redhat.com>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: KBabel 1.11.4\n"
+
+#. Tag: title
+#: entity.xml:28
+#, no-c-format
+msgid "Entity Beans"
+msgstr "Beans entité"
+
+#. Tag: title
+#: entity.xml:31
+#, no-c-format
+msgid "Intro"
+msgstr "Introduction"
+
+#. Tag: para
+#: entity.xml:33
+#, no-c-format
+msgid ""
+"This section covers EJB 3.0 (aka Java Persistence) entity annotations and "
+"Hibernate-specific extensions."
+msgstr ""
+"Cette section couvre les annotations de Bean entité EJB 3.0 (alias Java
Persistence) et "
+"les extensions spécifiques Hybernate."
+
+#. Tag: title
+#: entity.xml:38
+#, no-c-format
+msgid "Mapping with EJB3/JPA Annotations"
+msgstr "Mappage avec Annotations EJB3/JPA"
+
+#. Tag: para
+#: entity.xml:40
+#, no-c-format
+msgid ""
+"EJB3 entities are plain POJOs. Actually they represent the exact same "
+"concept as the Hibernate persistent entities. Their mappings are defined "
+"through JDK 5.0 annotations (an XML descriptor syntax for overriding is "
+"defined in the EJB3 specification). Annotations can be split in two "
+"categories, the logical mapping annotations (allowing you to describe the "
+"object model, the class associations, etc.) and the physical mapping "
+"annotations (describing the physical schema, tables, columns, indexes, etc).
"
+"We will mix annotations from both categories in the following code examples."
+msgstr ""
+"Les entités EJB3 sont des entités POJO simples. En fait, elles représentent "
+"exactement le même concept que les entités persistantes Hibernate. Leur "
+"mappage est défini par Annotations JDK 5.0 (une syntaxe de surcharge de "
+"descriptor XML est définie dans la spécification EJB3). Les annotations "
+"peuvent être séparées en deux catégories, les annotations de mappage "
+"logiques (qui vous permettent de décrire le modèle de l'objet, les "
+"associations de classe, etc.) et les annotations de mappage physiques "
+"(décrivant le schéma physique, les tables, les colonnes, les index, etc.). "
+"Nous allons mixer les annotations des deux catégories dans les exemples de "
+"code suivants :"
+
+#. Tag: para
+#: entity.xml:50
+#, no-c-format
+msgid ""
+"EJB3 annotations are in the <literal>javax.persistence.*</literal>
package. "
+"Most JDK 5 compliant IDE (like Eclipse, IntelliJ IDEA and Netbeans) can "
+"autocomplete annotation interfaces and attributes for you (even without a "
+"specific \"EJB3\" module, since EJB3 annotations are plain JDK 5 "
+"annotations)."
+msgstr ""
+"Les annotations EJB3 se situe dans le package
<literal>javax.persistence.*</"
+"literal>. La plupart des IDE compatibles JD 5 (comme Eclipse, IntelliJ IDEA
"
+"et Netbeans) peuvent autocompléter des interfaces d'Annotations et des "
+"attributs pour vous (même sans spécifier un module \"EJB3\", puisque les
"
+"annotations EJB3 sont de simples annotations JDK 5)."
+
+#. Tag: para
+#: entity.xml:56
+#, no-c-format
+msgid ""
+"For more and runnable concrete examples read the JBoss EJB 3.0 tutorial or "
+"review the Hibernate Annotations test suite. Most of the unit tests have "
+"been designed to represent a concrete example and be a inspiration source."
+msgstr ""
+"Pour davantage d'exemples concrêts exécutables, lire le tutoriel JBoss EJB
"
+"3.0 ou revoir la suite de tests Hibernate Annotations. La plupart des tests "
+"d'unité ont été conçus pour représenter un exemple concrêt et pour être une
"
+"source d'inspiration à la fois."
+
+#. Tag: title
+#: entity.xml:62
+#, no-c-format
+msgid "Declaring an entity bean"
+msgstr "Déclarer un bean entité"
+
+#. Tag: para
+#: entity.xml:64
+#, no-c-format
+msgid ""
+"Every bound persistent POJO class is an entity bean and is declared using "
+"the <literal>@Entity</literal> annotation (at the class level):"
+msgstr ""
+"Toute classe POJO persistante liée est un bean entité et est déclarée en "
+"utilisant l'annotation <literal>@Entity</literal> (au niveau de la
classe) :"
+
+#. Tag: programlisting
+#: entity.xml:68
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Flight implements Serializable {\n"
+" Long id;\n"
+"\n"
+" @Id\n"
+" public Long getId() { return id; }\n"
+"\n"
+" public void setId(Long id) { this.id = id; }\n"
+"}"
+msgstr ""
+"@Entity\n"
+"public class Flight implements Serializable {\n"
+" Long id;\n"
+"\n"
+" @Id\n"
+" public Long getId() { return id; }\n"
+"\n"
+" public void setId(Long id) { this.id = id; }\n"
+"}"
+
+#. Tag: para
+#: entity.xml:70
+#, no-c-format
+msgid ""
+"<literal>@Entity</literal> declares the class as an entity bean (i.e. a
"
+"persistent POJO class), <literal>@Id</literal> declares the identifier
"
+"property of this entity bean. The other mapping declarations are implicit. "
+"This configuration by exception concept is central to the new EJB3 "
+"specification and a major improvement. The class Flight is mapped to the "
+"Flight table, using the column id as its primary key column."
+msgstr ""
+"<literal>@Entity</literal> déclare la classe en tant que bean
d'entité "
+"( c'est à dire une classe POJO persistante), <literal>@Id</literal>
declare "
+"la propriété d'identificateur de ce bean d'entité. Les autres déclarations
"
+"de mappage sont implicites. Cette configuration, par concepte d'exception,
"
+"est centrale à la nouvelle spécification EJB3 et représente une amélioration
"
+"importante. La classe Flight est mappée à la table Flight, en utilisant la "
+"colonne id comme colonne de clé primaire."
+
+#. Tag: para
+#: entity.xml:78
+#, no-c-format
+msgid ""
+"Depending on whether you annotate fields or methods, the access type used by
"
+"Hibernate will be <literal>field</literal> or
<literal>property</literal>. "
+"The EJB3 spec requires that you declare annotations on the element type that
"
+"will be accessed, i.e. the getter method if you use
<literal>property</"
+"literal> access, the field if you use <literal>field</literal>
access. "
+"Mixing EJB3 annotations in both fields and methods should be avoided. "
+"Hibernate will guess the access type from the position of
<literal>@Id</"
+"literal> or <literal>(a)EmbeddedId</literal>."
+msgstr ""
+"Suivant que vous annotiez champs ou méthodes, le type d'accès utilisé par
"
+"Hibernate sera <literal>field</literal> ou
<literal>property</literal>. Les "
+"spec EJB3 exigent que vous déclariez les annotations sur le type d'élément
"
+"auquel on va accéder, c'est à dire la méthode getter si vous utilisez "
+"l'accés <literal>property</literal>, le champ, si vous utilisez
l'accès "
+"<literal>field</literal>. On doit éviter de mélanger les annotations
EJB3 "
+"dans les champs et dans les méthodes. Hibernate va deviner le type d'accès Ã
"
+"partir de la position de <literal>@Id</literal> ou de
<literal>@EmbeddedId</"
+"literal>."
+
+#. Tag: title
+#: entity.xml:89
+#, no-c-format
+msgid "Defining the table"
+msgstr "Définir la table"
+
+#. Tag: para
+#: entity.xml:91
+#, no-c-format
+msgid ""
+"<literal>@Table</literal> is set at the class level; it allows you to
define "
+"the table, catalog, and schema names for your entity bean mapping. If no "
+"<literal>@Table</literal> is defined the default values are used: the
"
+"unqualified class name of the entity."
+msgstr ""
+"<literal>@Table</literal> est déterminé au niveau de la classe; cela
vous "
+"permet de définir les noms de schéma, le catalogue et la table pour votre "
+"mappage de bean entité. Si <literal>@Table</literal> n'est pas
défini, les "
+"valeurs par défaut seront utilisées : le nom de classes non qualifié de "
+"l'entité."
+
+#. Tag: programlisting
+#: entity.xml:96
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Table(name=\"tbl_sky\")\n"
+"public class Sky implements Serializable {\n"
+"..."
+msgstr ""
+"@Entity\n"
+"@Table(name=\"tbl_sky\")\n"
+"public class Sky implements Serializable {\n"
+"..."
+
+#. Tag: para
+#: entity.xml:98
+#, no-c-format
+msgid ""
+"The <literal>@Table</literal> element also contains a
<literal>schema</"
+"literal> and a <literal>catalog</literal> attributes, if they need
to be "
+"defined. You can also define unique constraints to the table using the "
+"<literal>@UniqueConstraint</literal> annotation in conjunction with
"
+"<literal>@Table</literal> (for a unique constraint bound to a single
column, "
+"refer to <literal>(a)Column</literal>)."
+msgstr ""
+"L'élément <literal>@Table</literal> contient également des
attributs "
+"<literal>schema</literal> et <literal>catalog</literal>,
s'ils ont besoin "
+"d'être définis. Vous pouvez également définir des contraintes uniques pour
"
+"la table en utilisant l'annotation
<literal>@UniqueConstraint</literal> en "
+"conjonction avec <literal>@Table</literal> (pour une contrainte simple
liée "
+"Ã une simple colonne, voir <literal>(a)Column</literal>)."
+
+#. Tag: programlisting
+#: entity.xml:105
+#, no-c-format
+msgid ""
+"@Table(name=\"tbl_sky\",\n"
+" <emphasis role=\"bold\">uniqueConstraints =
{@UniqueConstraint"
+"(columnNames={\"month\", \"day\"})}</emphasis>\n"
+")"
+msgstr ""
+"@Table(name=\"tbl_sky\",\n"
+" <emphasis role=\"bold\">uniqueConstraints =
{@UniqueConstraint"
+"(columnNames={\"month\", \"day\"})}</emphasis>\n"
+")"
+
+#. Tag: para
+#: entity.xml:107
+#, no-c-format
+msgid ""
+"A unique constraint is applied to the tuple month, day. Note that the "
+"<literal>columnNames</literal> array refers to the logical column
names."
+msgstr ""
+"Il existe une contrainte unique qui s'applique à la séquence mois, jour.
"
+"Notez bien que la structure de données <literal>columnNames</literal>
se "
+"rapporte aux noms de colonnes logiques."
+
+#. Tag: remark
+#: entity.xml:111
+#, no-c-format
+msgid ""
+"The logical column name is defined by the Hibernate NamingStrategy "
+"implementation. The default EJB3 naming strategy use the physical column "
+"name as the logical column name. Note that this may be different than the "
+"property name (if the column name is explicit). Unless you override the "
+"NamingStrategy, you shouldn't worry about that."
+msgstr ""
+"Le nom de colonne logique est défini par l'implémentation Hibernate "
+"NamingStrategy. La stratégie de nommage EJB3 par défaut utilise le nom de "
+"colonne physique comme nom de colonne logique. Notez que cela peut varier "
+"par rapport au nom de propriété ( si le nom de colonne est explicite). A "
+"moins que vous surchargiez NamingStrategy, vous ne devriez pas vous en "
+"inquiéter. "
+
+#. Tag: title
+#: entity.xml:120
+#, no-c-format
+msgid "Versioning for optimistic locking"
+msgstr "Suivi des versions pour verrouillage optimiste"
+
+#. Tag: para
+#: entity.xml:122
+#, no-c-format
+msgid ""
+"You can add optimistic locking capability to an entity bean using the "
+"<literal>@Version</literal> annotation:"
+msgstr ""
+"Vous pouvez ajouter des possibilités de verrouillage optimiste sur un bean "
+"entité en utilisant l'annotation <literal>@Version</literal>
:"
+
+#. Tag: programlisting
+#: entity.xml:125
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Flight implements Serializable {\n"
+"...\n"
+" @Version\n"
+" @Column(name=\"OPTLOCK\")\n"
+" public Integer getVersion() { ... }\n"
+"}"
+msgstr ""
+"@Entity\n"
+"public class Flight implements Serializable {\n"
+"...\n"
+" @Version\n"
+" @Column(name=\"OPTLOCK\")\n"
+" public Integer getVersion() { ... }\n"
+"}"
+
+#. Tag: para
+#: entity.xml:127
+#, no-c-format
+msgid ""
+"The version property will be mapped to the <literal>OPTLOCK</literal>
"
+"column, and the entity manager will use it to detect conflicting updates "
+"(preventing lost updates you might otherwise see with the last-commit-wins "
+"strategy)."
+msgstr ""
+"La propriété de la version sera mappée à la colonne
<literal>OPTLOCK</"
+"literal>, et le gestionnaire d'entités l'utilisera pour détecter les
mises à "
+"jour susceptibles d'entrer en conflit ( évitant ainsi les mises à jour "
+"manquées que vous pourriez normalement apercevoir avec la stratégie last-"
+"commit-wins)."
+
+#. Tag: para
+#: entity.xml:132
+#, no-c-format
+msgid ""
+"The version column may be a numeric (the recommended solution) or a "
+"timestamp as per the EJB3 spec. Hibernate support any kind of type provided "
+"that you define and implement the appropriate
<classname>UserVersionType</"
+"classname>."
+msgstr ""
+"La colonne de version peut être numérique (la solution préconisée) ou par "
+"date de dernière modification comme pour les spec EJB3. Hibernate prend en "
+"charge n'importe quel type, dans la mesure où vous implémentez le type de
"
+"version <classname>UserVersionType</classname> qui convient."
+
+#. Tag: para
+#: entity.xml:137
+#, no-c-format
+msgid ""
+"The application must not alter the version number set up by Hibernate in any
"
+"way. To artificially increase the version number, check in Hibernate Entity "
+"Manager's reference documentation
<literal>LockMode.WRITE</literal>"
+msgstr "L'application ne doit pas altérer le numéro de version numéro indiqué
par Hibernate de quelque manière que ce soit. Pour augmenter artificiellement le numéro de
version, vérifiez dans la documentation de référence d'Hibernate Entity Manager
<literal>LockMode.WRITE</literal>"
+
+#. Tag: title
+#: entity.xml:145
+#, no-c-format
+msgid "Mapping simple properties"
+msgstr "Le mappage des propriétés simples"
+
+#. Tag: title
+#: entity.xml:148
+#, no-c-format
+msgid "Declaring basic property mappings"
+msgstr "Déclarer les mappages de propriété de base"
+
+#. Tag: para
+#: entity.xml:150
+#, no-c-format
+msgid ""
+"Every non static non transient property (field or method) of an entity bean "
+"is considered persistent, unless you annotate it as
<literal>@Transient</"
+"literal>. Not having an annotation for your property is equivalent to the
"
+"appropriate <literal>@Basic</literal> annotation. The
<literal>@Basic</"
+"literal> annotation allows you to declare the fetching strategy for a "
+"property:"
+msgstr ""
+"Chaque propriété non transiente et non statique (champ ou méthode) d'un bean
"
+"entité est considéré comme persistante, à moins que vous l'annotiez en tant
"
+"que <literal>@Transient</literal>. Si vous ne possédez pas
d'annotation pour "
+"votre propriété, cela revient à l'annotation
<literal>@Basic</literal> qui "
+"convient. L'annotation <literal>@Basic</literal> vous permet de
déclarer la "
+"stratégie de récupération de propriété :"
+
+#. Tag: programlisting
+#: entity.xml:157
+#, no-c-format
+msgid ""
+"public transient int counter; //transient property\n"
+"\n"
+"private String firstname; //persistent property\n"
+"\n"
+"@Transient\n"
+"String getLengthInMeter() { ... } //transient property\n"
+"\n"
+"String getName() {... } // persistent property\n"
+"\n"
+"@Basic\n"
+"int getLength() { ... } // persistent property\n"
+"\n"
+"@Basic(fetch = FetchType.LAZY)\n"
+"String getDetailedComment() { ... } // persistent property\n"
+"\n"
+"(a)Temporal(TemporalType.TIME)\n"
+"java.util.Date getDepartureTime() { ... } // persistent property
\n"
+"\n"
+"(a)Enumerated(EnumType.STRING)\n"
+"Starred getNote() { ... } //enum persisted as String in database"
+msgstr ""
+"public transient int counter; //transient property\n"
+"\n"
+"private String firstname; //persistent property\n"
+"\n"
+"@Transient\n"
+"String getLengthInMeter() { ... } //transient property\n"
+"\n"
+"String getName() {... } // persistent property\n"
+"\n"
+"@Basic\n"
+"int getLength() { ... } // persistent property\n"
+"\n"
+"@Basic(fetch = FetchType.LAZY)\n"
+"String getDetailedComment() { ... } // persistent property\n"
+"\n"
+"(a)Temporal(TemporalType.TIME)\n"
+"java.util.Date getDepartureTime() { ... } // persistent property
\n"
+"\n"
+"(a)Enumerated(EnumType.STRING)\n"
+"Starred getNote() { ... } //enum persisted as String in database"
+
+#. Tag: para
+#: entity.xml:159
+#, no-c-format
+msgid ""
+"<literal>counter</literal>, a transient field, and
<literal>lengthInMeter</"
+"literal>, a method annotated as <literal>@Transient</literal>, and
will be "
+"ignored by the entity manager. <literal>name</literal>,
<literal>length</"
+"literal>, and <literal>firstname</literal> properties are mapped
persistent "
+"and eagerly fetched (the default for simple properties). The "
+"<literal>detailedComment</literal> property value will be lazily
fetched "
+"from the database once a lazy property of the entity is accessed for the "
+"first time. Usually you don't need to lazy simple properties (not to be "
+"confused with lazy association fetching)."
+msgstr ""
+"<literal>counter</literal>, un champ transitoire, et
<literal>lengthInMeter</"
+"literal>, une méthode annotée en tant que
<literal>@Transient</literal> "
+"(transitoire), qui sera ignorée par le gestionnaire d'entités. Les "
+"propriétés <literal>name</literal>,
<literal>length</literal>, et "
+"<literal>firstname</literal> sont mappées en tant que persistantes et
"
+"facilement récupérables (la valeur par défaut pour les propriétés simples). "
+"La valeur de la propriété <literal>detailedComment</literal> sera
obtenue à "
+"la demande à partir de la base de données, une fois qu'on accède à un telle
"
+"propriété pour la première fois. Normalement, vous n'avez pas besoin de "
+"charger à la demande des propriétés (ne pas confondre avec la récupération "
+"d'associations à la demande)."
+
+#. Tag: para
+#: entity.xml:171
+#, no-c-format
+msgid ""
+"To enable property level lazy fetching, your classes have to be "
+"instrumented: bytecode is added to the original one to enable such feature, "
+"please refer to the Hibernate reference documentation. If your classes are "
+"not instrumented, property level lazy loading is silently ignored."
+msgstr ""
+"Pour permettre de récupérer à la demande les niveaux de propriété, vos "
+"classes devront être instrumentées: le code à octets est rajouté sur "
+"l'original pour permettre une telle fonctionnalité, veuillez vous rapporter
"
+"à la documentation de référence Hibernate. Si vos classes ne sont pas "
+"instrumentées, le chargement des niveaux de propriété à la demande sera "
+"ignoré en silence."
+
+#. Tag: para
+#: entity.xml:178
+#, no-c-format
+msgid ""
+"The recommended alternative is to use the projection capability of EJB-QL or
"
+"Criteria queries."
+msgstr ""
+"La solution alternative est d'utiliser la capacité de projection d'EJB-QL
ou "
+"des requêtes Criteria."
+
+#. Tag: para
+#: entity.xml:181
+#, no-c-format
+msgid ""
+"EJB3 support property mapping of all basic types supported by Hibernate (all
"
+"basic Java types , their respective wrappers and serializable classes). "
+"Hibernate Annotations support out of the box Enum type mapping either into a
"
+"ordinal column (saving the enum ordinal) or a string based column (saving "
+"the enum string representation): the persistence representation, defaulted "
+"to ordinal, can be overriden through the <literal>@Enumerated</literal>
"
+"annotation as shown in the <literal>note</literal> property
example."
+msgstr ""
+"EJB3 supporte le mappage de tous les types de base pris en charge par "
+"Hibernate (tous les types Java de base, leurs enveloppes respectives et "
+"classes sérialisables). Hibernate Annotations prend en charge le mappage de "
+"type, soit sous forme de colonne ordinale (en gardant l'ordinal Enum) ou de
"
+"colonne basée chaînes (en gardant la representation en chaîne Enum) : la "
+"représentation persistante, rendue ordinale par défaut, peut être surchargée
"
+"par l'annotation <literal>@Enumerated</literal>, comme le montre
l'exemple "
+"de propriété <literal>note</literal>."
+
+#. Tag: para
+#: entity.xml:190
+#, no-c-format
+msgid ""
+"In core Java APIs, the temporal precision is not defined. When dealing with "
+"temporal data you might want to describe the expected precision in database.
"
+"Temporal data can have <literal>DATE</literal>,
<literal>TIME</literal>, or "
+"<literal>TIMESTAMP</literal> precision (ie the actual date, only the
time, "
+"or both). Use the <literal>@Temporal</literal> annotation to fine tune
that."
+msgstr ""
+"Pour les API Java core, la précision temporelle n'est pas définie. Quand on
"
+"traite des données temporelles, il pourrait être utilise de décrire la "
+"précision à laquelle on s'attend dans la base de données. Les données "
+"temporelles peuvent inclure les précisions suivantes :
<literal>DATE</"
+"literal>, <literal>TIME</literal>, ou
<literal>TIMESTAMP</literal> (c'est à "
+"dire la date, ou juste l'heure, ou encore les deux)\" Utiliser
l'annotation "
+"<literal>@Temporal</literal> pour plus de précision."
+
+#. Tag: para
+#: entity.xml:197
+#, no-c-format
+msgid ""
+"<literal>@Lob</literal> indicates that the property should be persisted
in a "
+"Blob or a Clob depending on the property type:
<classname>java.sql.Clob</"
+"classname>, <classname>Character[]</classname>,
<classname>char[]</"
+"classname> and java.lang.<classname>String</classname> will be
persisted in "
+"a Clob. <classname>java.sql.Blob</classname>,
<classname>Byte[]</classname>, "
+"<classname>byte[] </classname>and serializable type will be persisted
in a "
+"Blob."
+msgstr ""
+"<literal>@Lob</literal> indique que la propriété devrait être persistée
dans "
+"un Blob ou dans un Clob, suivant le type de propriété :
<classname>java.sql."
+"Clob</classname>, <classname>Character[]</classname>,
<classname>char[]</"
+"classname> et java.lang.<classname>String</classname> sera persisté
dans un "
+"Clob. <classname>java.sql.Blob</classname>,
<classname>Byte[]</classname>, "
+"<classname>byte[] </classname> et le type serialisable seront persistés
dans "
+"un Blob."
+
+#. Tag: programlisting
+#: entity.xml:206
+#, no-c-format
+msgid ""
+"@Lob\n"
+"public String getFullText() {\n"
+" return fullText;\n"
+"}\n"
+"\n"
+"@Lob \n"
+"public byte[] getFullCode() {\n"
+" return fullCode;\n"
+"}"
+msgstr ""
+"@Lob\n"
+"public String getFullText() {\n"
+" return fullText;\n"
+"}\n"
+"\n"
+"@Lob \n"
+"public byte[] getFullCode() {\n"
+" return fullCode;\n"
+"}"
+
+#. Tag: para
+#: entity.xml:208
+#, no-c-format
+msgid ""
+"If the property type implements
<classname>java.io.Serializable</classname> "
+"and is not a basic type, and if the property is not annotated with "
+"<literal>@Lob</literal>, then the Hibernate
<literal>serializable</literal> "
+"type is used."
+msgstr ""
+"Si le type de propriété implémente
<classname>java.io.Serializable</"
+"classname> et n'est pas un type de base, et si la propriété n'est pas
"
+"annotée par <literal>@Lob</literal>, alors le type Hibernate "
+"<literal>serializable</literal> sera utilisé."
+
+#. Tag: title
+#: entity.xml:216
+#, no-c-format
+msgid "Declaring column attributes"
+msgstr "Déclaration des attributs de colonnes"
+
+#. Tag: para
+#: entity.xml:218
+#, no-c-format
+msgid ""
+"The column(s) used for a property mapping can be defined using the "
+"<literal>@Column</literal> annotation. Use it to override default
values "
+"(see the EJB3 specification for more information on the defaults). You can "
+"use this annotation at the property level for properties that are:"
+msgstr ""
+"Toute colonne utilisée pour un mappage de propriété peut être définie en "
+"utilisant l'annotation <literal>@Column</literal>. Utilisez-là pour
"
+"surcharger les valeurs par défaut (voir la spécification EJB3 pour plus "
+"d'informations sur les valeurs par défaut). Vous pouvez utiliser cette "
+"annotation au niveau propriété, pour celles qui sont :"
+
+#. Tag: para
+#: entity.xml:226
+#, no-c-format
+msgid "not annotated at all"
+msgstr "non-annotées"
+
+#. Tag: para
+#: entity.xml:230
+#, no-c-format
+msgid "annotated with <literal>@Basic</literal>"
+msgstr "annotées avec <literal>@Basic</literal>"
+
+#. Tag: para
+#: entity.xml:234
+#, no-c-format
+msgid "annotated with <literal>@Version</literal>"
+msgstr "annotées avec <literal>@Version</literal>"
+
+#. Tag: para
+#: entity.xml:238
+#, no-c-format
+msgid "annotated with <literal>@Lob</literal>"
+msgstr "annotées avec <literal>@Lob</literal>"
+
+#. Tag: para
+#: entity.xml:242
+#, no-c-format
+msgid "annotated with <literal>@Temporal</literal>"
+msgstr "annotées avec <literal>@Temporal</literal>"
+
+#. Tag: para
+#: entity.xml:246
+#, no-c-format
+msgid ""
+"annotated with
<literal>(a)org.hibernate.annotations.CollectionOfElements</"
+"literal> (for Hibernate only)"
+msgstr ""
+"annotées avec
<literal>(a)org.hibernate.annotations.CollectionOfElements</"
+"literal> (pour Hibernate uniquement)"
+
+#. Tag: programlisting
+#: entity.xml:252
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Flight implements Serializable {\n"
+"...\n"
+"@Column(updatable = false, name = \"flight_name\", nullable = false,
"
+"length=50)\n"
+"public String getName() { ... }"
+msgstr ""
+"@Entity\n"
+"public class Flight implements Serializable {\n"
+"...\n"
+"@Column(updatable = false, name = \"flight_name\", nullable = false,
"
+"length=50)\n"
+"public String getName() { ... }"
+
+#. Tag: para
+#: entity.xml:254
+#, no-c-format
+msgid ""
+"The <literal>name</literal> property is mapped to the
<literal>flight_name</"
+"literal> column, which is not nullable, has a length of 50 and is not "
+"updatable (making the property immutable)."
+msgstr ""
+"La propriété <literal>name</literal> est mappée à la colonne "
+"<literal>flight_name</literal>, que l'on ne peut nullifier, avec
une "
+"longueur de 50 est qui ne peut pas être mise à jour (rendant ainsi la "
+"propriété immutable)."
+
+#. Tag: para
+#: entity.xml:259
+#, no-c-format
+msgid ""
+"This annotation can be applied to regular properties as well as "
+"<literal>@Id</literal> or <literal>@Version</literal>
properties."
+msgstr ""
+"Cette annotation peut s'appliquer à des propriétés habituelles, ainsi qu'Ã
"
+"des propriétés <literal>@Id</literal> ou
<literal>(a)Version</literal>."
+
+#. Tag: programlisting
+#: entity.xml:286
+#, no-c-format
+msgid ""
+"@Column(\n"
+" name=\"columnName\";\n"
+" boolean unique() default false;\n"
+" boolean nullable() default true;\n"
+" boolean insertable() default true;\n"
+" boolean updatable() default true;\n"
+" String columnDefinition() default \"\";\n"
+" String table() default \"\";\n"
+" int length() default 255;\n"
+" int precision() default 0; // decimal precision\n"
+" int scale() default 0; // decimal scale"
+msgstr ""
+"@Column(\n"
+" name=\"columnName\";\n"
+" boolean unique() default false;\n"
+" boolean nullable() default true;\n"
+" boolean insertable() default true;\n"
+" boolean updatable() default true;\n"
+" String columnDefinition() default \"\";\n"
+" String table() default \"\";\n"
+" int length() default 255;\n"
+" int precision() default 0; // decimal precision\n"
+" int scale() default 0; // decimal scale"
+
+#. Tag: para
+#: entity.xml:290
+#, no-c-format
+msgid ""
+"<literal>name</literal> (optional): the column name (default to the
property "
+"name)"
+msgstr ""
+"<literal>name</literal> (optionnel) : le nom de colonne (nom de
propriété "
+"par défaut)"
+
+#. Tag: para
+#: entity.xml:295
+#, no-c-format
+msgid ""
+"<literal>unique</literal> (optional): set a unique constraint on this
column "
+"or not (default false)"
+msgstr ""
+"<literal>unique</literal> (optionnel): configure une contrainte unique
à "
+"cette colonne ou non (avec false par défaut)"
+
+#. Tag: para
+#: entity.xml:300
+#, no-c-format
+msgid ""
+"<literal>nullable</literal> (optional): set the column as nullable
(default "
+"true)."
+msgstr ""
+"<literal>nullable</literal> (optionnel): configure la colonne en tant
"
+"qu'annulable (avec false par défaut). "
+
+#. Tag: para
+#: entity.xml:305
+#, no-c-format
+msgid ""
+"<literal>insertable</literal> (optional): whether or not the column
will be "
+"part of the insert statement (default true)"
+msgstr ""
+"<literal>insertable</literal> (optionnel): si la colonne fait ou non
partie "
+"de l'énoncé d'insertion (true par défaut)"
+
+#. Tag: para
+#: entity.xml:311
+#, no-c-format
+msgid ""
+"<literal>updatable</literal> (optional): whether or not the column will
be "
+"part of the update statement (default true)"
+msgstr ""
+"<literal>updatable</literal> (optionnel): si la colonne fait ou non
partie "
+"de l'énoncé mis à jour (true par défaut)"
+
+#. Tag: para
+#: entity.xml:317
+#, no-c-format
+msgid ""
+"<literal>columnDefinition</literal> (optional): override the sql DDL
"
+"fragment for this particular column (non portable)"
+msgstr ""
+"<literal>columnDefinition</literal> (optionnel): surcharge le fragment
sql "
+"DDL pour cette colonne en particulier (non portable)"
+
+#. Tag: para
+#: entity.xml:323
+#, no-c-format
+msgid ""
+"<literal>table</literal> (optional): define the targeted table (default
"
+"primary table)"
+msgstr ""
+"<literal>table</literal> (optionnel): definit la table ciblée (table
"
+"primaire par défaut)"
+
+#. Tag: para
+#: entity.xml:328
+#, no-c-format
+msgid ""
+"<literal><literal>length</literal></literal> (optional):
column length "
+"(default 255)"
+msgstr ""
+"<literal><literal>length</literal></literal> (optionnel):
longueur de la "
+"colonne (255 par défaut)"
+
+#. Tag: para
+#: entity.xml:333
+#, no-c-format
+msgid ""
+"<literal><literal>precision</literal></literal> (optional):
column decimal "
+"precision (default 0)"
+msgstr ""
+"<literal><literal>precision</literal></literal>
(optionnel): précision "
+"décimale pour la colonne (0 par défaut)"
+
+#. Tag: para
+#: entity.xml:338
+#, no-c-format
+msgid ""
+"<literal><literal>scale</literal></literal> (optional):
column decimal scale "
+"if useful (default 0)"
+msgstr ""
+"<literal><literal>scale</literal></literal> (optionnel):
échelle de colonne "
+"décimale si c'est utile (0 par défaut)"
+
+#. Tag: title
+#: entity.xml:346
+#, no-c-format
+msgid "Embedded objects (aka components)"
+msgstr "Objets imbriqués (alias composants)"
+
+#. Tag: para
+#: entity.xml:348
+#, no-c-format
+msgid ""
+"It is possible to declare an embedded component inside an entity and even "
+"override its column mapping. Component classes have to be annotated at the "
+"class level with the <literal>@Embeddable</literal> annotation. It is
"
+"possible to override the column mapping of an embedded object for a "
+"particular entity using the <literal>@Embedded</literal> and "
+"<literal>@AttributeOverride</literal> annotation in the associated
property:"
+msgstr ""
+"Il est possible de déclarer un composant inbriqué à l'intérieur d'une
entité "
+"ou de surcharger son mappage de colonne. Les classes de composants ont été "
+"annotées au niveau de la classe par l'annotation
<literal>@Embeddable</"
+"literal>. Il est possible de surcharger le mappage de la colonne d'un objet
"
+"imbriqué pour une entité donnée en utilisant les annotations "
+"<literal>@Embedded</literal> et
<literal>@AttributeOverride</literal> pour "
+"la propriété associée :"
+
+#. Tag: programlisting
+#: entity.xml:356
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Person implements Serializable {\n"
+"\n"
+" // Persistent component using defaults\n"
+" Address homeAddress;\n"
+"\n"
+" @Embedded\n"
+" @AttributeOverrides( {\n"
+" @AttributeOverride(name=\"iso2\", column =
@Column(name="
+"\"bornIso2\") ),\n"
+" @AttributeOverride(name=\"name\", column =
@Column(name="
+"\"bornCountryName\") )\n"
+" } )\n"
+" Country bornIn;\n"
+" ...\n"
+"}"
+msgstr ""
+"@Entity\n"
+"public class Person implements Serializable {\n"
+"\n"
+" // Persistent component using defaults\n"
+" Address homeAddress;\n"
+"\n"
+" @Embedded\n"
+" @AttributeOverrides( {\n"
+" @AttributeOverride(name=\"iso2\", column =
@Column(name="
+"\"bornIso2\") ),\n"
+" @AttributeOverride(name=\"name\", column =
@Column(name="
+"\"bornCountryName\") )\n"
+" } )\n"
+" Country bornIn;\n"
+" ...\n"
+"}"
+
+#. Tag: programlisting
+#: entity.xml:358
+#, no-c-format
+msgid ""
+"@Embeddable\n"
+"public class Address implements Serializable {\n"
+" String city;\n"
+" Country nationality; //no overriding here\n"
+"}"
+msgstr ""
+"@Embeddable\n"
+"public class Address implements Serializable {\n"
+" String city;\n"
+" Country nationality; //no overriding here\n"
+"}"
+
+#. Tag: programlisting
+#: entity.xml:360
+#, no-c-format
+msgid ""
+"@Embeddable\n"
+"public class Country implements Serializable {\n"
+" private String iso2;\n"
+" @Column(name=\"countryName\") private String name;\n"
+"\n"
+" public String getIso2() { return iso2; }\n"
+" public void setIso2(String iso2) { this.iso2 = iso2; }\n"
+"\n"
+" \n"
+" public String getName() { return name; }\n"
+" public void setName(String name) { this.name = name; }\n"
+" ...\n"
+"}"
+msgstr ""
+"@Embeddable\n"
+"public class Country implements Serializable {\n"
+" private String iso2;\n"
+" @Column(name=\"countryName\") private String name;\n"
+"\n"
+" public String getIso2() { return iso2; }\n"
+" public void setIso2(String iso2) { this.iso2 = iso2; }\n"
+"\n"
+" \n"
+" public String getName() { return name; }\n"
+" public void setName(String name) { this.name = name; }\n"
+" ...\n"
+"}"
+
+#. Tag: para
+#: entity.xml:362
+#, no-c-format
+msgid ""
+"A embeddable object inherit the access type of its owning entity (note that "
+"you can override that using the Hibernate specific
<literal>@AccessType</"
+"literal> annotations (see <xref
linkend=\"entity-hibspec\"/>)."
+msgstr ""
+"Un objet imbriqué hérite le type d'accès de son entité de propriété (notez
"
+"bien que vous pouvez le surcharger en utilisant les annotations spécifiques "
+"Hibernate <literal>@AccessType</literal> (voir ).
<xref
linkend=\"entity-hibspec\"/>"
+
+#. Tag: para
+#: entity.xml:367
+#, no-c-format
+msgid ""
+"The <literal>Person</literal> entity bean has two component properties,
"
+"<literal>homeAddress</literal> and
<literal>bornIn</literal>. "
+"<literal>homeAddress</literal> property has not been annotated, but
"
+"Hibernate will guess that it is a persistent component by looking for the "
+"<literal>@Embeddable</literal> annotation in the Address class. We also
"
+"override the mapping of a column name (to
<literal>bornCountryName</"
+"literal>) with the <literal>@Embedded</literal> and "
+"<literal>@AttributeOverride </literal>annotations for each mapped
attribute "
+"of <literal>Country</literal>. As you can see, <literal>Country
</literal>is "
+"also a nested component of <literal>Address</literal>, again using
auto-"
+"detection by Hibernate and EJB3 defaults. Overriding columns of embedded "
+"objects of embedded objects is currently not supported in the EJB3 spec, "
+"however, Hibernate Annotations supports it through dotted expressions."
+msgstr ""
+"Le bean d'entité <literal>Person</literal> comprend deux propriétés
de "
+"composant, <literal>homeAddress</literal> et
<literal>bornIn</literal>. La "
+"propriété <literal>homeAddress</literal> n'a pas été annotée, mais
Hibernate "
+"va pouvoir deviner que c'est un composant persistant, en vérifiant "
+"l'annotation <literal>@Embeddable</literal> dans la classe Address.
On "
+"surcharge également le mappage du nom de colonne
(<literal>bornCountryName</"
+"literal>) avec les annotations <literal>@Embedded</literal> et
"
+"<literal>@AttributeOverride </literal> pour chaque attribut mappé de
"
+"<literal>Country</literal>. Comme vous pouvez le voir,
<literal>Country </"
+"literal> est également un composant imbriqué
d'<literal>Address</literal>, "
+"utilisant à nouveau la détection par les valeurs par défaut d'EJB3 et "
+"d'Hibernate. Surcharger les colonnes d'objets imbriqués, n'est pas
"
+"actuellement supporté par les spec EJB3, en revanche, Hibernate Annotations "
+"les supporte par les expressions en pointillés."
+
+#. Tag: programlisting
+#: entity.xml:383
+#, no-c-format
+msgid ""
+"@Embedded\n"
+" @AttributeOverrides( {\n"
+" @AttributeOverride(name=\"city\", column =
@Column(name="
+"\"fld_city\") ),\n"
+" @AttributeOverride(name=\"<emphasis
role=\"bold\">nationality."
+"iso2</emphasis>\", column = @Column(name=\"nat_Iso2\")
),\n"
+" @AttributeOverride(name=\"<emphasis
role=\"bold\">nationality."
+"name</emphasis>\", column = @Column(name=\"nat_CountryName\")
)\n"
+" //nationality columns in homeAddress are overridden\n"
+" } )\n"
+" Address homeAddress;"
+msgstr ""
+"@Embedded\n"
+" @AttributeOverrides( {\n"
+" @AttributeOverride(name=\"city\", column =
@Column(name="
+"\"fld_city\") ),\n"
+" @AttributeOverride(name=\"<emphasis
role=\"bold\">nationality."
+"iso2</emphasis>\", column = @Column(name=\"nat_Iso2\")
),\n"
+" @AttributeOverride(name=\"<emphasis
role=\"bold\">nationality."
+"name</emphasis>\", column = @Column(name=\"nat_CountryName\")
)\n"
+" //nationality columns in homeAddress are overridden\n"
+" } )\n"
+" Address homeAddress;"
+
+#. Tag: para
+#: entity.xml:383
+#, no-c-format
+msgid ""
+"Hibernate Annotations supports one more feature that is not explicitly "
+"supported by the EJB3 specification. You can annotate a embedded object with
"
+"the <literal>@MappedSuperclass</literal> annotation to make the
superclass "
+"properties persistent (see <literal>@MappedSuperclass</literal> for
more "
+"informations)."
+msgstr ""
+"Hibernate Annotations prend en charge plus d'une fonctionnalité qui n'est
"
+"pas explicitement supportée par les spécifications EJB3. Vous pouvez annoter
"
+"un objet imbriqué avec l'annotation
<literal>@MappedSuperclass</literal> "
+"pour rendre les propriétés de superclasses persistantes (voir "
+"<literal>@MappedSUperclass</literal> pour plus
d'informations)."
+
+#. Tag: para
+#: entity.xml:390
+#, no-c-format
+msgid ""
+"While not supported by the EJB3 specification, Hibernate Annotations allows "
+"you to use association annotations in an embeddable object (ie "
+"<literal>@*ToOne</literal> nor
<literal>@*ToMany</literal>). To override the "
+"association columns you can use
<literal>(a)AssociationOverride</literal>."
+msgstr ""
+"Malgré qu'elles ne soient pas prises en charge par les spécifications EJB3,
"
+"Hibernate Annotations vous permettent d'utiliser des annotations "
+"d'association dans un objet imbriquable (c'est à dire
<literal>@*ToOne</"
+"literal> ni <literal>@*ToMany</literal>). Pour surcharger les
colonnes "
+"d'association, vous pouvez utiliser
<literal>(a)AssociationOverride</literal>."
+
+#. Tag: para
+#: entity.xml:396
+#, no-c-format
+msgid ""
+"If you want to have the same embeddable object type twice in the same "
+"entity, the column name defaulting will not work: at least one of the "
+"columns will have to be explicit. Hibernate goes beyond the EJB3 spec and "
+"allows you to enhance the defaulting mechanism through the "
+"<classname>NamingStrategy</classname>. "
+"<classname>DefaultComponentSafeNamingStrategy</classname> is a small
"
+"improvement over the default EJB3NamingStrategy that allows embedded objects
"
+"to be defaulted even if used twice in the same entity."
+msgstr ""
+"Si vous souhaitez avoir le même type d'objet imbriquable deux fois dans la
"
+"même entité, le système par défaut au niveau des colonnes ne fonctionnera "
+"pas : une des colonnes au moins devra être explicite. Hibernate va au delà "
+"des spec EJB3 et vous permet d'améliorer le mécanisme qui opère par défaut
"
+"par l'intermédiaire de <classname>NamingStrategy</classname>.
"
+"<classname>DefaultComponentSafeNamingStrategy</classname> est une
petite "
+"amélioration par rapport à EJB3NamingStrategy (défaut), qui permet à des "
+"objets imbriqués d'être utilisés par défaut, même s'ils ont été utilisés
par "
+"deux fois au sein de la même entité."
+
+#. Tag: title
+#: entity.xml:407
+#, no-c-format
+msgid "Non-annotated property defaults"
+msgstr "Valeurs par défaut des propriétés non-annotées"
+
+#. Tag: para
+#: entity.xml:409
+#, no-c-format
+msgid "If a property is not annotated, the following rules apply:"
+msgstr "Si une propriété n'est pas annotée, les règles suivantes
s'appliquent :"
+
+#. Tag: para
+#: entity.xml:414
+#, no-c-format
+msgid "If the property is of a single type, it is mapped as @Basic"
+msgstr "Si la propriété est d'un seul type, elle sera mappée en tant que
@Basic"
+
+#. Tag: para
+#: entity.xml:420
+#, no-c-format
+msgid ""
+"Otherwise, if the type of the property is annotated as @Embeddable, it is "
+"mapped as @Embedded"
+msgstr ""
+"Sinon, si le type de propriété est annoté en tant que @Embeddable, il sera "
+"mappé @Embedded"
+
+#. Tag: para
+#: entity.xml:426
+#, no-c-format
+msgid ""
+"Otherwise, if the type of the property is Serializable, it is mapped as "
+"@Basic in a column holding the object in its serialized version"
+msgstr ""
+"Sinon, si le type de la propriété est Serializable, il sera mappé en tant "
+"que @Basic dans une colonne qui contient l'objet dans sa version "
+"sérialisable."
+
+#. Tag: para
+#: entity.xml:432
+#, no-c-format
+msgid ""
+"Otherwise, if the type of the property is java.sql.Clob or java.sql.Blob, it
"
+"is mapped as @Lob with the appropriate LobType"
+msgstr ""
+"Sinon, si le type de propriété est java.sql.Clob ou java.sql.Blob, il sera "
+"mappé en tant que @Lob avec le LobType qui convient"
+
+#. Tag: title
+#: entity.xml:441
+#, no-c-format
+msgid "Mapping identifier properties"
+msgstr "Les propriétés d'identificateurs de mappage"
+
+#. Tag: para
+#: entity.xml:443
+#, no-c-format
+msgid ""
+"The <literal>@Id</literal> annotation lets you define which property is
the "
+"identifier of your entity bean. This property can be set by the application "
+"itself or be generated by Hibernate (preferred). You can define the "
+"identifier generation strategy thanks to the
<literal>@GeneratedValue</"
+"literal> annotation:"
+msgstr ""
+"L'annotation <literal>@Id</literal> vous laisse définir quelle
propriété "
+"correspond à l'identificateur de votre entité bean. Cette propriété peut
"
+"être déterminée par l'application elle-même, ou bien être générée par "
+"Hibernate (c'est mieux). Vous pouvez déterminer la stratégie de génération
"
+"de l'identificateur grâce à l'annotation
<literal>@GeneratedValue</literal> :"
+
+#. Tag: para
+#: entity.xml:451
+#, no-c-format
+msgid ""
+"AUTO - either identity column, sequence or table depending on the underlying
"
+"DB"
+msgstr ""
+"AUTO - soit une colonne d'identité, une séquence ou une table relative au DB
"
+"sous-jacent."
+
+#. Tag: para
+#: entity.xml:457
+#, no-c-format
+msgid "TABLE - table holding the id"
+msgstr "TABLE - table contenant l'id"
+
+#. Tag: para
+#: entity.xml:463
+#, no-c-format
+msgid "IDENTITY - identity column"
+msgstr "IDENTITY - colonne d'identité"
+
+#. Tag: para
+#: entity.xml:469
+#, no-c-format
+msgid "SEQUENCE - sequence"
+msgstr "SEQUENCE - sequence"
+
+#. Tag: para
+#: entity.xml:475
+#, no-c-format
+msgid ""
+"Hibernate provides more id generators than the basic EJB3 ones. Check <xref
"
+"linkend=\"entity-hibspec\"/> for more informations."
+msgstr ""
+"Hibernate fournit davantage de générateurs d'id que ceux des EJB de base.
"
+"Vérifier <xref linkend=\"entity-hibspec\"/> "
+"pour davantage d'informations."
+
+#. Tag: para
+#: entity.xml:478
+#, no-c-format
+msgid ""
+"The following example shows a sequence generator using the SEQ_STORE "
+"configuration (see below)"
+msgstr ""
+"L'exemple suivant montre un générateur de séquences utilisant la "
+"configuration SEQ_STORE (voir ci-dessous)"
+
+#. Tag: programlisting
+#: entity.xml:481
+#, no-c-format
+msgid ""
+"@Id @GeneratedValue(strategy=GenerationType.SEQUENCE,
generator=\"SEQ_STORE"
+"\")\n"
+"public Integer getId() { ... }"
+msgstr ""
+"@Id @GeneratedValue(strategy=GenerationType.SEQUENCE,
generator=\"SEQ_STORE"
+"\")\n"
+"public Integer getId() { ... }"
+
+#. Tag: para
+#: entity.xml:483
+#, no-c-format
+msgid "The next example uses the identity generator:"
+msgstr "L'exemple suivant utilise le générateur d'identité :"
+
+#. Tag: programlisting
+#: entity.xml:485
+#, no-c-format
+msgid ""
+"@Id @GeneratedValue(strategy=GenerationType.IDENTITY)\n"
+"public Long getId() { ... }"
+msgstr ""
+"@Id @GeneratedValue(strategy=GenerationType.IDENTITY)\n"
+"public Long getId() { ... }"
+
+#. Tag: para
+#: entity.xml:487
+#, no-c-format
+msgid ""
+"The <literal>AUTO</literal> generator is the preferred type for
portable "
+"applications (across several DB vendors). The identifier generation "
+"configuration can be shared for several <literal>@Id</literal> mappings
with "
+"the generator attribute. There are several configurations available through "
+"<literal>@SequenceGenerator</literal> and
<literal>@TableGenerator</"
+"literal>. The scope of a generator can be the application or the class. "
+"Class-defined generators are not visible outside the class and can override "
+"application level generators. Application level generators are defined at "
+"XML level (see <xref linkend=\"xml-overriding\"/>):"
+msgstr ""
+"Le générateur <literal>AUTO</literal> est le type préféré pour les
"
+"applications portables (pour de nombreux distributeurs de DB). La "
+"configuration de la génération de l'identificateur peut être partagée par
"
+"plusieurs mappages <literal>@Id</literal> possédant l'attribut
générateur. "
+"Il existe plusieurs configurations disponibles dans "
+"<literal>@SequenceGenerator</literal> et
<literal>@TableGenerator</literal>. "
+"La portée du générateur peut être l'application ou la classe. Les "
+"générateurs définis par leur classe ne sont pas visibles en dehors de la "
+"classe et peuvent surcharger les générateurs de niveau d'application. Les
"
+"générateurs de niveau d'application sont définis au niveau XML (voir <xref
linkend=\"xml-overriding\"/>) :"
+
+#. Tag: programlisting
+#: entity.xml:499
+#, no-c-format
+msgid ""
+"<table-generator name=\"EMP_GEN\"\n"
+" table=\"GENERATOR_TABLE\"\n"
+" pk-column-name=\"key\"\n"
+" value-column-name=\"hi\"\n"
+" pk-column-value=\"EMP\"\n"
+" allocation-size=\"20\"/>\n"
+"\n"
+"//and the annotation equivalent\n"
+"\n"
+"(a)javax.persistence.TableGenerator(\n"
+" name=\"EMP_GEN\",\n"
+" table=\"GENERATOR_TABLE\",\n"
+" pkColumnName = \"key\",\n"
+" valueColumnName = \"hi\"\n"
+" pkColumnValue=\"EMP\",\n"
+" allocationSize=20\n"
+")\n"
+"\n"
+"<sequence-generator name=\"SEQ_GEN\" \n"
+" sequence-name=\"my_sequence\"\n"
+" allocation-size=\"20\"/>\n"
+"\n"
+"//and the annotation equivalent\n"
+"\n"
+"(a)javax.persistence.SequenceGenerator(\n"
+" name=\"SEQ_GEN\",\n"
+" sequenceName=\"my_sequence\",\n"
+" allocationSize=20\n"
+")"
+msgstr ""
+"<table-generator name=\"EMP_GEN\"\n"
+" table=\"GENERATOR_TABLE\"\n"
+" pk-column-name=\"key\"\n"
+" value-column-name=\"hi\"\n"
+" pk-column-value=\"EMP\"\n"
+" allocation-size=\"20\"/>\n"
+"\n"
+"//and the annotation equivalent\n"
+"\n"
+"(a)javax.persistence.TableGenerator(\n"
+" name=\"EMP_GEN\",\n"
+" table=\"GENERATOR_TABLE\",\n"
+" pkColumnName = \"key\",\n"
+" valueColumnName = \"hi\"\n"
+" pkColumnValue=\"EMP\",\n"
+" allocationSize=20\n"
+")\n"
+"\n"
+"<sequence-generator name=\"SEQ_GEN\" \n"
+" sequence-name=\"my_sequence\"\n"
+" allocation-size=\"20\"/>\n"
+"\n"
+"//and the annotation equivalent\n"
+"\n"
+"(a)javax.persistence.SequenceGenerator(\n"
+" name=\"SEQ_GEN\",\n"
+" sequenceName=\"my_sequence\",\n"
+" allocationSize=20\n"
+")"
+
+#. Tag: para
+#: entity.xml:501
+#, no-c-format
+msgid ""
+"If JPA XML (like <filename>META-INF/orm.xml</filename>) is used to
define "
+"thegenerators, <literal>EMP_GEN</literal> and
<literal>SEQ_GEN</literal> are "
+"application level generators. <literal>EMP_GEN</literal> defines a
table "
+"based id generator using the hilo algorithm with a
<literal>max_lo</literal> "
+"of 20. The hi value is kept in a <literal>table</literal> "
+"\"<literal>GENERATOR_TABLE</literal>\". The information is
kept in a row "
+"where <literal>pkColumnName</literal> \"key\" is equals to
"
+"<literal>pkColumnValue</literal>
\"<literal>EMP</literal>\" and column "
+"<literal>valueColumnName</literal>
\"<literal>hi</literal>\" contains the "
+"the next high value used."
+msgstr ""
+"Si JPA XML (comme <filename>META-INF/orm.xml</filename>) est utilisé
pour "
+"définir les générateurs, <literal>EMP_GEN</literal> et
<literal>SEQ_GEN</"
+"literal> représentent des générateurs au niveau application. "
+"<literal>EMP_GEN</literal> définit un générateur d'id basé table,
en "
+"utilisant un algorithme hilo comprenant un <literal>max_lo</literal> de
20. "
+"La valeur hi (haute valeur) est contenue dans une
<literal>table</literal> "
+"\"<literal>GENERATOR_TABLE</literal>\". L'information est
gardée dans une "
+"rangée dans laquelle la clé <literal>pkColumnName</literal>
\"key\" est "
+"égale à <literal>pkColumnValue</literal>
\"<literal>EMP</literal>\" et la "
+"colonne <literal>valueColumnName</literal>
\"<literal>hi</literal>\" "
+"contient la prochaine haute valeur utilisée."
+
+#. Tag: para
+#: entity.xml:512
+#, no-c-format
+msgid ""
+"<literal>SEQ_GEN</literal> defines a sequence generator using a
sequence "
+"named <literal>my_sequence</literal>. The allocation size used for this
"
+"sequence based hilo algorithm is 20. Note that this version of Hibernate "
+"Annotations does not handle <literal>initialValue</literal> in the
sequence "
+"generator. The default allocation size is 50, so if you want to use a "
+"sequence and pickup the value each time, you must set the allocation size to
"
+"1."
+msgstr ""
+"<literal>SEQ_GEN</literal> définit un générateur de séquences en
utilisant "
+"une séquence qui s'intitule <literal>my_sequence</literal>. La
taille "
+"d'allocation utilisée pour cette séquence basée sur l'algorithme hilo est
"
+"20. Notez que cette version d'Hibernate Annotations ne gère pas "
+"<literal>initialValue</literal> dans le générateur de séquences. La
taille "
+"d'allocation par défaut est de 50, donc, si vous souhaitez utiliser une "
+"séquence et choisir la valeur à chaque fois, vous devrez paramétrer la "
+"taille de l'allocation à 1."
+
+#. Tag: para
+#: entity.xml:521
+#, no-c-format
+msgid ""
+"Package level definition is no longer supported by the EJB 3.0 "
+"specification. However, you can use the
<literal>@GenericGenerator</literal> "
+"at the package level (see <xref
linkend=\"entity-hibspec-identifier\"/>)."
+msgstr ""
+"La définition du niveau de package n'est plus prise en charge par la "
+"spécification EJB 3.0. Cependant, vous pouvez utiliser "
+"<literal>@GenericGenerator</literal> au niveau package (voir <xref
linkend=\"entity-hibspec-identifier\"/>)."
+
+#. Tag: para
+#: entity.xml:527
+#, no-c-format
+msgid ""
+"The next example shows the definition of a sequence generator in a class "
+"scope:"
+msgstr ""
+"Le prochain exemple montre la définition d'un générateur de séquences dans
"
+"une portée de classe :"
+
+#. Tag: programlisting
+#: entity.xml:530
+#, no-c-format
+msgid ""
+"@Entity\n"
+"(a)javax.persistence.SequenceGenerator(\n"
+" name=\"SEQ_STORE\",\n"
+" sequenceName=\"my_sequence\"\n"
+")\n"
+"public class Store implements Serializable {\n"
+" private Long id;\n"
+"\n"
+" @Id @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="
+"\"SEQ_STORE\")\n"
+" public Long getId() { return id; }\n"
+"}"
+msgstr ""
+"@Entity\n"
+"(a)javax.persistence.SequenceGenerator(\n"
+" name=\"SEQ_STORE\",\n"
+" sequenceName=\"my_sequence\"\n"
+")\n"
+"public class Store implements Serializable {\n"
+" private Long id;\n"
+"\n"
+" @Id @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="
+"\"SEQ_STORE\")\n"
+" public Long getId() { return id; }\n"
+"}"
+
+#. Tag: para
+#: entity.xml:532
+#, no-c-format
+msgid ""
+"This class will use a sequence named my_sequence and the SEQ_STORE generator
"
+"is not visible in other classes. Note that you can check the Hibernate "
+"Annotations tests in the
<package>org.hibernate.test.annotations.id</"
+"package> package for more examples."
+msgstr ""
+"Cette classe va utiliser une séquence qui s'intitule my_sequence et le "
+"générateur SEQ_STORE ne sera pas visible dans les autres classes. Veuillez "
+"noter que vous pourrez vérifier les tests d'Hibernate Annotations dans le
"
+"package <package>org.hibernate.test.metadata.id</package> pour y
trouver des exemples "
+"supplémentaires."
+
+#. Tag: para
+#: entity.xml:538
+#, no-c-format
+msgid "You can define a composite primary key through several syntaxes:"
+msgstr "Vous pouvez définir une clé primaire composite par plusieurs syntaxes
:"
+
+#. Tag: para
+#: entity.xml:543
+#, no-c-format
+msgid ""
+"annotate the component property as @Id and make the component class "
+"@Embeddable"
+msgstr ""
+"en annotant la propriété de composant avec @ld et en rendant la classe du "
+"composant @Embeddable"
+
+#. Tag: para
+#: entity.xml:549
+#, no-c-format
+msgid "annotate the component property as @EmbeddedId"
+msgstr "en annotant la propriété du composant avec @Embeddedld"
+
+#. Tag: para
+#: entity.xml:555
+#, no-c-format
+msgid ""
+"annotate the class as @IdClass and annotate each property of the entity "
+"involved in the primary key with @Id"
+msgstr ""
+"en annotant la claase avec @ldClass et en annotant chaque propriété de "
+"l'entité impliquée dans la clé primaire avec @ld"
+
+#. Tag: para
+#: entity.xml:561
+#, no-c-format
+msgid ""
+"While quite common to the EJB2 developer, <literal>@IdClass</literal>
is "
+"likely new for Hibernate users. The composite primary key class corresponds "
+"to multiple fields or properties of the entity class, and the names of "
+"primary key fields or properties in the primary key class and those of the "
+"entity class must match and their types must be the same. Let's look at an
"
+"example:"
+msgstr ""
+"Malgré qu'il soit assez commun pour les développeur EJB2,
<literal>@IdClass</"
+"literal> est souvent nouveau pour les utilisateur Hibernate. La classe de
"
+"clé primaire composite correspond à plusieurs champs ou propriétés de la "
+"classe de l'entité, et les noms des champs de clés primaires ou les "
+"propriétés dans la classe de clé primaire ou ceux de la classe de l'entité
"
+"doivent correspondre et doivent être du même type. Observons un exemple : "
+
+#. Tag: programlisting
+#: entity.xml:568
+#, no-c-format
+msgid ""
+"@Entity\n"
+"<emphasis
role=\"bold\">(a)IdClass(FootballerPk.class)</emphasis>\n"
+"public class Footballer {\n"
+" //part of the id key\n"
+" <emphasis role=\"bold\">@Id</emphasis> public String
getFirstname() {\n"
+" return firstname;\n"
+" }\n"
+"\n"
+" public void setFirstname(String firstname) {\n"
+" this.firstname = firstname;\n"
+" }\n"
+"\n"
+" //part of the id key\n"
+" <emphasis role=\"bold\">@Id</emphasis> public String
getLastname() {\n"
+" return lastname;\n"
+" }\n"
+"\n"
+" public void setLastname(String lastname) {\n"
+" this.lastname = lastname;\n"
+" }\n"
+"\n"
+" public String getClub() {\n"
+" return club;\n"
+" }\n"
+"\n"
+" public void setClub(String club) {\n"
+" this.club = club;\n"
+" }\n"
+"\n"
+" //appropriate equals() and hashCode() implementation\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"public class FootballerPk implements Serializable {\n"
+" //same name and type as in Footballer\n"
+" public String getFirstname() {\n"
+" return firstname;\n"
+" }\n"
+"\n"
+" public void setFirstname(String firstname) {\n"
+" this.firstname = firstname;\n"
+" }\n"
+"\n"
+" //same name and type as in Footballer\n"
+" public String getLastname() {\n"
+" return lastname;\n"
+" }\n"
+"\n"
+" public void setLastname(String lastname) {\n"
+" this.lastname = lastname;\n"
+" }\n"
+"\n"
+" //appropriate equals() and hashCode() implementation\n"
+"}"
+msgstr ""
+"@Entity\n"
+"<emphasis
role=\"bold\">(a)IdClass(FootballerPk.class)</emphasis>\n"
+"public class Footballer {\n"
+" //part of the id key\n"
+" <emphasis role=\"bold\">@Id</emphasis> public String
getFirstname() {\n"
+" return firstname;\n"
+" }\n"
+"\n"
+" public void setFirstname(String firstname) {\n"
+" this.firstname = firstname;\n"
+" }\n"
+"\n"
+" //part of the id key\n"
+" <emphasis role=\"bold\">@Id</emphasis> public String
getLastname() {\n"
+" return lastname;\n"
+" }\n"
+"\n"
+" public void setLastname(String lastname) {\n"
+" this.lastname = lastname;\n"
+" }\n"
+"\n"
+" public String getClub() {\n"
+" return club;\n"
+" }\n"
+"\n"
+" public void setClub(String club) {\n"
+" this.club = club;\n"
+" }\n"
+"\n"
+" //appropriate equals() and hashCode() implementation\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"public class FootballerPk implements Serializable {\n"
+" //same name and type as in Footballer\n"
+" public String getFirstname() {\n"
+" return firstname;\n"
+" }\n"
+"\n"
+" public void setFirstname(String firstname) {\n"
+" this.firstname = firstname;\n"
+" }\n"
+"\n"
+" //same name and type as in Footballer\n"
+" public String getLastname() {\n"
+" return lastname;\n"
+" }\n"
+"\n"
+" public void setLastname(String lastname) {\n"
+" this.lastname = lastname;\n"
+" }\n"
+"\n"
+" //appropriate equals() and hashCode() implementation\n"
+"}"
+
+#. Tag: para
+#: entity.xml:570
+#, no-c-format
+msgid ""
+"As you may have seen, <literal>@IdClass</literal> points to the "
+"corresponding primary key class."
+msgstr ""
+"Comme vous avez pu voir, <literal>@IdClass</literal> pointe vers la
classe "
+"de clé primaire correspondante."
+
+#. Tag: para
+#: entity.xml:573
+#, no-c-format
+msgid ""
+"While not supported by the EJB3 specification, Hibernate allows you to "
+"define associations inside a composite identifier. Simply use the regular "
+"annotations for that"
+msgstr ""
+"Malgré qu'il ne soit pas pris en charge par la spécification EJB3, Hibernate
"
+"vous permet de définir des associations à l'intérieur d'un identificateur
"
+"composite. Utiliser tout simplement les annotations habituelles pour cela"
+
+#. Tag: programlisting
+#: entity.xml:577
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@AssociationOverride( name=\"id.channel\", joinColumns =
@JoinColumn(name="
+"\"chan_id\") )\n"
+"public class TvMagazin {\n"
+" @EmbeddedId public TvMagazinPk id;\n"
+" @Temporal(TemporalType.TIME) Date time;\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"public class TvMagazinPk implements Serializable {\n"
+" @ManyToOne\n"
+" public Channel channel;\n"
+" public String name;\n"
+" @ManyToOne\n"
+" public Presenter presenter;\n"
+"}"
+msgstr ""
+"@Entity\n"
+"@AssociationOverride( name=\"id.channel\", joinColumns =
@JoinColumn(name="
+"\"chan_id\") )\n"
+"public class TvMagazin {\n"
+" @EmbeddedId public TvMagazinPk id;\n"
+" @Temporal(TemporalType.TIME) Date time;\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"public class TvMagazinPk implements Serializable {\n"
+" @ManyToOne\n"
+" public Channel channel;\n"
+" public String name;\n"
+" @ManyToOne\n"
+" public Presenter presenter;\n"
+"}"
+
+#. Tag: title
+#: entity.xml:581
+#, no-c-format
+msgid "Mapping inheritance"
+msgstr "La transmission de données de mappage"
+
+#. Tag: para
+#: entity.xml:583
+#, no-c-format
+msgid "EJB3 supports the three types of inheritance:"
+msgstr "EJB3 prend en charge trois types de transmission de données :"
+
+#. Tag: para
+#: entity.xml:587
+#, no-c-format
+msgid "Table per Class Strategy: the <union-class> element in
Hibernate"
+msgstr ""
+"Table par Class Strategy (stratégie de classe) : l'élément
<union-"
+"class> dans Hibernate"
+
+#. Tag: para
+#: entity.xml:593
+#, no-c-format
+msgid ""
+"Single Table per Class Hierarchy Strategy: the <subclass> element in
"
+"Hibernate"
+msgstr ""
+"Table simple par Class Hierarchy Strategy: l'élément de
<sous-classe> "
+"dans Hibernate"
+
+#. Tag: para
+#: entity.xml:599
+#, no-c-format
+msgid "Joined Subclass Strategy: the <joined-subclass> element in
Hibernate"
+msgstr ""
+"Stratégies de sous-classes jointes : l'élément <joined-subclass>
dans "
+"Hibernate"
+
+#. Tag: para
+#: entity.xml:604
+#, no-c-format
+msgid ""
+"The chosen strategy is declared at the class level of the top level entity "
+"in the hierarchy using the <literal>@Inheritance</literal>
annotation."
+msgstr ""
+"La stratégie choisie est déclarée au niveau de la classe de l'entité de "
+"niveau supérieur dans la hiérarchie en utilisant l'annotation "
+"<literal>(a)Inheritance</literal>."
+
+#. Tag: para
+#: entity.xml:609
+#, no-c-format
+msgid "Annotating interfaces is currently not supported."
+msgstr "L'annotation des interfaces n'est pas actuellement pris en
charge."
+
+#. Tag: title
+#: entity.xml:613
+#, no-c-format
+msgid "Table per class"
+msgstr "Table par classe"
+
+#. Tag: para
+#: entity.xml:615
+#, no-c-format
+msgid ""
+"This strategy has many drawbacks (esp. with polymorphic queries and "
+"associations) explained in the EJB3 spec, the Hibernate reference "
+"documentation, Hibernate in Action, and many other places. Hibernate work "
+"around most of them implementing this strategy using <literal>SQL
UNION</"
+"literal> queries. It is commonly used for the top level of an inheritance
"
+"hierarchy:"
+msgstr ""
+"Cette stratégie comporte plusieurs problèmes ( surtout avec les requêtes et "
+"les associations polymorphiques) qui sont expliquées dans les spec EJB3, la "
+"documentation de référence Hibernate, Hibernate en Action et dans bien "
+"d'autre endroits. Hibernate réussit à contourner le problème dans la plupart
"
+"des cas en implémentant cette stratégie, en utilisant les requêtes "
+"<literal>SQL UNION</literal>. C'est normalement utilisé au niveau
supérieur "
+"d'une hiérarchie d'héritage de transmission :"
+
+#. Tag: programlisting
+#: entity.xml:622
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)\n"
+"public class Flight implements Serializable {"
+msgstr ""
+"@Entity\n"
+"@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)\n"
+"public class Flight implements Serializable {"
+
+#. Tag: para
+#: entity.xml:624
+#, no-c-format
+msgid ""
+"This strategy support one to many associations provided that they are "
+"bidirectional. This strategy does not support the
<literal>IDENTITY</"
+"literal> generator strategy: the id has to be shared across several tables.
"
+"Consequently, when using this strategy, you should not use <literal>AUTO
</"
+"literal>nor <literal>IDENTITY</literal>."
+msgstr ""
+"Cette stratégie supporte les associations one to many, dans la mesure où "
+"elles sont bidirectionnelles. Cette stratégie ne supporte pas la stratégie "
+"de générateur <literal>IDENTITY</literal> : l'id doit être partagée
parmi "
+"plusieurs tables. De ce fait, quand vous utilisez cette stratégie, vous ne "
+"devriez pas utiliser <literal>AUTO </literal>ni
<literal>IDENTITY</literal>."
+
+#. Tag: title
+#: entity.xml:633
+#, no-c-format
+msgid "Single table per class hierarchy"
+msgstr "Tables simples par hiérarchie de classe"
+
+#. Tag: para
+#: entity.xml:635
+#, no-c-format
+msgid ""
+"All properties of all super- and subclasses are mapped into the same table, "
+"instances are distinguished by a special discriminator column:"
+msgstr ""
+"Toutes les propriétés de tous les super- ou sous-classes sont mappées dans "
+"la même table; les instances se distinguent par une colonne de "
+"discrimination spéciale :"
+
+#. Tag: programlisting
+#: entity.xml:639
+#, no-c-format
+msgid ""
+"@Entity\n"
+"(a)Inheritance(strategy=InheritanceType.SINGLE_TABLE)\n"
+"@DiscriminatorColumn(\n"
+" name=\"planetype\",\n"
+" discriminatorType=DiscriminatorType.STRING\n"
+")\n"
+"@DiscriminatorValue(\"Plane\")\n"
+"public class Plane { ... }\n"
+"\n"
+"@Entity\n"
+"@DiscriminatorValue(\"A320\")\n"
+"public class A320 extends Plane { ... }"
+msgstr ""
+"@Entity\n"
+"(a)Inheritance(strategy=InheritanceType.SINGLE_TABLE)\n"
+"@DiscriminatorColumn(\n"
+" name=\"planetype\",\n"
+" discriminatorType=DiscriminatorType.STRING\n"
+")\n"
+"@DiscriminatorValue(\"Plane\")\n"
+"public class Plane { ... }\n"
+"\n"
+"@Entity\n"
+"@DiscriminatorValue(\"A320\")\n"
+"public class A320 extends Plane { ... }"
+
+#. Tag: para
+#: entity.xml:641
+#, no-c-format
+msgid ""
+"<classname>Plane</classname> is the superclass, it defines the
inheritance "
+"strategy <literal>InheritanceType.SINGLE_TABLE</literal>. It also
defines "
+"the discriminator column through the
<literal>@DiscriminatorColumn</literal> "
+"annotation, a discriminator column can also define the discriminator type. "
+"Finally, the <literal>@DiscriminatorValue</literal> annotation defines
the "
+"value used to differentiate a class in the hierarchy. All of these "
+"attributes have sensible default values. The default name of the "
+"discriminator column is <literal>DTYPE</literal>. The default
discriminator "
+"value is the entity name (as defined in
<literal>(a)Entity.name</literal>) for "
+"DiscriminatorType.STRING. <classname>A320</classname> is a subclass;
you "
+"only have to define discriminator value if you don't want to use the default
"
+"value. The strategy and the discriminator type are implicit."
+msgstr ""
+"<classname>Plane</classname> est la superclasse, elle détermine la
stratégie "
+"de transmission de données
<literal>InheritanceType.SINGLE_TABLE</literal>. "
+"Cela détemine également la colonne discriminator par l'annotation "
+"<literal>@DiscriminatorColumn</literal>, une colonne discriminator peut
"
+"également déterminer le type de discriminator. Finalement, l'annotation "
+"<literal>@DiscriminatorValue</literal> détermine la valeur utilisée
pour "
+"différencier une classe dans la hiérarchie. Tous ces attributs ont des "
+"valeurs par défaut raisonnables. Le nom par défaut de la colonne "
+"discriminator est <literal>DTYPE</literal>. La valeur du discriminant
par "
+"défaut est le nom de l'entité (comme définie dans
<literal>(a)Entity.name</"
+"literal>) pour DiscriminatorType.STRING. <classname>A320</classname>
est une "
+"sous-classe; vous n'aurez qu'à déterminer la valeur du discrimant si vous
"
+"souhaitez utiliser la valeur par défaut. La stratéfie et le type de "
+"discriminant sont implicites. "
+
+#. Tag: para
+#: entity.xml:656
+#, no-c-format
+msgid ""
+"<literal>@Inheritance</literal> and
<literal>@DiscriminatorColumn</literal> "
+"should only be defined at the top of the entity hierarchy."
+msgstr ""
+"<literal>@Inheritance</literal> et
<literal>@DiscriminatorColumn</literal> "
+"doivent seulement être définis en haut de la hiérarchie de l'entité."
+
+#. Tag: title
+#: entity.xml:662
+#, no-c-format
+msgid "Joined subclasses"
+msgstr "Sous-classes jointes"
+
+#. Tag: para
+#: entity.xml:664
+#, no-c-format
+msgid ""
+"The<literal> @PrimaryKeyJoinColumn</literal> and "
+"<literal>@PrimaryKeyJoinColumns</literal> annotations define the
primary key"
+"(s) of the joined subclass table:"
+msgstr ""
+"Les annotations <literal> @PrimaryKeyJoinColumn</literal> et "
+"<literal>@PrimaryKeyJoinColumns</literal> définissent la(les) clé(s)
primaire"
+"(s) de la table de sous-classe jointe :"
+
+#. Tag: programlisting
+#: entity.xml:668
+#, no-c-format
+msgid ""
+"@Entity\n"
+"(a)Inheritance(strategy=InheritanceType.JOINED)\n"
+"public class Boat implements Serializable { ... }\n"
+"\n"
+"@Entity\n"
+"public class Ferry extends Boat { ... }\n"
+"\n"
+"@Entity\n"
+"@PrimaryKeyJoinColumn(name=\"BOAT_ID\")\n"
+"public class AmericaCupClass extends Boat { ... }"
+msgstr ""
+"@Entity\n"
+"(a)Inheritance(strategy=InheritanceType.JOINED)\n"
+"public class Boat implements Serializable { ... }\n"
+"\n"
+"@Entity\n"
+"public class Ferry extends Boat { ... }\n"
+"\n"
+"@Entity\n"
+"@PrimaryKeyJoinColumn(name=\"BOAT_ID\")\n"
+"public class AmericaCupClass extends Boat { ... }"
+
+#. Tag: para
+#: entity.xml:670
+#, no-c-format
+msgid ""
+"All of the above entities use the <literal>JOINED</literal> strategy,
the "
+"<literal>Ferry</literal> table is joined with the
<literal>Boat</literal> "
+"table using the same primary key names. The
<literal>AmericaCupClass</"
+"literal> table is joined with <literal>Boat</literal> using the join
"
+"condition <code>Boat.id = AmericaCupClass.BOAT_ID</code>."
+msgstr ""
+"Toutes les entités ci-dessus utilisent la stratégie
<literal>JOINED</"
+"literal>, la table <literal>Ferry</literal> est jointe avec la table
"
+"<literal>Boat</literal>, en utilisant les mêmes noms de clé primaires.
La "
+"table <literal>AmericaCupClass</literal> est jointe avec
<literal>Boat</"
+"literal> en utilisant la condition de jointure <code>Boat.id = "
+"AmericaCupClass.BOAT_ID</code>."
+
+#. Tag: title
+#: entity.xml:679
+#, no-c-format
+msgid "Inherit properties from superclasses"
+msgstr "Hérite les propriétés des superclasses"
+
+#. Tag: para
+#: entity.xml:681
+#, no-c-format
+msgid ""
+"This is sometimes useful to share common properties through a technical or a
"
+"business superclass without including it as a regular mapped entity (ie no "
+"specific table for this entity). For that purpose you can map them as "
+"<literal>(a)MappedSuperclass</literal>."
+msgstr ""
+"Il est utile de partager des propriétés communes à travers une superclasse "
+"commerciale ou technique sans pour autant l'inclure en tant qu'entité
mappée "
+"habituelle (c'est à dire pas de table spécifique pour cette entité). Dans ce
"
+"but, vous pouvez les mapper en tant que
<literal>(a)MappedSuperclass</literal>."
+
+#. Tag: programlisting
+#: entity.xml:686
+#, no-c-format
+msgid ""
+"@MappedSuperclass\n"
+"public class BaseEntity {\n"
+" @Basic\n"
+" @Temporal(TemporalType.TIMESTAMP)\n"
+" public Date getLastUpdate() { ... }\n"
+" public String getLastUpdater() { ... }\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity class Order extends BaseEntity {\n"
+" @Id public Integer getId() { ... }\n"
+" ...\n"
+"}"
+msgstr ""
+"@MappedSuperclass\n"
+"public class BaseEntity {\n"
+" @Basic\n"
+" @Temporal(TemporalType.TIMESTAMP)\n"
+" public Date getLastUpdate() { ... }\n"
+" public String getLastUpdater() { ... }\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity class Order extends BaseEntity {\n"
+" @Id public Integer getId() { ... }\n"
+" ...\n"
+"}"
+
+#. Tag: para
+#: entity.xml:688
+#, no-c-format
+msgid ""
+"In database, this hierarchy will be represented as an
<literal>Order</"
+"literal> table having the <literal>id</literal>,
<literal>lastUpdate</"
+"literal> and <literal>lastUpdater</literal> columns. The embedded
superclass "
+"property mappings are copied into their entity subclasses. Remember that the
"
+"embeddable superclass is not the root of the hierarchy though."
+msgstr ""
+"Dans la base de données, cette hiérarchie sera représentée en tant que table
"
+"<literal>Order</literal> avec les colonnes
<literal>id</literal>, "
+"<literal>lastUpdate</literal> et
<literal>lastUpdater</literal>. Les "
+"mappages de propriétés de superclasses intégrées sont copiées dans leurs "
+"sous-classes d'entité. Souvenez-vous que la superclasse intégrée n'est
"
+"cependant pas à la base de la hiérarchie."
+
+#. Tag: para
+#: entity.xml:696
+#, no-c-format
+msgid ""
+"Properties from superclasses not mapped as
<literal>@MappedSuperclass</"
+"literal> are ignored."
+msgstr ""
+"Les propriétés de superclasses qui ne sont pas mappées en tant que "
+"<literal>@MappedSuperclass</literal> ne sont pas prises en
considération."
+
+#. Tag: para
+#: entity.xml:701
+#, no-c-format
+msgid ""
+"The access type (field or methods), is inherited from the root entity, "
+"unless you use the Hibernate annotation
<literal>@AccessType</literal>"
+msgstr ""
+"Le type d'accès (champ ou méthode), est hérité de l'entité root, à moins
que "
+"vous utilisiez l'annotation Hibernate
<literal>@AccessType</literal>"
+
+#. Tag: para
+#: entity.xml:707
+#, no-c-format
+msgid ""
+"The same notion can be applied to <literal>@Embeddable</literal>
objects to "
+"persist properties from their superclasses. You also need to use "
+"<literal>@MappedSuperclass</literal> to do that (this should not be
"
+"considered as a standard EJB3 feature though)"
+msgstr ""
+"La même notion peut s'appliquer aux objets
<literal>@Embeddable</literal> "
+"pour persister les propriétés à partir de leurs superclasses. Vous aurez "
+"également besoin d'utiliser <literal>@MappedSuperclass</literal>
pour cela "
+"(mais cela ne doit pas représenter une fonctionnalité EJB3 standard)"
+
+#. Tag: para
+#: entity.xml:715
+#, no-c-format
+msgid ""
+"It is allowed to mark a class as <literal>@MappedSuperclass</literal>
in the "
+"middle of the mapped inheritance hierarchy."
+msgstr ""
+"Il est autorisé de marquer une classe en tant que "
+"<literal>@MappedSuperclass</literal> au milieu de la hiérarchie
d'héritage "
+"mappée."
+
+#. Tag: para
+#: entity.xml:721
+#, no-c-format
+msgid ""
+"Any class in the hierarchy non annotated with
<literal>@MappedSuperclass</"
+"literal> nor <literal>@Entity</literal> will be ignored."
+msgstr ""
+"Toute classe de la hiérarchie qui ne serait pas annotée avec "
+"<literal>@MappedSuperclass</literal> ou
<literal>@Entity</literal> sera "
+"ignorée."
+
+#. Tag: para
+#: entity.xml:726
+#, no-c-format
+msgid ""
+"You can override columns defined in entity superclasses at the root entity "
+"level using the <literal>@AttributeOverride</literal>
annotation."
+msgstr ""
+"Vous pouvez surcharger les colonnes définies en tant que superclasses "
+"d'entités au niveau entité root, en utilisant l'annotation "
+"<literal>(a)AttributeOverride</literal>."
+
+#. Tag: programlisting
+#: entity.xml:730
+#, no-c-format
+msgid ""
+"@MappedSuperclass\n"
+"public class FlyingObject implements Serializable {\n"
+"\n"
+" public int getAltitude() {\n"
+" return altitude;\n"
+" }\n"
+"\n"
+" @Transient\n"
+" public int getMetricAltitude() {\n"
+" return metricAltitude;\n"
+" }\n"
+"\n"
+" @ManyToOne\n"
+" public PropulsionType getPropulsion() {\n"
+" return metricAltitude;\n"
+" }\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"@AttributeOverride( name=\"altitude\", column =
@Column(name=\"fld_altitude"
+"\") )\n"
+"@AssociationOverride( name=\"propulsion\", joinColumns =
@JoinColumn(name="
+"\"fld_propulsion_fk\") )\n"
+"public class Plane extends FlyingObject {\n"
+" ...\n"
+"}"
+msgstr ""
+"@MappedSuperclass\n"
+"public class FlyingObject implements Serializable {\n"
+"\n"
+" public int getAltitude() {\n"
+" return altitude;\n"
+" }\n"
+"\n"
+" @Transient\n"
+" public int getMetricAltitude() {\n"
+" return metricAltitude;\n"
+" }\n"
+"\n"
+" @ManyToOne\n"
+" public PropulsionType getPropulsion() {\n"
+" return metricAltitude;\n"
+" }\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"@AttributeOverride( name=\"altitude\", column =
@Column(name=\"fld_altitude"
+"\") )\n"
+"@AssociationOverride( name=\"propulsion\", joinColumns =
@JoinColumn(name="
+"\"fld_propulsion_fk\") )\n"
+"public class Plane extends FlyingObject {\n"
+" ...\n"
+"}"
+
+#. Tag: para
+#: entity.xml:732
+#, no-c-format
+msgid ""
+"The <literal>altitude</literal> property will be persisted in an
"
+"<literal>fld_altitude</literal> column of table
<literal>Plane</literal> and "
+"the propulsion association will be materialized in a "
+"<literal>fld_propulsion_fk</literal> foreign key column."
+msgstr ""
+"La propriété <literal>altitude</literal> sera persistée dans une
colonne "
+"<literal>fld_altitude</literal> de table
<literal>Plane</literal> et "
+"l'association propulsion sera matérialisée dans une colonne de clé étrangère
"
+"<literal>fld_propulsion_fk</literal>."
+
+#. Tag: para
+#: entity.xml:738
+#, no-c-format
+msgid ""
+"You can define <literal>@AttributeOverride</literal>(s) and "
+"<literal>@AssociationOverride</literal>(s) on
<literal>@Entity</literal> "
+"classes, <literal>@MappedSuperclass</literal> classes and properties
"
+"pointing to an <literal>@Embeddable</literal> object."
+msgstr ""
+"Vous pouvez déterminer <literal>@AttributeOverride</literal>(s) et
"
+"<literal>@AssociationOverride</literal>(s) sur les classes et
propriétés "
+"<literal>@Entity</literal>,
<literal>@MappedSuperclass</literal> pointant "
+"sur un objet <literal>(a)Embeddable</literal>."
+
+#. Tag: title
+#: entity.xml:747
+#, no-c-format
+msgid "Mapping entity bean associations/relationships"
+msgstr "Mappage des associations/relations des beans entité"
+
+#. Tag: title
+#: entity.xml:750
+#, no-c-format
+msgid "One-to-one"
+msgstr "One-to-one"
+
+#. Tag: para
+#: entity.xml:752
+#, no-c-format
+msgid ""
+"You can associate entity beans through a one-to-one relationship using "
+"<literal>@OneToOne</literal>. There are three cases for one-to-one
"
+"associations: either the associated entities share the same primary keys "
+"values, a foreign key is held by one of the entities (note that this FK "
+"column in the database should be constrained unique to simulate one-to-one "
+"multiplicity), or a association table is used to store the link between the "
+"2 entities (a unique constraint has to be defined on each fk to ensure the "
+"one to one multiplicity)"
+msgstr ""
+"Vous pouvez associer les beans entité par la relation one-to-one en "
+"utilisant <literal>@OneToOne</literal>. Il existe trois cas pour les
"
+"associations one-to-one : soit les entités associées partagent les mêmes "
+"valeurs de clés primaires, et une clé étrangère est détenue par un des "
+"entités (notez que la colonne FK de la base de données doit être contenue "
+"uniquement dans le but de simuler la multiplicité one-to-one), ou bien, une "
+"table d'associations est utilisée pour stocker le lien entre les deux "
+"entités (une contrainte unique doit être définie par chaque fk pour assurer "
+"la multiplicité one-to-one)"
+
+#. Tag: para
+#: entity.xml:761
+#, no-c-format
+msgid "First, we map a real one-to-one association using shared primary keys:"
+msgstr ""
+"Tout d'abord, on mappe une véritable association one-to-one en utilisant les
"
+"clés primaires partagées :"
+
+#. Tag: programlisting
+#: entity.xml:764
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Body {\n"
+" @Id\n"
+" public Long getId() { return id; }\n"
+"\n"
+" @OneToOne(cascade = CascadeType.ALL)\n"
+" @PrimaryKeyJoinColumn\n"
+" public Heart getHeart() {\n"
+" return heart;\n"
+" }\n"
+" ...\n"
+"}"
+msgstr ""
+"@Entity\n"
+"public class Body {\n"
+" @Id\n"
+" public Long getId() { return id; }\n"
+"\n"
+" @OneToOne(cascade = CascadeType.ALL)\n"
+" @PrimaryKeyJoinColumn\n"
+" public Heart getHeart() {\n"
+" return heart;\n"
+" }\n"
+" ...\n"
+"}"
+
+#. Tag: programlisting
+#: entity.xml:766
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Heart {\n"
+" @Id\n"
+" public Long getId() { ...}\n"
+"}"
+msgstr ""
+"@Entity\n"
+"public class Heart {\n"
+" @Id\n"
+" public Long getId() { ...}\n"
+"}"
+
+#. Tag: para
+#: entity.xml:768
+#, no-c-format
+msgid ""
+"The one to one is marked as true by using the "
+"<literal>@PrimaryKeyJoinColumn</literal> annotation."
+msgstr ""
+"One-to-one est marqué en tant que true en utilisant l'annotation "
+"<literal>(a)PrimaryKeyJoinColumn</literal>."
+
+#. Tag: para
+#: entity.xml:771
+#, no-c-format
+msgid ""
+"In the following example, the associated entities are linked through a "
+"foreign key column:"
+msgstr ""
+"Dans l'exemple suivant, les entités associées sont liées par une colonne de
"
+"clé étrangère :"
+
+#. Tag: programlisting
+#: entity.xml:774
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Customer implements Serializable {\n"
+" @OneToOne(cascade = CascadeType.ALL)\n"
+" <emphasis
role=\"bold\">@JoinColumn(name=\"passport_fk\")</emphasis>\n"
+" public Passport getPassport() {\n"
+" ...\n"
+" }\n"
+"\n"
+"@Entity\n"
+"public class Passport implements Serializable {\n"
+" @OneToOne(<emphasis role=\"bold\">mappedBy =
\"passport\"</emphasis>)\n"
+" public Customer getOwner() {\n"
+" ...\n"
+"}"
+msgstr ""
+"@Entity\n"
+"public class Customer implements Serializable {\n"
+" @OneToOne(cascade = CascadeType.ALL)\n"
+" <emphasis
role=\"bold\">@JoinColumn(name=\"passport_fk\")</emphasis>\n"
+" public Passport getPassport() {\n"
+" ...\n"
+" }\n"
+"\n"
+"@Entity\n"
+"public class Passport implements Serializable {\n"
+" @OneToOne(<emphasis role=\"bold\">mappedBy =
\"passport\"</emphasis>)\n"
+" public Customer getOwner() {\n"
+" ...\n"
+"}"
+
+#. Tag: para
+#: entity.xml:776
+#, no-c-format
+msgid ""
+"A <classname>Customer</classname> is linked to a
<classname>Passport</"
+"classname>, with a foreign key column named
<literal>passport_fk</literal> "
+"in the <literal>Customer</literal> table. The join column is declared
with "
+"the <literal>@JoinColumn</literal> annotation which looks like the
"
+"<literal>@Column</literal> annotation. It has one more parameters named
"
+"<literal>referencedColumnName</literal>. This parameter declares the
column "
+"in the targeted entity that will be used to the join. Note that when using "
+"<literal><literal>referencedColumnName</literal></literal>
to a non primary "
+"key column, the associated class has to be
<classname>Serializable</"
+"classname>. Also note that the
<literal><literal>referencedColumnName</"
+"literal></literal> to a non primary key column has to be mapped to a
"
+"property having a single column (other cases might not work)."
+msgstr ""
+"Un <classname>Customer</classname> est lié à un
<classname>Passport</"
+"classname> par une colonne de clé étrangère nommée
<literal>passport_fk</"
+"literal> dans la table <literal>Customer</literal>. La colonne de
jointure "
+"est déclarée avec l'annotation <literal>@JoinColumn</literal> qui
ressemble "
+"Ã l'annotation <literal>@Column</literal>. Elle comporte un
paramètre "
+"supplémentaire nommé <literal>referencedColumnName</literal>. Ce
paramètre "
+"déclare la colonne dans l'entité cible, qui va être utilisée pour la "
+"jointure. Notez que quand on utilise
<literal><literal>referencedColumnName</"
+"literal></literal> pour une colonne clé non-primaires, la classe associée
"
+"devra être <classname>Serializable</classname>. Aussi, notez que le
"
+"<literal><literal>referencedColumnName</literal></literal>
d'une colonne de "
+"clés primaires devra être mappé à une propriété possédant une simple colonne
"
+"(ne fonctionnera pas forcément dans les autres cas)."
+
+#. Tag: para
+#: entity.xml:792
+#, no-c-format
+msgid ""
+"The association may be bidirectional. In a bidirectional relationship, one "
+"of the sides (and only one) has to be the owner: the owner is responsible "
+"for the association column(s) update. To declare a side as
<emphasis>not</"
+"emphasis> responsible for the relationship, the attribute
<literal>mappedBy</"
+"literal> is used. <literal>mappedBy</literal> refers to the property
name of "
+"the association on the owner side. In our case, this is
<literal>passport</"
+"literal>. As you can see, you don't have to (must not) declare the join
"
+"column since it has already been declared on the owners side."
+msgstr ""
+"L'association peut être bidirectionnelle. Dans une relation "
+"bidirectionnelle, l'une des parties (et une partie seulement) devra être
"
+"propriétaire : le propriétaire est responsable pour la mise à jour de
colonne"
+"(s) d'association. Pour déclarer une partie comme
<emphasis>non</emphasis> "
+"responsable de la relation, l'attribut <literal>mappedBy</literal>
est "
+"utilisé. <literal>mappedBy</literal> se rapporte au nom de la propriété
de "
+"l'association du côté client. Dans notre cas, il s'agit de "
+"<literal>passport</literal>. Comme vous pourrez remarquer, vous ne
devez "
+"(surtout) pas déclarer la colonne de jointure car elle aura déjà été "
+"déclarée du côté des propriétaires. "
+
+#. Tag: para
+#: entity.xml:803
+#, no-c-format
+msgid ""
+"If no <literal>@JoinColumn</literal> is declared on the owner side, the
"
+"defaults apply. A join column(s) will be created in the owner table and its "
+"name will be the concatenation of the name of the relationship in the owner "
+"side, <keycap>_</keycap> (underscore), and the name of the primary key
column"
+"(s) in the owned side. In this example <literal>passport_id</literal>
"
+"because the property name is <literal>passport</literal> and the column
id "
+"of <literal>Passport </literal>is
<literal>id</literal>."
+msgstr ""
+"Si aucune <literal>@JoinColumn</literal> n'est déclarée du côté du
"
+"propriétaire, les valeurs par défaut s'appliquent. Une ou plusieurs colonnes
"
+"de jointure seront créées dans la table du propriétaire et son nom sera "
+"constitué par l'enchaînement du nom de la relation du côté du propriétaire,
"
+"<keycap>_</keycap> (trait de soulignement), et le nom de ou des
colonne(s) "
+"du côté possédé. Dans cet exemple, <literal>passport_id</literal> car
le nom "
+"de propriété est <literal>passport</literal> et que l'id de colonne
de "
+"<literal>Passport </literal>est
<literal>id</literal>."
+
+#. Tag: para
+#: entity.xml:812
+#, no-c-format
+msgid "The third possibility (using an association table) is very exotic."
+msgstr ""
+"La troisième possibilité (en utilisant une table d'associations) est très
"
+"exotique."
+
+#. Tag: programlisting
+#: entity.xml:815
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Customer implements Serializable {\n"
+" @OneToOne(cascade = CascadeType.ALL)\n"
+" <emphasis role=\"bold\">@JoinTable(name =
\"CustomerPassports\",\n"
+" joinColumns = @JoinColumn(name=\"customer_fk\"),\n"
+" inverseJoinColumns =
@JoinColumn(name=\"passport_fk\")</emphasis>\n"
+" )\n"
+" public Passport getPassport() {\n"
+" ...\n"
+" }\n"
+"\n"
+"@Entity\n"
+"public class Passport implements Serializable {\n"
+" @OneToOne(<emphasis role=\"bold\">mappedBy =
\"passport\"</emphasis>)\n"
+" public Customer getOwner() {\n"
+" ...\n"
+"}"
+msgstr ""
+"@Entity\n"
+"public class Customer implements Serializable {\n"
+" @OneToOne(cascade = CascadeType.ALL)\n"
+" <emphasis role=\"bold\">@JoinTable(name =
\"CustomerPassports\",\n"
+" joinColumns = @JoinColumn(name=\"customer_fk\"),\n"
+" inverseJoinColumns =
@JoinColumn(name=\"passport_fk\")</emphasis>\n"
+" )\n"
+" public Passport getPassport() {\n"
+" ...\n"
+" }\n"
+"\n"
+"@Entity\n"
+"public class Passport implements Serializable {\n"
+" @OneToOne(<emphasis role=\"bold\">mappedBy =
\"passport\"</emphasis>)\n"
+" public Customer getOwner() {\n"
+" ...\n"
+"}"
+
+#. Tag: para
+#: entity.xml:817
+#, no-c-format
+msgid ""
+"A <classname>Customer</classname> is linked to a
<classname>Passport</"
+"classname> through a association table named
<literal>CustomerPassports</"
+"literal> ; this association table has a foreign key column named "
+"<literal>passport_fk</literal> pointing to the
<literal>Passport</literal> "
+"table (materialized by the <literal>inverseJoinColumn</literal>, and a
"
+"foreign key column named <literal>customer_fk</literal> pointing to the
"
+"<literal>Customer</literal> table materialized by the
<literal>joinColumns</"
+"literal> attribute."
+msgstr ""
+"Un <classname>Customer</classname> est lié à un
<classname>Passport</"
+"classname> par une table d'association nommée
<literal>CustomerPassports</"
+"literal> ; cette table d'association comporte une colonne de clés étrangères
"
+"nommée <literal>passport_fk</literal> qui pointe vers la table "
+"<literal>Passport</literal> (matérialisée par
<literal>inverseJoinColumn</"
+"literal>, et une colonne de clés étrangères nommée
<literal>customer_fk</"
+"literal> pointant vers la table <literal>Customer</literal> et
matérialisée "
+"par l'attribut <literal>joinColumns</literal>."
+
+#. Tag: para
+#: entity.xml:827
+#, no-c-format
+msgid ""
+"You must declare the join table name and the join columns explicitly in such
"
+"a mapping."
+msgstr ""
+"Vous devez déclarer le nom de la table de jointure et les colonnes de "
+"jointure explicitement dans un tel mappage."
+
+#. Tag: title
+#: entity.xml:832
+#, no-c-format
+msgid "Many-to-one"
+msgstr "Many-to-one"
+
+#. Tag: para
+#: entity.xml:834
+#, no-c-format
+msgid ""
+"Many-to-one associations are declared at the property level with the "
+"annotation <literal>@ManyToOne</literal>:"
+msgstr ""
+"Les associations many-to-one sont déclarées au niveau propriété par "
+"l'annotation <literal>@ManyToOne</literal> :"
+
+#. Tag: programlisting
+#: entity.xml:837
+#, no-c-format
+msgid ""
+"@Entity()\n"
+"public class Flight implements Serializable {\n"
+" <emphasis role=\"bold\">@ManyToOne</emphasis>( cascade =
{CascadeType."
+"PERSIST, CascadeType.MERGE} )\n"
+" @JoinColumn(name=\"COMP_ID\")\n"
+" public Company getCompany() {\n"
+" return company;\n"
+" }\n"
+" ...\n"
+"}"
+msgstr ""
+"@Entity()\n"
+"public class Flight implements Serializable {\n"
+" <emphasis role=\"bold\">@ManyToOne</emphasis>( cascade =
{CascadeType."
+"PERSIST, CascadeType.MERGE} )\n"
+" @JoinColumn(name=\"COMP_ID\")\n"
+" public Company getCompany() {\n"
+" return company;\n"
+" }\n"
+" ...\n"
+"}"
+
+#. Tag: para
+#: entity.xml:839
+#, no-c-format
+msgid ""
+"The <literal>@JoinColumn</literal> attribute is optional, the default
value"
+"(s) is like in one to one, the concatenation of the name of the relationship
"
+"in the owner side, <keycap>_</keycap> (underscore), and the name of the
"
+"primary key column in the owned side. In this example
<literal>company_id</"
+"literal> because the property name is <literal>company</literal> and
the "
+"column id of Company is <literal>id</literal>."
+msgstr ""
+"L'attribut <literal>@JoinColumn</literal> est optionnel, la(les)
valeur(s) "
+"par défaut sont comme dans one-to-one, la concaténation du nom de la "
+"relation du côté du propriétaire, <keycap>_</keycap> (trait de "
+"soulignement), et le nom de la colonne de clé primaire du côté possédé. Dans
"
+"cet exemple, <literal>company_id</literal> car le nom de la propriété
est "
+"<literal>company</literal> et l'id de la colonne de Company est
<literal>id</"
+"literal>."
+
+#. Tag: para
+#: entity.xml:847
+#, no-c-format
+msgid ""
+"<literal>@ManyToOne</literal> has a parameter named
<literal>targetEntity</"
+"literal> which describes the target entity name. You usually don't need this
"
+"parameter since the default value (the type of the property that stores the "
+"association) is good in almost all cases. However this is useful when you "
+"want to use interfaces as the return type instead of the regular entity."
+msgstr ""
+"<literal>@ManyToOne</literal> possède un paramètre mommé "
+"<literal>targetEntity</literal> qui décrit le nom de l'entité
ciblée. Vous "
+"n'avez pas normalement besoin de ce paramètre car la valeur par défaut (le
"
+"type de propriété qui stocke l'association) est bonne dans presque tous les
"
+"cas. Malgré tout, c'est utile quand vous souhaitez utiliser les interfaces
"
+"en tant que type de retour à la place des entités habituelles. "
+
+#. Tag: programlisting
+#: entity.xml:854
+#, no-c-format
+msgid ""
+"@Entity()\n"
+"public class Flight implements Serializable {\n"
+" @ManyToOne( cascade = {CascadeType.PERSIST, CascadeType.MERGE}, "
+"<emphasis\n"
+"
role=\"bold\">targetEntity=CompanyImpl.class</emphasis> )\n"
+" @JoinColumn(name=\"COMP_ID\")\n"
+" public Company getCompany() {\n"
+" return company;\n"
+" }\n"
+" ...\n"
+"}\n"
+"\n"
+"public interface Company {\n"
+" ..."
+msgstr ""
+"@Entity()\n"
+"public class Flight implements Serializable {\n"
+" @ManyToOne( cascade = {CascadeType.PERSIST, CascadeType.MERGE}, "
+"<emphasis\n"
+"
role=\"bold\">targetEntity=CompanyImpl.class</emphasis> )\n"
+" @JoinColumn(name=\"COMP_ID\")\n"
+" public Company getCompany() {\n"
+" return company;\n"
+" }\n"
+" ...\n"
+"}\n"
+"\n"
+"public interface Company {\n"
+" ..."
+
+#. Tag: para
+#: entity.xml:856
+#, no-c-format
+msgid ""
+"You can alse map a many to one association through an association table. "
+"This association table described by the <literal>@JoinTable</literal>
"
+"annotation will contains a foreign key referencing back the entity table "
+"(through <literal>(a)JoinTable.joinColumns</literal>) and a a foreign key
"
+"referencing the target entity table (through <literal>(a)JoinTable."
+"inverseJoinColumns</literal>)."
+msgstr ""
+"Vous pouvez également mapper une association many-to-one par la table "
+"d'associations. Cette table d'associations décrite par l'annotation
"
+"<literal>@JoinTable</literal> contiendra une clé étrangère référençant
la "
+"table d'entités (par <literal>(a)JoinTable.joinColumns</literal>) et
une clé "
+"étrangère référençant la table d'entité ciblée (par
<literal>(a)JoinTable."
+"inverseJoinColumns</literal>). "
+
+#. Tag: programlisting
+#: entity.xml:864
+#, no-c-format
+msgid ""
+"@Entity()\n"
+"public class Flight implements Serializable {\n"
+" @ManyToOne( cascade = {CascadeType.PERSIST, CascadeType.MERGE} )\n"
+" <emphasis
role=\"bold\">@JoinTable(name=\"Flight_Company\",\n"
+" joinColumns = @JoinColumn(name=\"FLIGHT_ID\"),\n"
+" inverseJoinColumns = @JoinColumn(name=\"COMP_ID\")\n"
+" )</emphasis>\n"
+" public Company getCompany() {\n"
+" return company;\n"
+" }\n"
+" ...\n"
+"}"
+msgstr ""
+"@Entity()\n"
+"public class Flight implements Serializable {\n"
+" @ManyToOne( cascade = {CascadeType.PERSIST, CascadeType.MERGE} )\n"
+" <emphasis
role=\"bold\">@JoinTable(name=\"Flight_Company\",\n"
+" joinColumns = @JoinColumn(name=\"FLIGHT_ID\"),\n"
+" inverseJoinColumns = @JoinColumn(name=\"COMP_ID\")\n"
+" )</emphasis>\n"
+" public Company getCompany() {\n"
+" return company;\n"
+" }\n"
+" ...\n"
+"}"
+
+#. Tag: title
+#: entity.xml:868
+#, no-c-format
+msgid "Collections"
+msgstr "Collections"
+
+#. Tag: title
+#: entity.xml:872
+#, no-c-format
+msgid "Overview"
+msgstr "Aperçu général"
+
+#. Tag: para
+#: entity.xml:874
+#, no-c-format
+msgid ""
+"You can map <classname>Collection</classname>,
<literal>List</literal> (ie "
+"ordered lists, not indexed lists), <literal>Map</literal> and "
+"<classname>Set</classname>. The EJB3 specification describes how to map
an "
+"ordered list (ie a list ordered at load time) using <literal>(a)javax."
+"persistence.OrderBy</literal> annotation: this annotation takes into "
+"parameter a list of comma separated (target entity) properties to order the "
+"collection by (eg <code>firstname asc, age desc</code>), if the string
is "
+"empty, the collection will be ordered by id. For true indexed collections, "
+"please refer to the <xref linkend=\"entity-hibspec\"/>. EJB3 allows
you to "
+"map Maps using as a key one of the target entity property using "
+"<literal>@MapKey(name=\"myProperty\")</literal> (myProperty
is a property "
+"name in the target entity). When using <literal>@MapKey</literal>
(without "
+"property name), the target entity primary key is used. The map key uses the "
+"same column as the property pointed out: there is no additional column "
+"defined to hold the map key, and it does make sense since the map key "
+"actually represent a target property. Be aware that once loaded, the key is "
+"no longer kept in sync with the property, in other words, if you change the "
+"property value, the key will not change automatically in your Java model "
+"(for true map support please refers to <xref
linkend=\"entity-hibspec\"/>). "
+"Many people confuse <literal><map></literal> capabilities
and "
+"<literal>@MapKey</literal> ones. These are two different features.
"
+"<literal>@MapKey</literal> still has some limitations, please check the
"
+"forum or the JIRA tracking system for more informations."
+msgstr ""
+"Vous pouvez mapper <classname>Collection</classname>,
<literal>List</"
+"literal> (c'est à dire des listes ordonnées, non pas des listes indexées),
"
+"<literal>Map</literal> et <classname>Set</classname>. La
spécification EJB3 "
+"décrit comment mapper une liste ordonnée (c'est à dire une liste ordonnée en
"
+"cours de chargement) en utilisant l'annotation
<literal>(a)javax.persistence."
+"OrderBy</literal> : cette annotation prend pour paramétre une liste de
"
+"propriétés séparées par des virgules (entités cibles) pour ordonner la "
+"collection (ex. <code>firstname asc, age desc</code>), si la chaîne est
"
+"vide, la collection sera ordonnée par id. <literal>@OrderBy</literal>
ne "
+"fonctionne actuellement uniquement avec des collections qui n'ont pas de
"
+"tables d'association. Pour les collections indexées true, veuillez vous "
+"reporter à <xref linkend=\"entity-hibspec\"/>. "
+"EJB3 vous permet de mapper Maps en utilisant pour clé, une des propriétés "
+"d'entité cible avec
<literal>@MapKey(name=\"myProperty\")</literal> "
+"(myProperty est un nom de propriété de l'entité cible). Quand on utilise
"
+"<literal>@MapKey</literal> (sans nom de propriété), la clé primaire
d'entité "
+"cible est utilisée. La clé de mappage utilise la même colonne que celle qui "
+"était indiquée par la propriété : il n'y a pas de colonne supplémentaire
"
+"déterminée pour contenir la clé de mappage, et c'est logique, puisque la clé
"
+"de mappage représente en fait une propriété cible. Sachez qu'une fois "
+"qu'elle est téléchargée, la clé n'est plus en sync avec la propriété,
c'est "
+"à dire que si vous changez la valeur de la propriété, la clé ne sera pas "
+"changée automatiquement dans votre modèle Java (pour un véritable support de
"
+"mappage, veuillez vous référer à <xref
linkend=\"entity-hibspec\"/>). De nombreuses personnes confondent les "
+"possibilités de <literal><map></literal> avec celles de
"
+"<literal>@MapKey</literal>. Ce sont des fonctionnalités bien
distinctes."
+"<literal>@MapKey</literal> comporte encore quelques limitations,
veuillez "
+"consulter le forum ou bien le système de traçage JIRA pour davantage "
+"d'informations."
+
+#. Tag: para
+#: entity.xml:902
+#, no-c-format
+msgid "Hibernate has several notions of collections."
+msgstr "Hibernate possède plusieurs notions de collections."
+
+#. Tag: title
+#: entity.xml:907
+#, no-c-format
+msgid "Collections semantics"
+msgstr "Collections semantics"
+
+#. Tag: entry
+#: entity.xml:918
+#, no-c-format
+msgid "Semantic"
+msgstr "Semantic"
+
+#. Tag: entry
+#: entity.xml:920
+#, no-c-format
+msgid "java representation"
+msgstr "représentation java"
+
+#. Tag: entry
+#: entity.xml:922
+#, no-c-format
+msgid "annotations"
+msgstr "annotations"
+
+#. Tag: entry
+#: entity.xml:928
+#, no-c-format
+msgid "Bag semantic"
+msgstr "Bag semantic"
+
+#. Tag: para
+#: entity.xml:930
+#, no-c-format
+msgid "<para>java.util.List</para>"
+msgstr "<para>java.util.List</para>"
+
+#. Tag: para
+#: entity.xml:930
+#, no-c-format
+msgid "java.util.Collection"
+msgstr "java.util.Collection"
+
+#. Tag: para
+#: entity.xml:932
+#, no-c-format
+msgid "(a)org.hibernate.annotations.CollectionOfElements"
+msgstr "(a)org.hibernate.annotations.CollectionOfElements"
+
+#. Tag: para
+#: entity.xml:932
+#, no-c-format
+msgid "or @OneToMany"
+msgstr "ou @OneToMany"
+
+#. Tag: para
+#: entity.xml:932
+#, no-c-format
+msgid "or @ManyToMany"
+msgstr "ou @ManyToMany"
+
+#. Tag: entry
+#: entity.xml:936
+#, no-c-format
+msgid "Bag semantic with primary key (withtout the limitations of Bag
semantic)"
+msgstr "Bag semantic avec la clé primaire (sans les limitations de Bag
semantic)"
+
+#. Tag: entry
+#: entity.xml:939
+#, no-c-format
+msgid "java.util.List, java.util.Collection"
+msgstr "java.util.List, java.util.Collection"
+
+#. Tag: entry
+#: entity.xml:941
+#, no-c-format
+msgid ""
+"((a)org.hibernate.annotations.CollectionOfElements or @OneToMany or "
+"@ManyToMany) and @CollectionId"
+msgstr ""
+"((a)org.hibernate.annotations.CollectionOfElements or @OneToMany or "
+"@ManyToMany) and @CollectionId"
+
+#. Tag: entry
+#: entity.xml:946
+#, no-c-format
+msgid "List semantic"
+msgstr "List semantic"
+
+#. Tag: entry
+#: entity.xml:948
+#, no-c-format
+msgid "<entry>java.util.List</entry>"
+msgstr "<entry>java.util.List</entry>"
+
+#. Tag: entry
+#: entity.xml:950
+#, no-c-format
+msgid ""
+"((a)org.hibernate.annotations.CollectionOfElements or @OneToMany or "
+"@ManyToMany) and @org.hibernate.annotations.IndexColumn"
+msgstr ""
+"((a)org.hibernate.annotations.CollectionOfElements or @OneToMany or "
+"@ManyToMany) et @org.hibernate.annotations.IndexColumn"
+
+#. Tag: entry
+#: entity.xml:956
+#, no-c-format
+msgid "Set semantic"
+msgstr "Set semantic"
+
+#. Tag: entry
+#: entity.xml:958
+#, no-c-format
+msgid "java.util.Set"
+msgstr "java.util.Set"
+
+#. Tag: entry
+#: entity.xml:960
+#, no-c-format
+msgid "(a)org.hibernate.annotations.CollectionOfElements or @OneToMany or
@ManyToMany"
+msgstr "(a)org.hibernate.annotations.CollectionOfElements or @OneToMany or
@ManyToMany"
+
+#. Tag: entry
+#: entity.xml:965
+#, no-c-format
+msgid "Map semantic"
+msgstr "Map semantic"
+
+#. Tag: entry
+#: entity.xml:967
+#, no-c-format
+msgid "java.util.Map"
+msgstr "java.util.Map"
+
+#. Tag: entry
+#: entity.xml:969
+#, no-c-format
+msgid ""
+"((a)org.hibernate.annotations.CollectionOfElements or @OneToMany or "
+"@ManyToMany) and (nothing or @org.hibernate.annotations.MapKey/"
+"MapKeyManyToMany for true map support, OR @javax.persistence.MapKey"
+msgstr ""
+"((a)org.hibernate.annotations.CollectionOfElements or @OneToMany or "
+"@ManyToMany) et (nothing or @org.hibernate.annotations.MapKey/"
+"MapKeyManyToMany pour support de mappage true, OU @javax.persistence.MapKey"
+
+#. Tag: remark
+#: entity.xml:978
+#, no-c-format
+msgid ""
+"So specifically, java.util.List collections without @org.hibernate."
+"annotations.IndexColumn are going to be considered as bags."
+msgstr ""
+"Donc plus spécifiquement, les collections java.util.List sans
@org.hibernate."
+"annotations.IndexColumn seront considérées en tant que bags."
+
+#. Tag: para
+#: entity.xml:982
+#, no-c-format
+msgid ""
+"Collection of primitive, core type or embedded objects is not supported by "
+"the EJB3 specification. Hibernate Annotations allows them however (see <xref
"
+"linkend=\"entity-hibspec\"/>)."
+msgstr ""
+"La collection d'objets primitifs, type core ou imbriqués n'est pas prise en
"
+"charge par la spécification EJB3. Hibernate Annotations les autorise malgé "
+"tout (voir <xref linkend=\"entity-hibspec\"/>)."
+
+#. Tag: programlisting
+#: entity.xml:986
+#, no-c-format
+msgid ""
+"@Entity public class City {\n"
+" @OneToMany(mappedBy=\"city\")\n"
+" <emphasis
role=\"bold\">@OrderBy(\"streetName\")</emphasis>\n"
+" public List<Street> getStreets() {\n"
+" return streets;\n"
+" }\n"
+"...\n"
+"}\n"
+"\n"
+"@Entity public class Street {\n"
+" <emphasis role=\"bold\">public String
getStreetName()</emphasis> {\n"
+" return streetName;\n"
+" }\n"
+"\n"
+" @ManyToOne\n"
+" public City getCity() {\n"
+" return city;\n"
+" }\n"
+" ...\n"
+"}\n"
+"\n"
+"\n"
+"@Entity\n"
+"public class Software {\n"
+" @OneToMany(mappedBy=\"software\")\n"
+" <emphasis
role=\"bold\">@MapKey(name=\"codeName\")</emphasis>\n"
+" public Map<String, Version> getVersions() {\n"
+" return versions;\n"
+" }\n"
+"...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"@Table(name=\"tbl_version\")\n"
+"public class Version {\n"
+" <emphasis role=\"bold\">public String
getCodeName()</emphasis> {...}\n"
+"\n"
+" @ManyToOne\n"
+" public Software getSoftware() { ... }\n"
+"...\n"
+"}"
+msgstr ""
+"@Entity public class City {\n"
+" @OneToMany(mappedBy=\"city\")\n"
+" <emphasis
role=\"bold\">@OrderBy(\"streetName\")</emphasis>\n"
+" public List<Street> getStreets() {\n"
+" return streets;\n"
+" }\n"
+"...\n"
+"}\n"
+"\n"
+"@Entity public class Street {\n"
+" <emphasis role=\"bold\">public String
getStreetName()</emphasis> {\n"
+" return streetName;\n"
+" }\n"
+"\n"
+" @ManyToOne\n"
+" public City getCity() {\n"
+" return city;\n"
+" }\n"
+" ...\n"
+"}\n"
+"\n"
+"\n"
+"@Entity\n"
+"public class Software {\n"
+" @OneToMany(mappedBy=\"software\")\n"
+" <emphasis
role=\"bold\">@MapKey(name=\"codeName\")</emphasis>\n"
+" public Map<String, Version> getVersions() {\n"
+" return versions;\n"
+" }\n"
+"...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"@Table(name=\"tbl_version\")\n"
+"public class Version {\n"
+" <emphasis role=\"bold\">public String
getCodeName()</emphasis> {...}\n"
+"\n"
+" @ManyToOne\n"
+" public Software getSoftware() { ... }\n"
+"...\n"
+"}"
+
+#. Tag: para
+#: entity.xml:988
+#, no-c-format
+msgid ""
+"So <literal>City</literal> has a collection of
<literal>Street</literal>s "
+"that are ordered by <literal>streetName</literal> (of
<literal>Street</"
+"literal>) when the collection is loaded. <literal>Software</literal>
has a "
+"map of <literal>Version</literal>s which key is the
<literal>Version</"
+"literal> <literal>codeName</literal>."
+msgstr ""
+"Donc <literal>City</literal> (Ville) possède une collection de "
+"<literal>Street</literal> (rue)s qui sont ordonnées par
<literal>streetName</"
+"literal> (noms de rue) (de <literal>Street</literal> (Rue)) quand la
"
+"collection est chargée. <literal>Software</literal> possède une mappe
de "
+"<literal>Version</literal>s dont la clé est le
<literal>codeName</literal>"
+"(nom de code) de la <literal>Version</literal>. "
+
+#. Tag: para
+#: entity.xml:995
+#, no-c-format
+msgid ""
+"Unless the collection is a generic, you will have to define "
+"<literal>targetEntity</literal>. This is a annotation attribute that
take "
+"the target entity class as a value."
+msgstr ""
+"A moins que la collection soit générique, vous devrez déterminer "
+"<literal>targetEntity</literal>. Il s'agit d'un attribut
d'annotation qui "
+"prend la classe de l'entité cible comme valeur."
+
+#. Tag: title
+#: entity.xml:1002
+#, no-c-format
+msgid "One-to-many"
+msgstr "One-to-many"
+
+#. Tag: para
+#: entity.xml:1004
+#, no-c-format
+msgid ""
+"One-to-many associations are declared at the property level with the "
+"annotation <literal>@OneToMany</literal>. One to many associations may
be "
+"bidirectional."
+msgstr ""
+"Les associations one-to-many sont déclarées au niveau de la propriété par "
+"l'annotation <literal>@OneToMany</literal>. Les associations
one-to-may "
+"peuvent être bidirectionnelles."
+
+#. Tag: sect4
+#: entity.xml:1006
+#, no-c-format
+msgid ""
+"<sect5> <title>Bidirectional</title> <para>Since many to
one are (almost) "
+"always the owner side of a bidirectional relationship in the EJB3 spec, the "
+"one to many association is annotated by <literal>@OneToMany( mappedBy=...
)</"
+"literal></para> <programlisting>@Entity\n"
+"public class Troop {\n"
+" @OneToMany(mappedBy=\"troop\")\n"
+" public Set<Soldier> getSoldiers() {\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Soldier {\n"
+" @ManyToOne\n"
+" @JoinColumn(name=\"troop_fk\")\n"
+" public Troop getTroop() {\n"
+" ...\n"
+"} </programlisting>
<para><classname>Troop</classname> has a "
+"bidirectional one to many relationship with <literal>Soldier</literal>
"
+"through the <literal>troop</literal> property. You don't have to
(must not) "
+"define any physical mapping in the <literal>mappedBy</literal>
side.</para> "
+"<para>To map a bidirectional one to many, with the one-to-many side as the
"
+"owning side, you have to remove the <literal>mappedBy</literal> element
and "
+"set the many to one <literal>@JoinColumn</literal> as insertable and
"
+"updatable to false. This solution is obviously not optimized and will "
+"produce some additional UPDATE statements.</para>
<programlisting>@Entity\n"
+"public class Troop {\n"
+" @OneToMany\n"
+" @JoinColumn(name=\"troop_fk\") //we need to duplicate the physical
"
+"information\n"
+" public Set<Soldier> getSoldiers() {\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Soldier {\n"
+" @ManyToOne\n"
+" @JoinColumn(name=\"troop_fk\", insertable=false,
updatable=false)\n"
+" public Troop getTroop() {\n"
+" ...\n"
+"}</programlisting> </sect5> <sect5>
<title>Unidirectional</title> <para>A "
+"unidirectional one to many using a foreign key column in the owned entity is
"
+"not that common and not really recommended. We strongly advise you to use a "
+"join table for this kind of association (as explained in the next section). "
+"This kind of association is described through a
<literal>@JoinColumn</"
+"literal></para> <programlisting>\n"
+"@Entity\n"
+"public class Customer implements Serializable {\n"
+" @OneToMany(cascade=CascadeType.ALL, fetch=FetchType.EAGER)\n"
+" @JoinColumn(name=\"CUST_ID\")\n"
+" public Set<Ticket> getTickets() {\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Ticket implements Serializable {\n"
+" ... //no bidir\n"
+"}\n"
+" </programlisting>
<para><literal>Customer</literal> describes "
+"a unidirectional relationship with <literal>Ticket</literal> using the
join "
+"column <literal>CUST_ID</literal>.</para> </sect5>
<sect5> "
+"<title>Unidirectional with join table</title> <para>A
unidirectional one to "
+"many with join table is much preferred. This association is described "
+"through an <literal>(a)JoinTable</literal>.</para>
<programlisting>\n"
+"@Entity\n"
+"public class Trainer {\n"
+" @OneToMany\n"
+" @JoinTable(\n"
+" name=\"TrainedMonkeys\",\n"
+" joinColumns = @JoinColumn( name=\"trainer_id\"),\n"
+" inverseJoinColumns = @JoinColumn(
name=\"monkey_id\")\n"
+" )\n"
+" public Set<Monkey> getTrainedMonkeys() {\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Monkey {\n"
+" ... //no bidir\n"
+"}\n"
+" </programlisting>
<para><literal>Trainer</literal> describes "
+"a unidirectional relationship with <classname>Monkey</classname> using
the "
+"join table <classname>TrainedMonkeys</classname>, with a foreign key
"
+"<literal>trainer_id</literal> to <literal>Trainer</literal>
"
+"(<literal>joinColumns</literal>) and a foreign key
<literal>monkey_id</"
+"literal> to <literal>Monkey</literal>
(<literal>inversejoinColumns</"
+"literal>).</para> </sect5> <sect5
id=\"entity-mapping-association-collection-"
+"manytomany-default\" revision=\"1\">
<title>Defaults</title> <para>Without "
+"describing any physical mapping, a unidirectional one to many with join "
+"table is used. The table name is the concatenation of the owner table name, "
+"<keycap>_</keycap>, and the other side table name. The foreign key
name(s) "
+"referencing the owner table is the concatenation of the owner table, "
+"<keycap>_</keycap>, and the owner primary key column(s) name. The
foreign "
+"key name(s) referencing the other side is the concatenation of the owner "
+"property name, <keycap>_</keycap>, and the other side primary key
column(s) "
+"name. A unique constraint is added to the foreign key referencing the other "
+"side table to reflect the one to many.</para> <programlisting>\n"
+"@Entity\n"
+"public class Trainer {\n"
+" @OneToMany\n"
+" public Set<Tiger> getTrainedTigers() {\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Tiger {\n"
+" ... //no bidir\n"
+"}\n"
+" </programlisting>
<para><classname>Trainer</classname> "
+"describes a unidirectional relationship with
<classname>Tiger</classname> "
+"using the join table <literal>Trainer_Tiger</literal>, with a foreign
key "
+"<literal>trainer_id</literal> to <literal>Trainer</literal>
(table name, "
+"<keycap>_</keycap>, trainer id) and a foreign key
<literal>trainedTigers_id</"
+"literal> to <literal>Monkey</literal> (property name,
<keycap>_</keycap>, "
+"Tiger primary column).</para> </sect5>"
+msgstr ""
+"<sect5><title>Bidirectionel</title> <para> "
+"Comme la plupart des many to one sont (presque) toujours le côté "
+"propriétaire d'une relation bidirectionnelle dans la spec EJB3, "
+"l'association many-to-one est annotée avec <literal>@OneToMany"
+"( mappedBy=... )</literal> </para>
<programlisting>@Entity\n"
+"public class Troop {\n"
+" @OneToMany(mappedBy=\"troop\")\n"
+" public Set<Soldier> getSoldiers() {\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Soldier {\n"
+" @ManyToOne\n"
+" @JoinColumn(name=\"troop_fk\")\n"
+" public Troop getTroop() {\n"
+" ...\n"
+"} </programlisting> </sect5> <sect5>
<title>Unidirectional</title> <para> a une relation "
+"bidirectionnelle one to many avec <literal>Soldier</literal> par la
"
+"propriété <literal>troop</literal>. Vous n'avez pas (dutout) besoin
de "
+"déterminer un mappage physique du côté <literal>mappedBy</literal>.
</para> "
+"<para> Pour mapper une association bidirectionnelle one to many, avec le
"
+"côté one-to-many en tant que côté possédant, vous devez retirer l'élément
"
+"<literal>mappedBy</literal> et paramétrer le many to one "
+"<literal>@JoinColumn</literal> comme insérable et pouvant être mis Ã
jour à "
+"false. Cette solution n'est franchement pas optimisée et produira quelques
"
+"ennoncés UPDATE supplémentaires. </para>
<programlisting>@Entity\n"
+"public class Troop {\n"
+" @OneToMany\n"
+" @JoinColumn(name=\"troop_fk\") //we need to duplicate the physical
"
+"information\n"
+" public Set<Soldier> getSoldiers() {\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Soldier {\n"
+" @ManyToOne\n"
+" @JoinColumn(name=\"troop_fk\", insertable=false,
updatable=false)\n"
+" public Troop getTroop() {\n"
+" ...\n"
+"}\n"
+"</programlisting> </sect5><sect5
id=\"One_to_many-Unidirectional"
+"\"><title>Unidirectional</title> <para> Une association
unidirectionnelle "
+"one to many qui utilise une colonne de clés étrangères dans l'entité "
+"possédée n'est pas si commune et pas vraiment recommandée. Nous vous "
+"conseillons fortement d'utiliser une table de jointure pour ce genre "
+"d'associations (comme expliqué dans la prochaine section). Ce genre "
+"d'association est décrit dans un <literal>@JoinColumn</literal>
</para> "
+"<programlisting>\n"
+"@Entity\n"
+"public class Customer implements Serializable {\n"
+" @OneToMany(cascade=CascadeType.ALL, fetch=FetchType.EAGER)\n"
+" @JoinColumn(name=\"CUST_ID\")\n"
+" public Set<Ticket> getTickets() {\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Ticket implements Serializable {\n"
+" ... //no bidir\n"
+"}\n"
+" \n"
+"</programlisting> <para> <literal>Customer</literal> décrit
une relation "
+"unidirectionnelle avec <literal>Ticket</literal> en utilisant la
colonne de "
+"jointure <literal>CUST_ID</literal>. </para>
</sect5><sect5 id=\"One_to_many-"
+"Unidirectional_with_join_table\"><title>Unidirectionnel avec table de
"
+"jointure</title> <para> Une association unidirectionnelle one to many
avec "
+"table de jointure est bien plus souhaitable. Cette association est décrite "
+"dans <literal>@JoinTable</literal>. </para>
<programlisting>\n"
+"@Entity\n"
+"public class Trainer {\n"
+" @OneToMany\n"
+" @JoinTable(\n"
+" name=\"TrainedMonkeys\",\n"
+" joinColumns = { @JoinColumn( name=\"trainer_id\") },\n"
+" inverseJoinColumns = @JoinColumn(
name=\"monkey_id\")\n"
+" )\n"
+" public Set<Monkey> getTrainedMonkeys() {\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Monkey {\n"
+" ... //no bidir\n"
+"}\n"
+" \n"
+"</programlisting> <para> <literal>Trainer</literal> décrit
une relation "
+"unidirectionnelle avec <classname>Monkey</classname> en utilisant la
table "
+"de jointure <classname>TrainedMonkeys</classname>, avec une clé
étrangère "
+"<literal>trainer_id</literal> pour
<literal>Trainer</literal> "
+"(<literal>joinColumns</literal>) et une clé étrangère
<literal>monkey_id</"
+"literal> pour <literal>Monkey</literal>
(<literal>inversejoinColumns</"
+"literal>). </para> </sect5><title>Defaults</title>
<para> Si on ne décrit pas <sect5
id=\"entity-mapping-association-collection-manytomany-defa.ult\"
revision=\"1\">de mappage physique, "
+"une association unidirectionnelle one-to-many avec table de jointure est "
+"utilisée. Le nom de la table est la concaténation du nom de la table de "
+"propriétaire, <keycap>_</keycap>, associé au nom de ou des colonnes de
clés "
+"primaires de l'autre partie. Il y a une contrainte qui se rajoute à la clé
"
+"étrangère qui référence la table de l'autre partie pour refléter one-to-"
+"many. </para> <programlisting>\n"
+"@Entity\n"
+"public class Trainer {\n"
+" @OneToMany\n"
+" public Set<Tiger> getTrainedTigers() {\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Tiger {\n"
+" ... //no bidir\n"
+"}\n"
+" \n"
+"</programlisting> <para> <classname>Trainer</classname>
décrit une relation "
+"unidirectionnelle avec <classname>Tiger</classname> utilisant la table
de "
+"jointure <literal>Trainer_Tiger</literal>, avec une clé étrangère
"
+"<literal>trainer_id</literal> pour
<literal>Trainer</literal> (table name, "
+"<keycap>_</keycap>, trainer id) et une clé étrangère "
+"<literal>trainedTigers_id</literal> pour
<literal>Monkey</literal> (nom de propriété, <keycap>_</keycap>,
colonne primaire Tiger). </para> </sect5>"
+
+#. Tag: title
+#: entity.xml:1099
+#, no-c-format
+msgid "Many-to-many"
+msgstr "Many-to-many"
+
+#. Tag: sect4
+#: entity.xml:1099
+#, no-c-format
+msgid ""
+"<sect5> <title>Definition</title> <para>A many-to-many
association is "
+"defined logically using the <literal>@ManyToMany</literal> annotation.
You "
+"also have to describe the association table and the join conditions using "
+"the <literal>@JoinTable</literal> annotation. If the association is
"
+"bidirectional, one side has to be the owner and one side has to be the "
+"inverse end (ie. it will be ignored when updating the relationship values in
"
+"the association table):</para> <programlisting>\n"
+"@Entity\n"
+"public class Employer implements Serializable {\n"
+" @ManyToMany(\n"
+"
targetEntity=org.hibernate.test.metadata.manytomany.Employee.class,\n"
+" cascade={CascadeType.PERSIST, CascadeType.MERGE}\n"
+" )\n"
+" @JoinTable(\n"
+" name=\"EMPLOYER_EMPLOYEE\",\n"
+" joinColumns=@JoinColumn(name=\"EMPER_ID\"),\n"
+" inverseJoinColumns=@JoinColumn(name=\"EMPEE_ID\")\n"
+" )\n"
+" public Collection getEmployees() {\n"
+" return employees;\n"
+" }\n"
+" ...\n"
+"}\n"
+" </programlisting> <programlisting>\n"
+"@Entity\n"
+"public class Employee implements Serializable {\n"
+" @ManyToMany(\n"
+" cascade = {CascadeType.PERSIST, CascadeType.MERGE},\n"
+" mappedBy = \"employees\",\n"
+" targetEntity = Employer.class\n"
+" )\n"
+" public Collection getEmployers() {\n"
+" return employers;\n"
+" }\n"
+"}\n"
+" </programlisting> <para>We've already shown the many
"
+"declarations and the detailed attributes for associations. We'll go deeper
"
+"in the <literal>@JoinTable</literal> description, it defines a "
+"<literal>name</literal>, an array of join columns (an array in
annotation is "
+"defined using { A, B, C }), and an array of inverse join columns. The latter
"
+"ones are the columns of the association table which refer to the "
+"<classname>Employee</classname> primary key (the \"other
side\").</para> "
+"<para>As seen previously, the other side don't have to (must not)
describe "
+"the physical mapping: a simple <literal>mappedBy</literal> argument
"
+"containing the owner side property name bind the two.</para> </sect5>
"
+"<sect5> <title>Default values</title> <para>As any other
annotations, most "
+"values are guessed in a many to many relationship. Without describing any "
+"physical mapping in a unidirectional many to many the following rules "
+"applied. The table name is the concatenation of the owner table name, "
+"<keycap>_</keycap> and the other side table name. The foreign key
name(s) "
+"referencing the owner table is the concatenation of the owner table name, "
+"<keycap>_</keycap> and the owner primary key column(s). The foreign key
name"
+"(s) referencing the other side is the concatenation of the owner property "
+"name, <keycap>_</keycap>, and the other side primary key column(s).
These "
+"are the same rules used for a unidirectional one to many relationship.</"
+"para> <programlisting>\n"
+"@Entity\n"
+"public class Store {\n"
+" @ManyToMany(cascade = CascadeType.PERSIST)\n"
+" public Set<City> getImplantedIn() {\n"
+" ...\n"
+" }\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class City {\n"
+" ... //no bidirectional relationship\n"
+"}\n"
+" </programlisting> <para>A
<literal>Store_City</literal> is "
+"used as the join table. The <literal>Store_id</literal> column is a
foreign "
+"key to the <literal>Store</literal> table. The
<literal>implantedIn_id</"
+"literal> column is a foreign key to the <literal>City</literal>
table.</"
+"para> <para>Without describing any physical mapping in a bidirectional
many "
+"to many the following rules applied. The table name is the concatenation of "
+"the owner table name, <keycap>_</keycap> and the other side table name.
The "
+"foreign key name(s) referencing the owner table is the concatenation of the "
+"other side property name, <keycap>_</keycap>, and the owner primary key
"
+"column(s). The foreign key name(s) referencing the other side is the "
+"concatenation of the owner property name, <keycap>_</keycap>, and the
other "
+"side primary key column(s). These are the same rules used for a "
+"unidirectional one to many relationship.</para>
<programlisting>\n"
+"@Entity\n"
+"public class Store {\n"
+" @ManyToMany(cascade = {CascadeType.PERSIST, CascadeType.MERGE})\n"
+" public Set<Customer> getCustomers() {\n"
+" ...\n"
+" }\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Customer {\n"
+" @ManyToMany(mappedBy=\"customers\")\n"
+" public Set<Store> getStores() {\n"
+" ...\n"
+" }\n"
+"}\n"
+" </programlisting> <para>A
<literal>Store_Customer</literal> "
+"is used as the join table. The <literal>stores_id</literal> column is a
"
+"foreign key to the <literal>Store</literal> table. The "
+"<literal>customers_id</literal> column is a foreign key to the "
+"<literal>Customer</literal> table.</para> </sect5>"
+msgstr ""
+"<sect5><title>Definition</title> <para> Une "
+"association many-to-many est définie logiquement en utilisant l'association
"
+"<literal>@ManyToMany</literal>. Vous avez également besoin de décrire
la "
+"table d'associations et les condition de jointure en utilisant l'annotation
"
+"<literal>@JoinTable</literal>. Si l'association est
bidirectionnelle, une "
+"des parties sera le propriétaire et l'autre l'inverse (c'est à dire
qu'il "
+"sera ignoré quand on mettra à jour les valeurs de la relation dans la table "
+"d'associations) :</para> <programlisting>\n"
+"@Entity\n"
+"public class Employer implements Serializable {\n"
+" @ManyToMany(\n"
+"
targetEntity=org.hibernate.test.metadata.manytomany.Employee.class,\n"
+" cascade={CascadeType.PERSIST, CascadeType.MERGE}\n"
+" )\n"
+" @JoinTable(\n"
+" name=\"EMPLOYER_EMPLOYEE\",\n"
+" joinColumns={@JoinColumn(name=\"EMPER_ID\")},\n"
+" inverseJoinColumns={@JoinColumn(name=\"EMPEE_ID\")}\n"
+" )\n"
+" public Collection getEmployees() {\n"
+" return employees;\n"
+" }\n"
+" ...\n"
+"}\n"
+" \n"
+"</programlisting> <programlisting>\n"
+"@Entity\n"
+"public class Employee implements Serializable {\n"
+" @ManyToMany(\n"
+" cascade={CascadeType.PERSIST, CascadeType.MERGE},\n"
+" mappedBy=\"employees\"\n"
+" targetEntity=Employer.class\n"
+" )\n"
+" public Collection getEmployers() {\n"
+" return employers;\n"
+" }\n"
+"}\n"
+" \n"
+"</programlisting> <para> Nous avons déjà montré les nombreuses
déclarations "
+"et les attributs en détails des associations. Nous allons aller plus loin "
+"dans la description <literal>@JoinTable</literal>. Elle détermine un
"
+"<literal>name</literal>, un tableau de colonnes jointes (un tableau
"
+"d'annotations est défini en utilisant { A, B, C }), et un tableau de "
+"colonnes jointes en sens inverse. Ces dernières sont les colonnes de la "
+"table d'association qui se rapporte à la clé primaire
d'<classname>Employee</"
+"classname> (l\" \"autre partie\"). </para> <para>
Comme nous l'avons vu "
+"précédemment, l'autre partie de doit (surtout) pas décrire le mappage "
+"physique : un argument simple <literal>mappedBy</literal> qui contient
le "
+"nom de propriété du côté propriétaire relie les deux. </para>
</sect5><sect5 "
+"id=\"Many_to_many-Default_values\"><title>Default
values</title> <para> Tout "
+"comme n'importe quelle annotation, la plupart des valeurs sont devinées dans
"
+"une relation many-to-many. Sans décrire un mappage physique dans un "
+"unidirectionnel many-to-many, les règles suivantes s'appliquent. Le nom de
"
+"la table est la concaténation du nom de la table du propriétaire,
<keycap>_</"
+"keycap>, et du nom de la table de l'autre côté. Le(s) nom(s) de clé(s)
"
+"étrangère(s) faisant référence à la table du propriétaire est la "
+"concaténation du nom de la table du propriétaire, <keycap>_</keycap> et
de "
+"la ou des colonne(s) de la clé primaire du propriétaire. Le (les) nom(s) de "
+"(des) clé(s) étrangère(s) référençant l'autre côté est la concaténation du
"
+"nom de propriété du propriétaire, <keycap>_</keycap>, et de la (des)
colonne"
+"(s) de la clé primaire de l'autre côté. Les règles appliquées sont les mêmes
"
+"que celles qui sont appliquées pour les relations unidirectionnelles one-to-"
+"may. </para> <programlisting>\n"
+"@Entity\n"
+"public class Store {\n"
+" @ManyToMany(cascade = CascadeType.PERSIST)\n"
+" public Set<City> getImplantedIn() {\n"
+" ...\n"
+" }\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class City {\n"
+" ... //no bidirectional relationship\n"
+"}\n"
+" \n"
+"</programlisting> <para> Un <literal>Store_City</literal>
est utilisé comme "
+"table de jointure. La colonne <literal>Store_id</literal> est une clé
"
+"étrangère pour la table <literal>Store</literal>. La colonne "
+"<literal>implantedIn_id</literal> est une clé érangère pour la table
"
+"<literal>City</literal>. </para> <para> Sans pour autant
décrire le mappage "
+"physique d'une association bidirectionnelle many-to-many, les règles "
+"suivantes s'appliquent. Le nom de la table est la concaténation du nom de la
"
+"table du propriétaire, <keycap>_</keycap> et du nom de la table de
l'autre "
+"côté. Le(s) nom(s) de clé(s) étrangère(s) référençant la table du "
+"propriétaire, est la concaténation du nom de la propriété de l'autre côté,
"
+"<keycap>_</keycap>, et de la (des) colonne(s) de la clé primaire du
"
+"propriétaire. Le(s) nom(s) de clé(s) étrangère(s) référençant l'autre côté
"
+"est la concaténation du nom de propriété du propriétaire,
<keycap>_</"
+"keycap>, et de la (des) colonnes de clé(s) primaire(s) de l'autre côté. Les
"
+"règles appliquées sont les mêmes que celles qui sont appliquées pour les "
+"relations unidirectionnelles one-to-may. </para>
<programlisting>\n"
+"@Entity\n"
+"public class Store {\n"
+" @ManyToMany(cascade = {CascadeType.PERSIST, CascadeType.MERGE})\n"
+" public Set<Customer> getCustomers() {\n"
+" ...\n"
+" }\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Customer {\n"
+" @ManyToMany(mappedBy=\"customers\")\n"
+" public Set<Store> getStores() {\n"
+" ...\n"
+" }\n"
+"}\n"
+" \n"
+"</programlisting> <para> Un
<literal>Store_Customer</literal> est utilié "
+"comme table de jointure. La colonne <literal>stores_id</literal> est
une clé "
+"étrangère pour la table <literal>Store</literal>. La colonne "
+"<literal>customers_id</literal> est une clé étrangère pour la table
"
+"<literal>Customer</literal>. </para> </sect5>"
+
+#. Tag: title
+#: entity.xml:1177
+#, no-c-format
+msgid "Transitive persistence with cascading"
+msgstr "Persistance transitive avec cascading"
+
+#. Tag: para
+#: entity.xml:1179
+#, no-c-format
+msgid ""
+"You probably have noticed the <literal>cascade</literal> attribute
taking an "
+"array of <classname>CascadeType</classname> as a value. The cascade
concept "
+"in EJB3 is very is similar to the transitive persistence and cascading of "
+"operations in Hibernate, but with slightly different semantics and cascading
"
+"types:"
+msgstr ""
+"Vous avez probablement remarqué que l'attribut
<literal>cascade</literal> "
+"prend comme valeur des éléments de <classname>CascadeType</classname>.
Le "
+"concept cascade d'EJB3 est très similaire à celui de la persistance et de la
"
+"cascade d'opérations dans Hibernate, mais avec des types de cascades et de
"
+"sémantiques différents :"
+
+#. Tag: para
+#: entity.xml:1187
+#, no-c-format
+msgid ""
+"CascadeType.PERSIST: cascades the persist (create) operation to associated "
+"entities persist() is called or if the entity is managed"
+msgstr ""
+"CascadeType.PERSIST: cascade l'opération persist (create) pour les entités
"
+"vers lesquelles persist est appelé ou si l'entité est gérée."
+
+#. Tag: para
+#: entity.xml:1192
+#, no-c-format
+msgid ""
+"CascadeType.MERGE: cascades the merge operation to associated entities if "
+"merge() is called or if the entity is managed"
+msgstr ""
+"CascadeType.MERGE: cascade l'opération merge (fusionnement) pour les entités
"
+"associées si merge() est appelé ou si l'entité est gérée."
+
+#. Tag: para
+#: entity.xml:1197
+#, no-c-format
+msgid ""
+"CascadeType.REMOVE: cascades the remove operation to associated entities if "
+"delete() is called"
+msgstr ""
+"CascadeType.REMOVE: cascade l'opération remove (suppression) pour les "
+"entités associées si delete() est appelé."
+
+#. Tag: para
+#: entity.xml:1202
+#, no-c-format
+msgid ""
+"CascadeType.REFRESH: cascades the refresh operation to associated entities "
+"if refresh() is called"
+msgstr ""
+"CascadeType.REFRESH: cascade l'opération refresh (de rafraichissement) pour
"
+"les entités associées si refresh() est appelé."
+
+#. Tag: para
+#: entity.xml:1207
+#, no-c-format
+msgid "CascadeType.ALL: all of the above"
+msgstr "CascadeType.ALL: tous les cas à la fois"
+
+#. Tag: para
+#: entity.xml:1213
+#, no-c-format
+msgid ""
+"CascadeType.ALL also covers Hibernate specific operations like save-update, "
+"lock etc... Check <xref linkend=\"entity-hibspec-cascade\"/> for
more "
+"information"
+msgstr ""
+"CascadeType.ALL couvre aussi les opérations Hibernate telle que save-update,
"
+"lock etc... Voir <xref linkend=\"entity-hibspec-cascade\"/> pour en
savoir plus."
+
+#. Tag: para
+#: entity.xml:1218
+#, no-c-format
+msgid ""
+"Please refer to the chapter 6.3 of the EJB3 specification for more "
+"information on cascading and create/merge semantics."
+msgstr ""
+"Veuillez-vous rapporter au chapitre 6.3 de la spécification EJB3 pour "
+"davantage d'informations sur les sémantiques de cascading et de
create/merge."
+
+#. Tag: title
+#: entity.xml:1223
+#, no-c-format
+msgid "Association fetching"
+msgstr "Récupération d'associations"
+
+#. Tag: para
+#: entity.xml:1225
+#, no-c-format
+msgid ""
+"You have the ability to either eagerly or lazily fetch associated entities. "
+"The <literal>fetch</literal> parameter can be set to
<literal>FetchType."
+"LAZY</literal> or <literal>FetchType.EAGER</literal>.
<literal>EAGER</"
+"literal> will try to use an outer join select to retrieve the associated "
+"object, while <literal>LAZY</literal> will only trigger a select when
the "
+"associated object is accessed for the first time.
<literal>@OneToMany</"
+"literal> and <literal>@ManyToMany</literal> associations are
defaulted to "
+"<literal>LAZY</literal> and <literal>@OneToOne</literal>
and "
+"<literal>@ManyToOne</literal> are defaulted to
<literal>EAGER</literal>. For "
+"more information about static fetching, check <xref
linkend=\"entity-hibspec-"
+"singleassoc-fetching\"/>."
+msgstr ""
+"Vous avez la possibilité de récupérer les entités associées soit facilement,
"
+"soit à la demande. Le paramètre <literal>fetch</literal>peut être fixé
à "
+"<literal>FetchType.LAZY</literal> ou bien Ã
<literal>FetchType.EAGER</"
+"literal>. <literal>EAGER</literal> essaiera d'utiliser un outer
join select "
+"pour récupérer l'objet associé, tandis que <literal>LAZY</literal>
ne "
+"déclenchera select que quand on accède à l'objet associé pour la première
"
+"fois. Les associations <literal>@OneToMany</literal> et "
+"<literal>@ManyToMany</literal> sont par défaut
<literal>LAZY</literal> ou "
+"<literal>@OneToOne</literal> et
<literal>@ManyToOne</literal> est par défaut "
+"<literal>EAGER</literal>. Pour davantage d'informations sur la
récupération "
+"statique, veuillez consulter <xref
linkend=\"entity-hibspec-singleassoc-fetching\"/>."
+
+#. Tag: para
+#: entity.xml:1238
+#, no-c-format
+msgid ""
+"The recommanded approach is to use <literal>LAZY</literal> onn all
static "
+"fetching definitions and override this choice dynamically through JPA-QL. "
+"JPA-QL has a <literal>fetch</literal> keyword that allows you to
override "
+"laziness when doing a particular query. This is very useful to improve "
+"performance and is decided on a use case to use case basis."
+msgstr ""
+"L'approche qui est recommandée est d'utiliser
<literal>LAZY</literal> sur "
+"toutes les définitons de récupération statiques et de supprimer ce choix "
+"dynamiquement pr JPA-QL. JPA-QL contient un mot clé
<literal>fetch</literal> "
+"(récupérer) qui vous permet de surcharger le caractère \"à la demande\"
pour "
+"une recherche particulière. Cela est très utile pour améliorer la "
+"performance et c'est décidé au cas par cas."
+
+#. Tag: title
+#: entity.xml:1248
+#, no-c-format
+msgid "Mapping composite primary and foreign keys"
+msgstr "La mappage des clés étrangères et des clés primaires composites"
+
+#. Tag: para
+#: entity.xml:1250
+#, no-c-format
+msgid ""
+"Composite primary keys use a embedded class as the primary key "
+"representation, so you'd use the <literal>@Id</literal> and "
+"<literal>@Embeddable</literal> annotations. Alternatively, you can use
the "
+"<literal>@EmbeddedId</literal> annotation. Note that the dependent
class has "
+"to be serializable and implements
<methodname>equals()</methodname>/"
+"<methodname>hashCode()</methodname>. You can also use
<literal>@IdClass</"
+"literal> as described in <xref
linkend=\"entity-mapping-identifier\"/>."
+msgstr ""
+"Les clés primaires composites utilisent une classe imbriquée pour la "
+"représentation de la clé primaire, donc vous devez utiliser les annotations "
+"<literal>@Id</literal> et <literal>@Embeddable</literal>.
Sinon, vous pouvez "
+"utiliser l'annotation <literal>@EmbeddedId</literal>. Notez que la
classe "
+"dépendante doit être sérializable et qu'elle doit implémenter "
+"<methodname>equals()</methodname>/<methodname>hashCode()</methodname>.
Vous "
+"pouvez également utiliser <literal>@IdClass</literal> comme c'est
décrit "
+"dans <xref linkend=\"entity-mapping-identifier\"/>."
+
+#. Tag: programlisting
+#: entity.xml:1259
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class RegionalArticle implements Serializable {\n"
+"\n"
+" @Id\n"
+" public RegionalArticlePk getPk() { ... }\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"public class RegionalArticlePk implements Serializable { ... }"
+msgstr ""
+"@Entity\n"
+"public class RegionalArticle implements Serializable {\n"
+"\n"
+" @Id\n"
+" public RegionalArticlePk getPk() { ... }\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"public class RegionalArticlePk implements Serializable { ... }"
+
+#. Tag: para
+#: entity.xml:1261
+#, no-c-format
+msgid "or alternatively"
+msgstr "ou bien"
+
+#. Tag: programlisting
+#: entity.xml:1263
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class RegionalArticle implements Serializable {\n"
+"\n"
+" @EmbeddedId\n"
+" public RegionalArticlePk getPk() { ... }\n"
+"}\n"
+"\n"
+"public class RegionalArticlePk implements Serializable { ... }"
+msgstr ""
+"@Entity\n"
+"public class RegionalArticle implements Serializable {\n"
+"\n"
+" @EmbeddedId\n"
+" public RegionalArticlePk getPk() { ... }\n"
+"}\n"
+"\n"
+"public class RegionalArticlePk implements Serializable { ... }"
+
+#. Tag: para
+#: entity.xml:1265
+#, no-c-format
+msgid ""
+"<literal>@Embeddable</literal> inherit the access type of its owning
entity "
+"unless the Hibernate specific annotation <literal>@AccessType</literal>
is "
+"used. Composite foreign keys (if not using the default sensitive values) are
"
+"defined on associations using the <literal>@JoinColumns</literal>
element, "
+"which is basically an array of <literal>@JoinColumn</literal>. It is
"
+"considered a good practice to express
<literal>referencedColumnNames</"
+"literal> explicitly. Otherwise, Hibernate will suppose that you use the same
"
+"order of columns as in the primary key declaration."
+msgstr ""
+"<literal>@Embeddable</literal> hérite de type d'accès de son
identité "
+"possédante à moins que l'annotation spécifique d'Hibernate "
+"<literal>@AccessType</literal> ne soit utilisée. Les clés étrangères
"
+"composites (qui n'utilisent pas les valeurs sensibles par défaut) sont "
+"définies par des associations utilisant l'élément
<literal>@JoinColumns</"
+"literal>, qui est simplement élement de
<literal>@JoinColumn</literal>. On "
+"considère qu'il est une bonne chose d'exprimer "
+"<literal>referencedColumnNames</literal> explicitement. Sinon,
Hibernate "
+"supposera que vous utilisez le même ordre de colonnes comme dans la "
+"déclaration de la clé primaire."
+
+#. Tag: programlisting
+#: entity.xml:1275
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Parent implements Serializable {\n"
+" @Id\n"
+" public ParentPk id;\n"
+" public int age;\n"
+"\n"
+" @OneToMany(cascade=CascadeType.ALL)\n"
+" @JoinColumns ({\n"
+" @JoinColumn(name=\"parentCivility\", referencedColumnName =
\"isMale"
+"\"),\n"
+" @JoinColumn(name=\"parentLastName\", referencedColumnName =
"
+"\"lastName\"),\n"
+" @JoinColumn(name=\"parentFirstName\", referencedColumnName =
"
+"\"firstName\")\n"
+" })\n"
+" public Set<Child> children; //unidirectional\n"
+" ...\n"
+"}"
+msgstr ""
+"@Entity\n"
+"public class Parent implements Serializable {\n"
+" @Id\n"
+" public ParentPk id;\n"
+" public int age;\n"
+"\n"
+" @OneToMany(cascade=CascadeType.ALL)\n"
+" @JoinColumns ({\n"
+" @JoinColumn(name=\"parentCivility\", referencedColumnName =
\"isMale"
+"\"),\n"
+" @JoinColumn(name=\"parentLastName\", referencedColumnName =
"
+"\"lastName\"),\n"
+" @JoinColumn(name=\"parentFirstName\", referencedColumnName =
"
+"\"firstName\")\n"
+" })\n"
+" public Set<Child> children; //unidirectional\n"
+" ...\n"
+"}"
+
+#. Tag: programlisting
+#: entity.xml:1277
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Child implements Serializable {\n"
+" @Id @GeneratedValue\n"
+" public Integer id;\n"
+"\n"
+" @ManyToOne\n"
+" @JoinColumns ({\n"
+" @JoinColumn(name=\"parentCivility\", referencedColumnName =
\"isMale"
+"\"),\n"
+" @JoinColumn(name=\"parentLastName\", referencedColumnName =
"
+"\"lastName\"),\n"
+" @JoinColumn(name=\"parentFirstName\", referencedColumnName =
"
+"\"firstName\")\n"
+" })\n"
+" public Parent parent; //unidirectional\n"
+"}"
+msgstr ""
+"@Entity\n"
+"public class Child implements Serializable {\n"
+" @Id @GeneratedValue\n"
+" public Integer id;\n"
+"\n"
+" @ManyToOne\n"
+" @JoinColumns ({\n"
+" @JoinColumn(name=\"parentCivility\", referencedColumnName =
\"isMale"
+"\"),\n"
+" @JoinColumn(name=\"parentLastName\", referencedColumnName =
"
+"\"lastName\"),\n"
+" @JoinColumn(name=\"parentFirstName\", referencedColumnName =
"
+"\"firstName\")\n"
+" })\n"
+" public Parent parent; //unidirectional\n"
+"}"
+
+#. Tag: programlisting
+#: entity.xml:1279
+#, no-c-format
+msgid ""
+"@Embeddable\n"
+"public class ParentPk implements Serializable {\n"
+" String firstName;\n"
+" String lastName;\n"
+" ...\n"
+"}"
+msgstr ""
+"@Embeddable\n"
+"public class ParentPk implements Serializable {\n"
+" String firstName;\n"
+" String lastName;\n"
+" ...\n"
+"}"
+
+#. Tag: para
+#: entity.xml:1281
+#, no-c-format
+msgid "Note the explicit usage of the
<literal>referencedColumnName</literal>."
+msgstr "Notez l'usage explicite de
<literal>referencedColumnName</literal>."
+
+#. Tag: title
+#: entity.xml:1286
+#, no-c-format
+msgid "Mapping secondary tables"
+msgstr "Mappage des tables secondaires"
+
+#. Tag: para
+#: entity.xml:1288
+#, no-c-format
+msgid ""
+"You can map a single entity bean to several tables using the "
+"<literal>@SecondaryTable</literal> or
<literal>@SecondaryTables</literal> "
+"class level annotations. To express that a column is in a particular table, "
+"use the <literal>table</literal> parameter of
<literal>@Column</literal> or "
+"<literal>(a)JoinColumn</literal>."
+msgstr ""
+"Vous pouvez mapper un simple bean d'entité sur plusieurs tables en utilisant
"
+"les annotations de niveau de classe <literal>@SecondaryTable</literal>
ou "
+"<literal>@SecondaryTables</literal>. Pour exprimer qu'une colonne
est dans "
+"une table particulière, utiliser le paramètre <literal>table</literal>
de "
+"<literal>@Column</literal> ou de
<literal>(a)JoinColumn</literal>."
+
+#. Tag: programlisting
+#: entity.xml:1295
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Table(name=\"MainCat\")\n"
+"<emphasis role=\"bold\">@SecondaryTables({\n"
+" @SecondaryTable(name=\"Cat1\", pkJoinColumns={\n"
+" @PrimaryKeyJoinColumn(name=\"cat_id\",
referencedColumnName=\"id\")\n"
+" ),\n"
+" @SecondaryTable(name=\"Cat2\",
uniqueConstraints={@UniqueConstraint"
+"(columnNames={\"storyPart2\"})})\n"
+"})</emphasis>\n"
+"public class Cat implements Serializable {\n"
+"\n"
+" private Integer id;\n"
+" private String name;\n"
+" private String storyPart1;\n"
+" private String storyPart2;\n"
+"\n"
+" @Id @GeneratedValue\n"
+" public Integer getId() {\n"
+" return id;\n"
+" }\n"
+"\n"
+" public String getName() {\n"
+" return name;\n"
+" }\n"
+" \n"
+" <emphasis
role=\"bold\">@Column(table=\"Cat1\")</emphasis>\n"
+" public String getStoryPart1() {\n"
+" return storyPart1;\n"
+" }\n"
+"\n"
+" <emphasis
role=\"bold\">@Column(table=\"Cat2\")</emphasis>\n"
+" public String getStoryPart2() {\n"
+" return storyPart2;\n"
+" }"
+msgstr ""
+"@Entity\n"
+"@Table(name=\"MainCat\")\n"
+"<emphasis role=\"bold\">@SecondaryTables({\n"
+" @SecondaryTable(name=\"Cat1\", pkJoinColumns={\n"
+" @PrimaryKeyJoinColumn(name=\"cat_id\",
referencedColumnName=\"id\")\n"
+" ),\n"
+" @SecondaryTable(name=\"Cat2\",
uniqueConstraints={@UniqueConstraint"
+"(columnNames={\"storyPart2\"})})\n"
+"})</emphasis>\n"
+"public class Cat implements Serializable {\n"
+"\n"
+" private Integer id;\n"
+" private String name;\n"
+" private String storyPart1;\n"
+" private String storyPart2;\n"
+"\n"
+" @Id @GeneratedValue\n"
+" public Integer getId() {\n"
+" return id;\n"
+" }\n"
+"\n"
+" public String getName() {\n"
+" return name;\n"
+" }\n"
+" \n"
+" <emphasis
role=\"bold\">@Column(table=\"Cat1\")</emphasis>\n"
+" public String getStoryPart1() {\n"
+" return storyPart1;\n"
+" }\n"
+"\n"
+" <emphasis
role=\"bold\">@Column(table=\"Cat2\")</emphasis>\n"
+" public String getStoryPart2() {\n"
+" return storyPart2;\n"
+" }"
+
+#. Tag: para
+#: entity.xml:1297
+#, no-c-format
+msgid ""
+"In this example, <literal>name</literal> will be in
<literal>MainCat</"
+"literal>. <literal>storyPart1</literal> will be in
<literal>Cat1</literal> "
+"and <literal>storyPart2</literal> will be in
<literal>Cat2</literal>. "
+"<literal>Cat1</literal> will be joined to
<literal>MainCat</literal> using "
+"the <literal>cat_id</literal> as a foreign key, and
<literal>Cat2</literal> "
+"using <literal>id</literal> (ie the same column name, the
<literal>MainCat</"
+"literal> id column has). Plus a unique constraint on
<literal>storyPart2</"
+"literal> has been set."
+msgstr ""
+"Dans cet exemple, <literal>name</literal> sera dans
<literal>MainCat</"
+"literal>. <literal>storyPart1</literal> sera dans
<literal>Cat1</literal> et "
+"<literal>storyPart2</literal> sera dans
<literal>Cat2</literal>. "
+"<literal>Cat1</literal> sera joint Ã
<literal>MainCat</literal> en utilisant "
+"le <literal>cat_id</literal> en tant que clé étrangère, et
<literal>Cat2</"
+"literal> en utilisant <literal>id</literal> (c'est à dire le
même nom de "
+"colonne que la colonne d'identités <literal>MainCat</literal>
possède). De "
+"plus, une contrainte unique a été fixée sur
<literal>storyPart2</literal>."
+
+#. Tag: para
+#: entity.xml:1307
+#, no-c-format
+msgid ""
+"Check out the JBoss EJB 3 tutorial or the Hibernate Annotations unit test "
+"suite for more examples."
+msgstr ""
+"Vérifiez le tutoriel JBoss EJB 3 ou la suite de tests pour l'unité "
+"d'annotations Hibernate pour trouver d'autres exemples."
+
+#. Tag: title
+#: entity.xml:1313
+#, no-c-format
+msgid "Mapping Queries"
+msgstr "Requêtes mappage"
+
+#. Tag: title
+#: entity.xml:1317
+#, no-c-format
+msgid "Mapping JPAQL/HQL queries"
+msgstr "Mappage des requêtes JPAQL/HQL "
+
+#. Tag: para
+#: entity.xml:1319
+#, no-c-format
+msgid ""
+"You can map EJBQL/HQL queries using annotations.
<literal>@NamedQuery</"
+"literal> and <literal>@NamedQueries</literal> can be defined at the
class "
+"level or in a JPA XML file. However their definitions are global to the "
+"session factory/entity manager factory scope. A named query is defined by "
+"its name and the actual query string."
+msgstr ""
+"Vous pouvez mapper les requêtes EJBQL/HQL en utilisant les annotations. "
+"<literal>@NamedQuery</literal> et
<literal>@NamedQueries</literal> peuvent "
+"être définies au niveau de la classe ou bien dans le fichier JPA XML. "
+"Cependant, leurs définitions sont globales au niveau des usines de gestion "
+"des entités / usines de sessions. Une recherche intitulée se définit par un "
+"nom et par la chaine de la demande."
+
+#. Tag: programlisting
+#: entity.xml:1326
+#, no-c-format
+msgid ""
+"<entity-mappings>\n"
+" <named-query name=\"plane.getAll\">\n"
+" <query>select p from Plane p</query>\n"
+" </named-query>\n"
+" ...\n"
+"</entity-mappings>\n"
+"...\n"
+"\n"
+"@Entity\n"
+"(a)NamedQuery(name=\"night.moreRecentThan\", query=\"select n from
Night n "
+"where n.date >= :date\")\n"
+"public class Night {\n"
+" ...\n"
+"}\n"
+"\n"
+"public class MyDao {\n"
+" doStuff() {\n"
+" Query q = s.getNamedQuery(\"night.moreRecentThan\");\n"
+" q.setDate( \"date\", aMonthAgo );\n"
+" List results = q.list();\n"
+" ...\n"
+" }\n"
+" ...\n"
+"}"
+msgstr ""
+"<entity-mappings>\n"
+" <named-query name=\"plane.getAll\">\n"
+" <query>select p from Plane p</query>\n"
+" </named-query>\n"
+" ...\n"
+"</entity-mappings>\n"
+"...\n"
+"\n"
+"@Entity\n"
+"(a)NamedQuery(name=\"night.moreRecentThan\", query=\"select n from
Night n "
+"where n.date >= :date\")\n"
+"public class Night {\n"
+" ...\n"
+"}\n"
+"\n"
+"public class MyDao {\n"
+" doStuff() {\n"
+" Query q = s.getNamedQuery(\"night.moreRecentThan\");\n"
+" q.setDate( \"date\", aMonthAgo );\n"
+" List results = q.list();\n"
+" ...\n"
+" }\n"
+" ...\n"
+"}"
+
+#. Tag: para
+#: entity.xml:1328
+#, no-c-format
+msgid ""
+"You can also provide some hints to a query through an array of "
+"<literal>QueryHint</literal> through a
<literal>hints</literal> attribute."
+msgstr ""
+"Vous pouvez également procurer des éléments de requête par des éléments de "
+"<literal>QueryHint</literal> par un attribut
<literal>hints</literal>."
+
+#. Tag: para
+#: entity.xml:1332
+#, no-c-format
+msgid "The availabe Hibernate hints are"
+msgstr "Les élements de recherche disponibles d'Hibernate sont :"
+
+#. Tag: title
+#: entity.xml:1337
+#, no-c-format
+msgid "Query hints"
+msgstr "Query hints (élements de recherche)"
+
+#. Tag: entry
+#: entity.xml:1346
+#, no-c-format
+msgid "hint"
+msgstr "hint (éléments)"
+
+#. Tag: entry
+#: entity.xml:1348
+#, no-c-format
+msgid "description"
+msgstr "description"
+
+#. Tag: entry
+#: entity.xml:1354
+#, no-c-format
+msgid "org.hibernate.cacheable"
+msgstr "org.hibernate.cacheable"
+
+#. Tag: entry
+#: entity.xml:1356
+#, no-c-format
+msgid ""
+"Whether the query should interact with the second level cache (defualt to "
+"false)"
+msgstr ""
+"Est-ce que la requête doit opérer au deuxième niveau cache (valeur par "
+"défaut false)"
+
+#. Tag: entry
+#: entity.xml:1361
+#, no-c-format
+msgid "org.hibernate.cacheRegion"
+msgstr "org.hibernate.cacheRegion"
+
+#. Tag: entry
+#: entity.xml:1363
+#, no-c-format
+msgid "Cache region name (default used otherwise)"
+msgstr "Nom de région cache (valeur par défaut utilisée sinon)"
+
+#. Tag: entry
+#: entity.xml:1367
+#, no-c-format
+msgid "org.hibernate.timeout"
+msgstr "org.hibernate.timeout"
+
+#. Tag: entry
+#: entity.xml:1369
+#, no-c-format
+msgid "Query timeout"
+msgstr "Timeout de la requête"
+
+#. Tag: entry
+#: entity.xml:1373
+#, no-c-format
+msgid "org.hibernate.fetchSize"
+msgstr "org.hibernate.fetchSize"
+
+#. Tag: entry
+#: entity.xml:1375
+#, no-c-format
+msgid "resultset fetch size"
+msgstr "taille du résultat récupéré"
+
+#. Tag: entry
+#: entity.xml:1379
+#, no-c-format
+msgid "org.hibernate.flushMode"
+msgstr "org.hibernate.flushMode"
+
+#. Tag: entry
+#: entity.xml:1381
+#, no-c-format
+msgid "Flush mode used for this query"
+msgstr "Mode flush utilisé pour cette requête"
+
+#. Tag: entry
+#: entity.xml:1385
+#, no-c-format
+msgid "org.hibernate.cacheMode"
+msgstr "org.hibernate.cacheMode"
+
+#. Tag: entry
+#: entity.xml:1387
+#, no-c-format
+msgid "Cache mode used for this query"
+msgstr "Mode cache utilisé pour cette requête"
+
+#. Tag: entry
+#: entity.xml:1391
+#, no-c-format
+msgid "org.hibernate.readOnly"
+msgstr "org.hibernate.readOnly"
+
+#. Tag: entry
+#: entity.xml:1393
+#, no-c-format
+msgid ""
+"Entities loaded by this query should be in read only mode or not (default to
"
+"false)"
+msgstr ""
+"Les entités chargées de cette demande doivent être en lecture-seule ou non "
+"(valeur par défaut false)"
+
+#. Tag: entry
+#: entity.xml:1398
+#, no-c-format
+msgid "org.hibernate.comment"
+msgstr "org.hibernate.comment"
+
+#. Tag: entry
+#: entity.xml:1400
+#, no-c-format
+msgid "Query comment added to the generated SQL"
+msgstr "Commentaire de demande ajouté au SQL généré"
+
+#. Tag: title
+#: entity.xml:1408
+#, no-c-format
+msgid "Mapping native queries"
+msgstr "Mappage des demandes natives"
+
+#. Tag: para
+#: entity.xml:1410
+#, no-c-format
+msgid ""
+"You can also map a native query (ie a plain SQL query). To achieve that, you
"
+"need to describe the SQL resultset structure using "
+"<literal>@SqlResultSetMapping</literal> (or
<literal>@SqlResultSetMappings</"
+"literal> if you plan to define several resulset mappings). Like "
+"<literal>@NamedQuery</literal>, a
<literal>@SqlResultSetMapping</literal> "
+"can be defined at class level or in a JPA XML file. However its scope is "
+"global to the application."
+msgstr ""
+"Vous pouvez également mapper une demande native (c'est à dire une demande
"
+"simple SQL). Pour cela, vous aurez besoin de décrire la structure du "
+"résultat SQL, en utilisant <literal>@SqlResultSetMapping</literal> (ou
"
+"<literal>@SqlResultSetMappings</literal> si vous planifiez de définir
"
+"plusieurs mappages de resultsets). Comme
<literal>@NamedQuery</literal>, un "
+"<literal>@SqlResultSetMapping</literal> peut être défini au niveau
classe ou "
+"dans un fichier JPA XML. Cependant il porte sur toute l'application."
+
+#. Tag: para
+#: entity.xml:1419
+#, no-c-format
+msgid ""
+"As we will see, a <literal>resultSetMapping</literal> parameter is
defined "
+"in <literal>@NamedNativeQuery</literal>, it represents the name of a
defined "
+"<literal>@SqlResultSetMapping</literal>. The resultset mapping declares
the "
+"entities retrieved by this native query. Each field of the entity is bound "
+"to an SQL alias (or column name). All fields of the entity including the "
+"ones of subclasses and the foreign key columns of related entities have to "
+"be present in the SQL query. Field definitions are optional provided that "
+"they map to the same column name as the one declared on the class property."
+msgstr ""
+"Comme vous pourrez l'observer, un paramètre
<literal>resultSetMapping</"
+"literal> est défini dans <literal>@NamedNativeQuery</literal>; il
représente "
+"le nom d'un <literal>@SqlResultSetMapping</literal> déterminé. Le
mappage du "
+"resultset déclare les entités récupérées par cette demande native. Chaque "
+"champ de l'entité est lié à un alias SQL (ou un nom de colonne). Tous les
"
+"champs de l'entité, y compris ceux des sous-classes ou ceux des colonnes de
"
+"clés étrangères d'entités liées, doivent être présents dans la demande SQL.
"
+"Les définitions de champs sont optionnelles dans la mesure où elles mappent "
+"le même nom de colonne que celui qui est déclaré sur la propriété de la "
+"classe."
+
+#. Tag: programlisting
+#: entity.xml:1429
+#, no-c-format
+msgid ""
+"@NamedNativeQuery(name=\"night&area\", query=\"select
night.id nid, "
+"night.night_duration, \"\n"
+" + \" night.night_date, area.id aid, night.area_id, area.name
\"\n"
+" + \"from Night night, Area area where night.area_id = area.id\",
"
+"<emphasis\n"
+"
role=\"bold\">resultSetMapping=\"joinMapping\"</emphasis>)\n"
+"@SqlResultSetMapping(name=\"joinMapping\", entities={\n"
+" @EntityResult(entityClass=org.hibernate.test.annotations.query.Night."
+"class, fields = {\n"
+" @FieldResult(name=\"id\", column=\"nid\"),\n"
+" @FieldResult(name=\"duration\",
column=\"night_duration\"),\n"
+" @FieldResult(name=\"date\",
column=\"night_date\"),\n"
+" @FieldResult(name=\"area\",
column=\"area_id\"),\n"
+" discriminatorColumn=\"disc\"\n"
+" }),\n"
+" @EntityResult(entityClass=org.hibernate.test.annotations.query.Area."
+"class, fields = {\n"
+" @FieldResult(name=\"id\", column=\"aid\"),\n"
+" @FieldResult(name=\"name\", column=\"name\")\n"
+" })\n"
+" }\n"
+")"
+msgstr ""
+"@NamedNativeQuery(name=\"night&area\", query=\"select
night.id nid, "
+"night.night_duration, \"\n"
+" + \" night.night_date, area.id aid, night.area_id, area.name
\"\n"
+" + \"from Night night, Area area where night.area_id = area.id\",
"
+"<emphasis\n"
+"
role=\"bold\">resultSetMapping=\"joinMapping\"</emphasis>)\n"
+"@SqlResultSetMapping(name=\"joinMapping\", entities={\n"
+" @EntityResult(entityClass=org.hibernate.test.annotations.query.Night."
+"class, fields = {\n"
+" @FieldResult(name=\"id\", column=\"nid\"),\n"
+" @FieldResult(name=\"duration\",
column=\"night_duration\"),\n"
+" @FieldResult(name=\"date\",
column=\"night_date\"),\n"
+" @FieldResult(name=\"area\",
column=\"area_id\"),\n"
+" discriminatorColumn=\"disc\"\n"
+" }),\n"
+" @EntityResult(entityClass=org.hibernate.test.annotations.query.Area."
+"class, fields = {\n"
+" @FieldResult(name=\"id\", column=\"aid\"),\n"
+" @FieldResult(name=\"name\", column=\"name\")\n"
+" })\n"
+" }\n"
+")"
+
+#. Tag: para
+#: entity.xml:1431
+#, no-c-format
+msgid ""
+"In the above example, the <literal>night&area</literal> named
query use "
+"the <literal>joinMapping</literal> result set mapping. This mapping
returns "
+"2 entities, <literal>Night</literal> and
<literal>Area</literal>, each "
+"property is declared and associated to a column name, actually the column "
+"name retrieved by the query. Let's now see an implicit declaration of the
"
+"property / column."
+msgstr ""
+"Dans l'exemple ci-dessus, la demande intitulée
<literal>night&area</"
+"literal> utilise le mappage de resultset
<literal>joinMapping</literal>. Ce "
+"mappage retourne deux entités, <literal>Night</literal> et
<literal>Area</"
+"literal>, chaque entité étant déclarée et associée à un nom de colonne, en
"
+"fait, le nom de colonne récupéré associé à la recherche. Voyons maintenant "
+"une déclaration implicite de propriété / colonne."
+
+#. Tag: programlisting
+#: entity.xml:1438
+#, no-c-format
+msgid ""
+"@Entity\n"
+"<emphasis
role=\"bold\">@SqlResultSetMapping(name=\"implicit\", "
+"entities=(a)EntityResult(entityClass=org.hibernate.test.annotations.query."
+"SpaceShip.class))\n"
+"@NamedNativeQuery(name=\"implicitSample\", query=\"select * from
SpaceShip"
+"\", resultSetMapping=\"implicit\")</emphasis>\n"
+"public class SpaceShip {\n"
+" private String name;\n"
+" private String model;\n"
+" private double speed;\n"
+"\n"
+" @Id\n"
+" public String getName() {\n"
+" return name;\n"
+" }\n"
+"\n"
+" public void setName(String name) {\n"
+" this.name = name;\n"
+" }\n"
+"\n"
+" @Column(name=\"model_txt\")\n"
+" public String getModel() {\n"
+" return model;\n"
+" }\n"
+"\n"
+" public void setModel(String model) {\n"
+" this.model = model;\n"
+" }\n"
+"\n"
+" public double getSpeed() {\n"
+" return speed;\n"
+" }\n"
+"\n"
+" public void setSpeed(double speed) {\n"
+" this.speed = speed;\n"
+" }\n"
+"}"
+msgstr ""
+"@Entity\n"
+"<emphasis
role=\"bold\">@SqlResultSetMapping(name=\"implicit\", "
+"entities=(a)EntityResult(entityClass=org.hibernate.test.annotations.query."
+"SpaceShip.class))\n"
+"@NamedNativeQuery(name=\"implicitSample\", query=\"select * from
SpaceShip"
+"\", resultSetMapping=\"implicit\")</emphasis>\n"
+"public class SpaceShip {\n"
+" private String name;\n"
+" private String model;\n"
+" private double speed;\n"
+"\n"
+" @Id\n"
+" public String getName() {\n"
+" return name;\n"
+" }\n"
+"\n"
+" public void setName(String name) {\n"
+" this.name = name;\n"
+" }\n"
+"\n"
+" @Column(name=\"model_txt\")\n"
+" public String getModel() {\n"
+" return model;\n"
+" }\n"
+"\n"
+" public void setModel(String model) {\n"
+" this.model = model;\n"
+" }\n"
+"\n"
+" public double getSpeed() {\n"
+" return speed;\n"
+" }\n"
+"\n"
+" public void setSpeed(double speed) {\n"
+" this.speed = speed;\n"
+" }\n"
+"}"
+
+#. Tag: para
+#: entity.xml:1440
+#, no-c-format
+msgid ""
+"In this example, we only describe the entity member of the result set "
+"mapping. The property / column mappings is done using the entity mapping "
+"values. In this case the <literal>model</literal> property is bound to
the "
+"<literal>model_txt </literal>column. If the association to a related
entity "
+"involve a composite primary key, a <literal>@FieldResult</literal>
element "
+"should be used for each foreign key column. The
<literal>@FieldResult</"
+"literal> name is composed of the property name for the relationship, "
+"followed by a dot (\".\"), followed by the name or the field or property
of "
+"the primary key."
+msgstr ""
+"Dans cet exemple, nous ne décrivons que le membre de l'entité du mappage du
"
+"resultset. Les mappages propriété/colonne sont effectués à partir des "
+"valeurs de mappage d'entités. Dans ce cas, la propriété
<literal>model</"
+"literal> est liée à la colonne <literal>model_txt </literal>. Si
"
+"l'association à une entité liée implique une clé primaire composite, un "
+"élément <literal>@FieldResult</literal> devra être utilisé pour chaque
"
+"colonne de clé étrangère. Le nom <literal>@FieldResult</literal> est
composé "
+"du nom de propriété de la relation, suivi par un point (\".\"), suivi par
le "
+"nom ou le champ ou la propriété de la clé primaire."
+
+#. Tag: programlisting
+#: entity.xml:1450
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@SqlResultSetMapping(name=\"compositekey\",\n"
+" entities=(a)EntityResult(entityClass=org.hibernate.test.annotations."
+"query.SpaceShip.class,\n"
+" fields = {\n"
+" @FieldResult(name=\"name\", column =
\"name\"),\n"
+" @FieldResult(name=\"model\", column =
\"model\"),\n"
+" @FieldResult(name=\"speed\", column =
\"speed\"),\n"
+"<emphasis role=\"bold\">
@FieldResult(name=\"captain."
+"firstname\", column = \"firstn\"),\n"
+" @FieldResult(name=\"captain.lastname\", column =
\"lastn"
+"\"),</emphasis>\n"
+" @FieldResult(name=\"dimensions.length\", column =
"
+"\"length\"),\n"
+" @FieldResult(name=\"dimensions.width\", column =
\"width"
+"\")\n"
+" }),\n"
+" columns = { @ColumnResult(name = \"surface\"),\n"
+" @ColumnResult(name = \"volume\") } )\n"
+"\n"
+"@NamedNativeQuery(name=\"compositekey\",\n"
+" query=\"select name, model, speed, lname as lastn, fname as firstn,
"
+"length, width, length * width as surface from SpaceShip\", \n"
+" resultSetMapping=\"compositekey\")\n"
+"} )\n"
+"public class SpaceShip {\n"
+" private String name;\n"
+" private String model;\n"
+" private double speed;\n"
+" private Captain captain;\n"
+" private Dimensions dimensions;\n"
+"\n"
+" @Id\n"
+" public String getName() {\n"
+" return name;\n"
+" }\n"
+"\n"
+" public void setName(String name) {\n"
+" this.name = name;\n"
+" }\n"
+"\n"
+" @ManyToOne(fetch= FetchType.LAZY)\n"
+" @JoinColumns( {\n"
+" @JoinColumn(name=\"fname\", referencedColumnName =
\"firstname"
+"\"),\n"
+" @JoinColumn(name=\"lname\", referencedColumnName =
\"lastname"
+"\")\n"
+" } )\n"
+" public Captain getCaptain() {\n"
+" return captain;\n"
+" }\n"
+"\n"
+" public void setCaptain(Captain captain) {\n"
+" this.captain = captain;\n"
+" }\n"
+"\n"
+" public String getModel() {\n"
+" return model;\n"
+" }\n"
+"\n"
+" public void setModel(String model) {\n"
+" this.model = model;\n"
+" }\n"
+"\n"
+" public double getSpeed() {\n"
+" return speed;\n"
+" }\n"
+"\n"
+" public void setSpeed(double speed) {\n"
+" this.speed = speed;\n"
+" }\n"
+"\n"
+" public Dimensions getDimensions() {\n"
+" return dimensions;\n"
+" }\n"
+"\n"
+" public void setDimensions(Dimensions dimensions) {\n"
+" this.dimensions = dimensions;\n"
+" }\n"
+"}\n"
+"\n"
+"@Entity\n"
+"(a)IdClass(Identity.class)\n"
+"public class Captain implements Serializable {\n"
+" private String firstname;\n"
+" private String lastname;\n"
+"\n"
+" @Id\n"
+" public String getFirstname() {\n"
+" return firstname;\n"
+" }\n"
+"\n"
+" public void setFirstname(String firstname) {\n"
+" this.firstname = firstname;\n"
+" }\n"
+"\n"
+" @Id\n"
+" public String getLastname() {\n"
+" return lastname;\n"
+" }\n"
+"\n"
+" public void setLastname(String lastname) {\n"
+" this.lastname = lastname;\n"
+" }\n"
+"}"
+msgstr ""
+"@Entity\n"
+"@SqlResultSetMapping(name=\"compositekey\",\n"
+" entities=(a)EntityResult(entityClass=org.hibernate.test.annotations."
+"query.SpaceShip.class,\n"
+" fields = {\n"
+" @FieldResult(name=\"name\", column =
\"name\"),\n"
+" @FieldResult(name=\"model\", column =
\"model\"),\n"
+" @FieldResult(name=\"speed\", column =
\"speed\"),\n"
+"<emphasis role=\"bold\">
@FieldResult(name=\"captain."
+"firstname\", column = \"firstn\"),\n"
+" @FieldResult(name=\"captain.lastname\", column =
\"lastn"
+"\"),</emphasis>\n"
+" @FieldResult(name=\"dimensions.length\", column =
"
+"\"length\"),\n"
+" @FieldResult(name=\"dimensions.width\", column =
\"width"
+"\")\n"
+" }),\n"
+" columns = { @ColumnResult(name = \"surface\"),\n"
+" @ColumnResult(name = \"volume\") } )\n"
+"\n"
+"@NamedNativeQuery(name=\"compositekey\",\n"
+" query=\"select name, model, speed, lname as lastn, fname as firstn,
"
+"length, width, length * width as surface from SpaceShip\", \n"
+" resultSetMapping=\"compositekey\")\n"
+"} )\n"
+"public class SpaceShip {\n"
+" private String name;\n"
+" private String model;\n"
+" private double speed;\n"
+" private Captain captain;\n"
+" private Dimensions dimensions;\n"
+"\n"
+" @Id\n"
+" public String getName() {\n"
+" return name;\n"
+" }\n"
+"\n"
+" public void setName(String name) {\n"
+" this.name = name;\n"
+" }\n"
+"\n"
+" @ManyToOne(fetch= FetchType.LAZY)\n"
+" @JoinColumns( {\n"
+" @JoinColumn(name=\"fname\", referencedColumnName =
\"firstname"
+"\"),\n"
+" @JoinColumn(name=\"lname\", referencedColumnName =
\"lastname"
+"\")\n"
+" } )\n"
+" public Captain getCaptain() {\n"
+" return captain;\n"
+" }\n"
+"\n"
+" public void setCaptain(Captain captain) {\n"
+" this.captain = captain;\n"
+" }\n"
+"\n"
+" public String getModel() {\n"
+" return model;\n"
+" }\n"
+"\n"
+" public void setModel(String model) {\n"
+" this.model = model;\n"
+" }\n"
+"\n"
+" public double getSpeed() {\n"
+" return speed;\n"
+" }\n"
+"\n"
+" public void setSpeed(double speed) {\n"
+" this.speed = speed;\n"
+" }\n"
+"\n"
+" public Dimensions getDimensions() {\n"
+" return dimensions;\n"
+" }\n"
+"\n"
+" public void setDimensions(Dimensions dimensions) {\n"
+" this.dimensions = dimensions;\n"
+" }\n"
+"}\n"
+"\n"
+"@Entity\n"
+"(a)IdClass(Identity.class)\n"
+"public class Captain implements Serializable {\n"
+" private String firstname;\n"
+" private String lastname;\n"
+"\n"
+" @Id\n"
+" public String getFirstname() {\n"
+" return firstname;\n"
+" }\n"
+"\n"
+" public void setFirstname(String firstname) {\n"
+" this.firstname = firstname;\n"
+" }\n"
+"\n"
+" @Id\n"
+" public String getLastname() {\n"
+" return lastname;\n"
+" }\n"
+"\n"
+" public void setLastname(String lastname) {\n"
+" this.lastname = lastname;\n"
+" }\n"
+"}"
+
+#. Tag: para
+#: entity.xml:1453
+#, no-c-format
+msgid ""
+"If you look at the dimension property, you'll see that Hibernate supports
"
+"the dotted notation for embedded objects (you can even have nested embedded "
+"objects). EJB3 implementations do not have to support this feature, we do
:-)"
+msgstr ""
+"Si vous observez la propriété de dimension, vous verrez qu'Hibernate "
+"supporte la notation en pointillés pour les objets imbriqués (vous pouvez "
+"même avoir des objets imbriqués). Les implémentations EJB3 n'ont pas besoin
"
+"de prendre en charge cette structure, mais nous le faisons :-) "
+
+#. Tag: para
+#: entity.xml:1459
+#, no-c-format
+msgid ""
+"If you retrieve a single entity and if you use the default mapping, you can "
+"use the <literal>resultClass</literal> attribute instead of "
+"<literal>resultSetMapping</literal>:"
+msgstr ""
+"Si vous récupérez une simple entité et que vous utilisez le mappage par "
+"défaut, vous pourrez utiliser l'attribut
<literal>resultClass</literal> au "
+"lieu de <literal>resultSetMapping</literal> :"
+
+#. Tag: programlisting
+#: entity.xml:1463
+#, no-c-format
+msgid ""
+"<emphasis
role=\"bold\">@NamedNativeQuery(name=\"implicitSample\",
query="
+"\"select * from SpaceShip\", \n"
+" resultClass=SpaceShip.class)</emphasis>\n"
+"public class SpaceShip {"
+msgstr ""
+"<emphasis
role=\"bold\">@NamedNativeQuery(name=\"implicitSample\",
query="
+"\"select * from SpaceShip\", \n"
+" resultClass=SpaceShip.class)</emphasis>\n"
+"public class SpaceShip {"
+
+#. Tag: para
+#: entity.xml:1465
+#, no-c-format
+msgid ""
+"In some of your native queries, you'll have to return scalar values, for
"
+"example when building report queries. You can map them in the "
+"<literal>@SqlResultsetMapping</literal> through
<literal>@ColumnResult</"
+"literal>. You actually can even mix, entities and scalar returns in the same
"
+"native query (this is probably not that common though)."
+msgstr ""
+"Dans certaines demandes natives, vous devrez retourner les valeurs "
+"scalaires, par exemple, quand vous construisez les demandes de rapport. Vous
"
+"pourrez les mapper dans <literal>@SqlResultsetMapping</literal> par
"
+"<literal>@ColumnResult</literal>. Vous pourrez même mixer les entrées
"
+"scalaires avec les entités dans une même demande native (malgré que ce ne "
+"soit pas commun). "
+
+#. Tag: programlisting
+#: entity.xml:1472
+#, no-c-format
+msgid ""
+"<emphasis
role=\"bold\">@SqlResultSetMapping(name=\"scalar\", "
+"columns=@ColumnResult(name=\"dimension\"))\n"
+"@NamedNativeQuery(name=\"scalar\", query=\"select length*width as
dimension "
+"from SpaceShip\",
resultSetMapping=\"scalar\")</emphasis>"
+msgstr ""
+"<emphasis
role=\"bold\">@SqlResultSetMapping(name=\"scalar\", "
+"columns=@ColumnResult(name=\"dimension\"))\n"
+"@NamedNativeQuery(name=\"scalar\", query=\"select length*width as
dimension "
+"from SpaceShip\",
resultSetMapping=\"scalar\")</emphasis>"
+
+#. Tag: para
+#: entity.xml:1474
+#, no-c-format
+msgid ""
+"An other query hint specific to native queries has been introduced: "
+"<literal>org.hibernate.callable</literal> which can be true or false
"
+"depending on whether the query is a stored procedure or not."
+msgstr ""
+"On a introduit un nouvel élément spécifique pour les requêtes natives : "
+"<literal>org.hibernate.callable</literal> qui peut être true ou false
selon "
+"que la demande est une procédure stockée ou non."
+
+#. Tag: title
+#: entity.xml:1482
+#, no-c-format
+msgid "Hibernate Annotation Extensions"
+msgstr "Extensions d'annotations Hibernate"
+
+#. Tag: para
+#: entity.xml:1484
+#, no-c-format
+msgid ""
+"Hibernate 3.1 offers a variety of additional annotations that you can mix/"
+"match with your EJB 3 entities. They have been designed as a natural "
+"extension of EJB3 annotations."
+msgstr ""
+"Hibernate 3.1 propose un ensemble d'annotations supplémentaires que vous
"
+"pourrez mixer/et faire correspondre à vos entités EJB3. Elles ont été "
+"conçues en tant qu'extensions nalurelles des annotations EJB3."
+
+#. Tag: para
+#: entity.xml:1488
+#, no-c-format
+msgid ""
+"To empower the EJB3 capabilities, hibernate provides specific annotations "
+"that match hibernate features. The
<classname>org.hibernate.annotations</"
+"classname> package contains all these annotations extensions."
+msgstr ""
+"Pour augmenter les possibilités d'EJB3, hibernate fournit des annotations
"
+"particulières qui correspondent aux fonctionnalités hibernate. Le paquetage "
+"<classname>org.hibernate.annotations</classname> contient toutes ces
"
+"extensions d'annotations."
+
+#. Tag: title
+#: entity.xml:1494
+#, no-c-format
+msgid "Entity"
+msgstr "Entité"
+
+#. Tag: para
+#: entity.xml:1496
+#, no-c-format
+msgid ""
+"You can fine tune some of the actions done by Hibernate on entities beyond "
+"what the EJB3 spec offers."
+msgstr ""
+"Vous pouvez sophistiquer certaines actions effectuées par Hiberante sur les "
+"entités au delà de ce que les spec EJB peuvent offrir."
+
+#. Tag: para
+#: entity.xml:1499
+#, no-c-format
+msgid ""
+"<classname>(a)org.hibernate.annotations.Entity</classname> adds
additional "
+"metadata that may be needed beyond what is defined in the standard "
+"<literal>@Entity</literal>"
+msgstr ""
+"<classname>(a)org.hibernate.annotations.Entity</classname> ajoute des
"
+"métadonnées supplémentaires qui peuvent être utiles au delà de ce qui peut "
+"être défini par le standard <literal>@Entity</literal>"
+
+#. Tag: para
+#: entity.xml:1503
+#, no-c-format
+msgid "mutable: whether this entity is mutable or not"
+msgstr "mutable: si l'entité est mutable ou non"
+
+#. Tag: para
+#: entity.xml:1508
+#, no-c-format
+msgid "dynamicInsert: allow dynamic SQL for inserts"
+msgstr "dynamicInsert: permet des SQL dynamiques pour les insertions"
+
+#. Tag: para
+#: entity.xml:1513
+#, no-c-format
+msgid "dynamicUpdate: allow dynamic SQL for updates"
+msgstr "dynamicUpdate: permet les SQL dynamiques pour les mises à jour"
+
+#. Tag: para
+#: entity.xml:1518
+#, no-c-format
+msgid ""
+"selectBeforeUpdate: Specifies that Hibernate should never perform an SQL "
+"UPDATE unless it is certain that an object is actually modified."
+msgstr ""
+"selectBeforeUpdate: Spécifie qu'Hibernate ne doit pas effectuer de MISE A
"
+"JOUR SQL à moins qu'il soit certain qu'un objet ait bien été
modifié."
+
+#. Tag: para
+#: entity.xml:1523
+#, no-c-format
+msgid ""
+"polymorphism: whether the entity polymorphism is of PolymorphismType."
+"IMPLICIT (default) or PolymorphismType.EXPLICIT"
+msgstr ""
+"polymorphism: détermine si l'entité polymorphism est de type
Polymorphism."
+"IMPLICIT (pr défaut) ou PolymorphismType.EXPLICIT"
+
+#. Tag: para
+#: entity.xml:1528
+#, no-c-format
+msgid ""
+"optimisticLock: optimistic locking strategy (OptimisticLockType.VERSION, "
+"OptimisticLockType.NONE, OptimisticLockType.DIRTY or OptimisticLockType.ALL)"
+msgstr ""
+"optimisticLock: stratégie de verrouillage optimiste (OptimisticLockType."
+"VERSION, OptimisticLockType.NONE, OptimisticLockType.DIRTY ou "
+"OptimisticLockType.ALL)"
+
+#. Tag: para
+#: entity.xml:1534
+#, no-c-format
+msgid ""
+"(a)javax.persistence.Entity is still mandatory, @org.hibernate.annotations."
+"Entity is not a replacement."
+msgstr ""
+"(a)javax.persistence.Entity est toujours de rigueur, @org.hibernate."
+"annotations.Entity n'est par un remplacement."
+
+#. Tag: para
+#: entity.xml:1538
+#, no-c-format
+msgid "Here are some additional Hibernate annotation extensions"
+msgstr "Voici quelques une des extensions d'annotations Hibernate
supplémentaires"
+
+#. Tag: para
+#: entity.xml:1540
+#, no-c-format
+msgid ""
+"<literal>(a)org.hibernate.annotations.BatchSize</literal> allows you to
define "
+"the batch size when fetching instances of this entity ( eg. "
+"<literal>@BatchSize(size=4)</literal> ). When loading a given entity,
"
+"Hibernate will then load all the uninitialized entities of the same type in "
+"the persistence context up to the batch size."
+msgstr ""
+"<literal>(a)org.hibernate.annotations.BatchSize</literal> vous permet de
"
+"déterminer la taille du batch quand vous récupérez les instances de cette "
+"identité (par exemple. <literal>@BatchSize(size=4)</literal> ). Quand
vous "
+"chargez une identité donnée, Hibernate chargera alors toutes les entités du "
+"même type non initialisées dans le contexte de persistence jusqu'à la taille
"
+"du batch."
+
+#. Tag: para
+#: entity.xml:1546
+#, no-c-format
+msgid ""
+"<literal>(a)org.hibernate.annotations.Proxy</literal> defines the
laziness "
+"attributes of the entity. lazy (default to true) define whether the class is
"
+"lazy or not. proxyClassName is the interface used to generate the proxy "
+"(default is the class itself)."
+msgstr ""
+"<literal>(a)org.hibernate.annotations.Proxy</literal> définit les
attributs de "
+"laziness de l'entité. Lazy (true par défaut) détermine si la classe est lazy
"
+"ou pas. proxyClassName est l'interface utilisée pour générer le proxy (la
"
+"valeur par défaut est la classe elle-même)."
+
+#. Tag: para
+#: entity.xml:1551
+#, no-c-format
+msgid ""
+"<literal>(a)org.hibernate.annotations.Where</literal> defines an optional
SQL "
+"WHERE clause used when instances of this class is retrieved."
+msgstr ""
+"<literal>(a)org.hibernate.annotations.Where</literal> détermine une
clause SQL "
+"WHERE qui est utilisée quand les intances de cette classe sont récupérées."
+
+#. Tag: para
+#: entity.xml:1555
+#, no-c-format
+msgid ""
+"<literal>(a)org.hibernate.annotations.Check</literal> defines an optional
"
+"check constraints defined in the DDL statetement."
+msgstr ""
+"<literal>(a)org.hibernate.annotations.Check</literal> définit des
contraintes "
+"de vérification optionnelle, définie dans l'énoncé DDL. "
+
+#. Tag: para
+#: entity.xml:1558
+#, no-c-format
+msgid ""
+"<literal>(a)OnDelete(action=OnDeleteAction.CASCADE)</literal> on joined
"
+"subclasses: use a SQL cascade delete on deletion instead of the regular "
+"Hibernate mechanism."
+msgstr ""
+"<literal>(a)OnDelete(action=OnDeleteAction.CASCADE)</literal> sur les
sous-"
+"classes jointes : utiliser 'SQL cascade delete' pour la suppression à la
"
+"place du mécanisme habituel d'Hibernate."
+
+#. Tag: para
+#: entity.xml:1562
+#, no-c-format
+msgid ""
+"<literal>@Table(appliesTo=\"tableName\", indexes = {
@Index(name=\"index1\", "
+"columnNames={\"column1\", \"column2\"} ) } )</literal>
creates the defined "
+"indexes on the columns of table <literal>tableName</literal>. This can
be "
+"applied on the primary table or any secondary table. The
<literal>@Tables</"
+"literal> annotation allows your to apply indexes on different tables. This
"
+"annotation is expected where
<literal>(a)javax.persistence.Table</literal> or "
+"<literal>(a)javax.persistence.SecondaryTable</literal>(s) occurs."
+msgstr ""
+"<literal>@Table(appliesTo=\"tableName\", indexes = {
@Index(name=\"index1\", "
+"columnNames={\"column1\", \"column2\"} ) } )</literal>
crée les index "
+"déterminés par les colonnes de la table <literal>tableName</literal>.
Cela "
+"peut s'appliquer sur la table primaire ou sur n'importe quelle table
"
+"secondaire. L'annotation <literal>@Tables</literal> vous permet
d'appliquer "
+"des index sur les différentes tables. On s'attend à cette annotation est
"
+"attendue quand on rencontre <literal>(a)javax.persistence.Table</literal>
ou "
+"bien <literal>(a)javax.persistence.SecondaryTable</literal>."
+
+#. Tag: para
+#: entity.xml:1572
+#, no-c-format
+msgid ""
+"<literal>(a)org.hibernate.annotations.Table</literal> is a complement,
not a "
+"replacement to <literal>(a)javax.persistence.Table</literal>. Especially,
if "
+"you want to change the default name of a table, you must use
<literal>(a)javax."
+"persistence.Table</literal>, not
<literal>(a)org.hibernate.annotations.Table</"
+"literal>."
+msgstr ""
+"<literal>(a)org.hibernate.annotations.Table</literal> est un complément,
et "
+"non pas un remplacement de <literal>(a)javax.persistence.Table</literal>.
"
+"Surtout, si vous souhaitez changer le nom par défaut d'une table, vous "
+"devrez utiliser <literal>(a)javax.persistence.Table</literal>, et non pas
"
+"<literal>(a)org.hibernate.annotations.Table</literal>."
+
+#. Tag: para
+#: entity.xml:1580
+#, no-c-format
+msgid ""
+"<literal>(a)org.hibernate.annotations.Table</literal> can also be used to
"
+"define the following elements of secondary tables:"
+msgstr "<literal>(a)org.hibernate.annotations.Table</literal> peut
également être utilisé pour définir les éléments suivants de tables secondaires :"
+
+#. Tag: para
+#: entity.xml:1585
+#, no-c-format
+msgid ""
+"<literal>fetch</literal>: If set to JOIN, the default, Hibernate will
use an "
+"inner join to retrieve a secondary table defined by a class or its "
+"superclasses and an outer join for a secondary table defined by a subclass. "
+"If set to select then Hibernate will use a sequential select for a secondary
"
+"table defined on a subclass, which will be issued only if a row turns out to
"
+"represent an instance of the subclass. Inner joins will still be used to "
+"retrieve a secondary defined by the class and its superclasses."
+msgstr ""
+"<literal>FETCH</literal>: Si définie sur JOIN, la valeur par défaut,
Hibernate utilisera une jointure interne pour récupérer une table secondaire définie par
une classe ou par ses superclasses et une jointure externe pour une table secondaire
définie par une sous-classe. "
+"Si défini pour sélectionner, Hibernate utilisera une sélection séquentielle pour
une table secondaire définie sur une sous-classe, qui sera délivrée que si une ligne
s'avère représenter une instance de la sous-classe. Les jointures internes seront
toujours utilisées pour récupérer un secondaire défini par la classe et ses
superclasses."
+
+#. Tag: para
+#: entity.xml:1597
+#, no-c-format
+msgid ""
+"<literal>inverse</literal>: If true, Hibernate will not try to insert
or "
+"update the properties defined by this join. Default to false."
+msgstr "<literal>inverse</literal>: Si la valeur est true, Hibernate ne
tentera pas d'insérer ou de mettre à jour les propriétés définies par cette jointure.
Par défaut sur false."
+
+#. Tag: para
+#: entity.xml:1603
+#, no-c-format
+msgid ""
+"<literal>optional</literal>: If enabled (the default), Hibernate will
insert "
+"a row only if the properties defined by this join are non-null and will "
+"always use an outer join to retrieve the properties."
+msgstr "<literal>optional</literal>: Si activée (valeur par défaut),
Hibernate insère une ligne uniquement si les propriétés définies par cette jointure sont
non null et utiliseront toujours une jointure externe pour récupérer les
propriétés."
+
+#. Tag: para
+#: entity.xml:1610
+#, no-c-format
+msgid ""
+"<literal>foreignKey</literal>: defines the Foreign Key name of a
secondary "
+"table pointing back to the primary table."
+msgstr "<literal>foreignKey</literal>: définit le nom de clé étrangère
d'une table secondaire pointant vers la table primaire."
+
+#. Tag: para
+#: entity.xml:1615
+#, no-c-format
+msgid ""
+"<literal>@Immutable</literal> marks an entity or collection as
immutable. An "
+"immutable entity may not be updated by the application. This allows "
+"Hibernate to make some minor performance optimizations. Updates to an "
+"immutable entity will be ignored, but no exception is thrown. "
+"<literal>@Immutable</literal> must be used on root entities only.
"
+"<literal>@Immutable</literal> placed on a collection makes the
collection "
+"immutable, meaning additions and deletions to and from the collection are "
+"not allowed. A <literal>HibernateException</literal> is thrown in this
case."
+msgstr ""
+"<literal>@ Immuable</literal> marque une entité ou de collection comme
immuable. Une entité immuable peut ne pas être mise à jour par l'application. Cela
permet à Hibernate de faire certaines optimisations de performances mineures. Les mises Ã
jour à une entité immuable seront ignorées, mais aucune exception ne sera levée. "
+"<literal>@ Immuable</literal> doit être utilisé sur les entités de la
racine uniquement. "
+"<literal>@ Immuable</literal> placé sur une collection rend la
collection immuable, c'est à dire que les ajouts et les suppressions à partir de et
vers la collection ne sont pas autorisées. Une exception
<literal>HibernateException</literal> est levée dans ce cas."
+
+#. Tag: para
+#: entity.xml:1625
+#, no-c-format
+msgid ""
+"<literal>@Persister</literal> lets you define your own custom
persistence "
+"strategy. You may, for example, specify your own subclass of
<classname>org."
+"hibernate.persister.EntityPersister</classname> or you might even provide a
"
+"completely new implementation of the interface <literal>org.hibernate."
+"persister.ClassPersister</literal> that implements persistence via, for
"
+"example, stored procedure calls, serialization to flat files or LDAP."
+msgstr ""
+"<literal>@ Persister</literal> vous permet de définir votre propre
stratégie de persistance personnalisée. Vous pouvez, par exemple, spécifier votre propre
sous-classe de <classname>org."
+"hibernate.persister.EntityPersister</classname> ou vous pouvez même fournir
une implémentation totalement nouvelle de l'interface
<literal>org.hibernate."
+"persister.ClassPersister</literal> qui implémente la persistance via, par
exemple, les appels de procédure stockés, la sérialisation de fichiers plats ou
LDAP"
+
+#. Tag: programlisting
+#: entity.xml:1633
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@BatchSize(size=5)\n"
+"(a)org.hibernate.annotations.Entity(\n"
+" selectBeforeUpdate = true,\n"
+" dynamicInsert = true, dynamicUpdate = true,\n"
+" optimisticLock = OptimisticLockType.ALL,\n"
+" polymorphism = PolymorphismType.EXPLICIT)\n"
+"@Where(clause=\"1=1\")\n"
+"(a)org.hibernate.annotations.Table(name=\"Forest\", indexes = {
@Index(name="
+"\"idx\", columnNames = { \"name\", \"length\" } ) }
)\n"
+"(a)Persister(impl=MyEntityPersister.class)\n"
+"public class Forest { ... }"
+msgstr ""
+"@Entity\n"
+"@BatchSize(size=5)\n"
+"(a)org.hibernate.annotations.Entity(\n"
+" selectBeforeUpdate = true,\n"
+" dynamicInsert = true, dynamicUpdate = true,\n"
+" optimisticLock = OptimisticLockType.ALL,\n"
+" polymorphism = PolymorphismType.EXPLICIT)\n"
+"@Where(clause=\"1=1\")\n"
+"(a)org.hibernate.annotations.Table(name=\"Forest\", indexes = {
@Index(name="
+"\"idx\", columnNames = { \"name\", \"length\" } ) }
)\n"
+"(a)Persister(impl=MyEntityPersister.class)\n"
+"public class Forest { ... }"
+
+#. Tag: programlisting
+#: entity.xml:1633
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Inheritance(\n"
+" strategy=InheritanceType.JOINED\n"
+")\n"
+"public class Vegetable { ... }\n"
+"\n"
+"@Entity\n"
+"(a)OnDelete(action=OnDeleteAction.CASCADE)\n"
+"public class Carrot extends Vegetable { ... }"
+msgstr ""
+"@Entity\n"
+"@Inheritance(\n"
+" strategy=InheritanceType.JOINED\n"
+")\n"
+"public class Vegetable { ... }\n"
+"\n"
+"@Entity\n"
+"(a)OnDelete(action=OnDeleteAction.CASCADE)\n"
+"public class Carrot extends Vegetable { ... }"
+
+#. Tag: title
+#: entity.xml:1637
+#, no-c-format
+msgid "Identifier"
+msgstr "Identifier"
+
+#. Tag: para
+#: entity.xml:1639
+#, no-c-format
+msgid ""
+"Hibernate Annotations goes beyond the Java Persistence specification when "
+"defining identifiers."
+msgstr "Hibernate Annotations va au delà de la spécification de Java Persistence
pour la définition d'identifiants."
+
+#. Tag: title
+#: entity.xml:1643
+#, no-c-format
+msgid "Generators"
+msgstr "Propriétés générées "
+
+#. Tag: literal
+#: entity.xml:1645
+#, no-c-format
+msgid ""
+"<literal>(a)org.hibernate.annotations.GenericGenerator</literal> and
"
+"<literal>(a)org.hibernate.annotations.GenericGenerators</literal> allows
you "
+"to define an Hibernate specific id generator."
+msgstr ""
+"<literal>(a)org.hibernate.annotations.GenericGenerator</literal> et
"
+"<literal>(a)org.hibernate.annotations.GenericGenerators</literal> vous
permettent "
+"de définir un générateur d'id spécifique Hibernate."
+
+#. Tag: programlisting
+#: entity.xml:1650
+#, no-c-format
+msgid ""
+"@Id @GeneratedValue(generator=\"system-uuid\")\n"
+"@GenericGenerator(name=\"system-uuid\", strategy =
\"uuid\")\n"
+"public String getId() {\n"
+"\n"
+"@Id @GeneratedValue(generator=\"hibseq\")\n"
+"@GenericGenerator(name=\"hibseq\", strategy =
\"seqhilo\",\n"
+" parameters = {\n"
+" @Parameter(name=\"max_lo\", value = \"5\"),\n"
+" @Parameter(name=\"sequence\",
value=\"heybabyhey\")\n"
+" }\n"
+")\n"
+"public Integer getId() {"
+msgstr ""
+"@Id @GeneratedValue(generator=\"system-uuid\")\n"
+"@GenericGenerator(name=\"system-uuid\", strategy =
\"uuid\")\n"
+"public String getId() {\n"
+"\n"
+"@Id @GeneratedValue(generator=\"hibseq\")\n"
+"@GenericGenerator(name=\"hibseq\", strategy =
\"seqhilo\",\n"
+" parameters = {\n"
+" @Parameter(name=\"max_lo\", value = \"5\"),\n"
+" @Parameter(name=\"sequence\",
value=\"heybabyhey\")\n"
+" }\n"
+")\n"
+"public Integer getId() {"
+
+#. Tag: para
+#: entity.xml:1652
+#, no-c-format
+msgid ""
+"<literal>strategy</literal> is the short name of an Hibernate3
generator "
+"strategy or the fully qualified class name of an "
+"<classname>IdentifierGenerator</classname> implementation. You can add
some "
+"parameters through the <literal>parameters</literal> attribute."
+msgstr ""
+"<literal>strategy</literal> est le nom raccourci pour une stratégie
"
+"Hibernate3 generator ou le FQN d'une implémentation "
+"<classname>IdentifierGenerator</classname>. Vous pouvez ajouter
quelques "
+"paramètres grâce à l'attribut <literal>parameters</literal>."
+
+#. Tag: para
+#: entity.xml:1658
+#, no-c-format
+msgid ""
+"Contrary to their standard counterpart,
<literal>@GenericGenerator</literal> "
+"and <literal>@GenericGenerators</literal> can be used in package level
"
+"annotations, making them application level generators (just like if they "
+"were in a JPA XML file)."
+msgstr ""
+"Contrairement à ses contreparties standard,
<literal>@GenericGenerator</"
+"literal> et <literal>@GenericGenerators</literal> peuvent être
utilisés pour des annotations au niveau du packetage, "
+"faisant de lui un générateur niveau application (comme si c'était un fichier
"
+"JPA XML)."
+
+#. Tag: programlisting
+#: entity.xml:1664
+#, no-c-format
+msgid ""
+"@GenericGenerators(\n"
+" {\n"
+" @GenericGenerator(\n"
+" name=\"hibseq\",\n"
+" strategy = \"seqhilo\",\n"
+" parameters = {\n"
+" @Parameter(name=\"max_lo\", value =
\"5\"),\n"
+" @Parameter(name=\"sequence\",
value=\"heybabyhey\")\n"
+" }\n"
+" ),\n"
+" @GenericGenerator(...)\n"
+" }\n"
+")\n"
+"package org.hibernate.test.model"
+msgstr ""
+"@GenericGenerators(\n"
+" {\n"
+" @GenericGenerator(\n"
+" name=\"hibseq\",\n"
+" strategy = \"seqhilo\",\n"
+" parameters = {\n"
+" @Parameter(name=\"max_lo\", value =
\"5\"),\n"
+" @Parameter(name=\"sequence\",
value=\"heybabyhey\")\n"
+" }\n"
+" ),\n"
+" @GenericGenerator(...)\n"
+" }\n"
+")\n"
+"package org.hibernate.test.model"
+
+#. Tag: title
+#: entity.xml:1668
+#, no-c-format
+msgid "@NaturalId"
+msgstr "@NaturalId"
+
+#. Tag: para
+#: entity.xml:1670
+#, no-c-format
+msgid ""
+"While not used as identifier property, some (group of) properties represent "
+"natural identifier of an entity. This is especially true when the schema "
+"uses the recommended approach of using surrogate primary key even if a "
+"natural business key exists. Hibernate allows to map such natural properties
"
+"and reuse them in a <classname>Criteria</classname> query. The natural
"
+"identifier is composed of all the properties marked
<classname>@NaturalId</"
+"classname>."
+msgstr "Bien qu'il ne soit pas utilisé comme propriété d'identifiant,
certaines propriétés (groupe de) représentent l'identifiant naturel d'une entité.
Cela est particulièrement vrai lorsque le schéma utilise l'approche recommandée
d'utilisation de clé primaire de substitution, même s'il existe une clé de
l'activité physique. Hibernate permet d'associer ces propriétés naturelles et les
réutiliser dans une requête de <classname>Criteria</classname>.
L'identificateur naturel est composé de toutes les propriétés marquées
<classname>@ NaturalId</classname>."
+
+#. Tag: programlisting
+#: entity.xml:1679
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Citizen {\n"
+" @Id\n"
+" @GeneratedValue\n"
+" private Integer id;\n"
+" private String firstname;\n"
+" private String lastname;\n"
+" \n"
+" @NaturalId\n"
+" @ManyToOne\n"
+" private State state;\n"
+"\n"
+" @NaturalId\n"
+" private String ssn;\n"
+" ...\n"
+"}\n"
+"\n"
+"\n"
+"\n"
+"//and later on query\n"
+"List results = s.createCriteria( Citizen.class )\n"
+" .add( Restrictions.naturalId().set( \"ssn\",
\"1234\" ).set"
+"( \"state\", ste ) )\n"
+" .list();"
+msgstr ""
+"@Entity\n"
+"public class Citizen {\n"
+" @Id\n"
+" @GeneratedValue\n"
+" private Integer id;\n"
+" private String firstname;\n"
+" private String lastname;\n"
+" \n"
+" @NaturalId\n"
+" @ManyToOne\n"
+" private State state;\n"
+"\n"
+" @NaturalId\n"
+" private String ssn;\n"
+" ...\n"
+"}\n"
+"\n"
+"\n"
+"\n"
+"//and later on query\n"
+"List results = s.createCriteria( Citizen.class )\n"
+" .add( Restrictions.naturalId().set( \"ssn\",
\"1234\" ).set"
+"( \"state\", ste ) )\n"
+" .list();"
+
+#. Tag: para
+#: entity.xml:1681
+#, no-c-format
+msgid ""
+"Note that the group of properties representing the natural identifier have "
+"to be unique (Hibernate will generate a unique constraint if the database "
+"schema is generated)."
+msgstr "Notez que le groupe de propriétés représentant l'identificateur naturel
doit être unique (Hibernate générera une contrainte unique si le schéma de base de données
est généré)."
+
+#. Tag: title
+#: entity.xml:1688
+#, no-c-format
+msgid "Property"
+msgstr "Propriété"
+
+#. Tag: title
+#: entity.xml:1691
+#, no-c-format
+msgid "Access type"
+msgstr "Type d'accès"
+
+#. Tag: para
+#: entity.xml:1693
+#, no-c-format
+msgid ""
+"The access type is guessed from the position of <literal>@Id</literal>
or "
+"<literal>@EmbeddedId</literal> in the entity hierarchy. Sub-entities,
"
+"embedded objects and mapped superclass inherit the access type from the root
"
+"entity."
+msgstr ""
+"Le type d'accès est deviné à partir de la position de
<literal>@Id</literal> "
+"ou de <literal>@EmbeddedId</literal> dans la hiérarchie des entités.
Les "
+"sous-entrées, les objets imbriqués, et la superclasse mapée héritent le type
"
+"d'accès à partir de l'entité root."
+
+#. Tag: para
+#: entity.xml:1698
+#, no-c-format
+msgid "In Hibernate, you can override the access type to:"
+msgstr "Dans Hibernate, vous pouvez surcharger le type d'accès en :"
+
+#. Tag: para
+#: entity.xml:1702
+#, no-c-format
+msgid "use a custom access type strategy"
+msgstr "utilisant une stratégie de type d'accès personnalisée"
+
+#. Tag: para
+#: entity.xml:1706
+#, no-c-format
+msgid "fine tune the access type at the class level or at the property level"
+msgstr ""
+"préciser le type d'accès en détail au niveau de la classe ou au niveau de la
"
+"propriété"
+
+#. Tag: para
+#: entity.xml:1711
+#, no-c-format
+msgid ""
+"An @AccessType annotation has been introduced to support this behavior. You "
+"can define the access type on"
+msgstr ""
+"Une annotation @AccessType a été introduite pour prendre en charge ce "
+"comportement. Vous pouvez définir le type d'accès sur"
+
+#. Tag: para
+#: entity.xml:1716
+#, no-c-format
+msgid "an entity"
+msgstr "une entité"
+
+#. Tag: para
+#: entity.xml:1720
+#, no-c-format
+msgid "a superclass"
+msgstr "une superclasse"
+
+#. Tag: para
+#: entity.xml:1724
+#, no-c-format
+msgid "an embeddable object"
+msgstr "un objet imbricable"
+
+#. Tag: para
+#: entity.xml:1728
+#, no-c-format
+msgid "a property"
+msgstr "une propriété"
+
+#. Tag: para
+#: entity.xml:1732
+#, no-c-format
+msgid ""
+"The access type is overriden for the annotated element, if overriden on a "
+"class, all the properties of the given class inherit the access type. For "
+"root entities, the access type is considered to be the default one for the "
+"whole hierarchy (overridable at class or property level)."
+msgstr ""
+"Le type d'accès est surchargé par l'élément annoté. S'il est surchargé
sur "
+"une classe, toutes les propriétés de la classe donnée héritent du type "
+"d'accès. Pour les entités root, le type d'accès est considéré être la
valeur "
+"par défaut de toute la hiérarchie (surchargeable au niveau de la classe ou "
+"de la propriété)."
+
+#. Tag: para
+#: entity.xml:1738
+#, no-c-format
+msgid ""
+"If the access type is marked as \"property\", the getters are scanned for
"
+"annotations, if the access type is marked as \"field\", the fields are
"
+"scanned for annotations. Otherwise the elements marked with @Id or "
+"@embeddedId are scanned."
+msgstr ""
+"Si le type d'accès est marqué \"property\", les getters seront
balayés pour "
+"trouver des annotations. Si le type d'accès est marqué \"field\", les
champs "
+"seront balayés pour trouver des annotations. Sinon, les éléments qui "
+"comprennent @ld ou @embeddedld seront également balayés."
+
+#. Tag: para
+#: entity.xml:1743
+#, no-c-format
+msgid ""
+"You can override an access type for a property, but the element to annotate "
+"will not be influenced: for example an entity having access type "
+"<literal>field</literal>, can annotate a field with
<literal>@AccessType"
+"(\"property\")</literal>, the access type will then be property for
this "
+"attribute, the the annotations still have to be carried on the field."
+msgstr ""
+"Vous pouvez surcharger un type d'accès pour une propriété, mais l'élément Ã
"
+"annoter ne sera pas influencé :par exemple, une entité ayant pour type "
+"d'accès <literal>field</literal>, peut annoter un champ avec
"
+"<literal>@AccessType(\"property\")</literal>, le type
d'accès sera alors une "
+"propriété pour cet attribut, et les annotations devront toujours être mises "
+"sur le champ. "
+
+#. Tag: para
+#: entity.xml:1750
+#, no-c-format
+msgid ""
+"If a superclass or an embeddable object is not annotated, the root entity "
+"access type is used (even if an access type has been define on an "
+"intermediate superclass or embeddable object). The russian doll principle "
+"does not apply."
+msgstr ""
+"Si une superclasse ou un objet imbricable n'est pas annoté, le type d'accès
"
+"de l'entité root sera utilisé (même si le type d'accès a été défini sur une
"
+"superclasse intermédiaire ou sur un objet imbricable). Le principe de la "
+"poupée russe ne s'applique pas."
+
+#. Tag: programlisting
+#: entity.xml:1755
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Person implements Serializable {\n"
+" @Id @GeneratedValue //access type field\n"
+" Integer id;\n"
+"\n"
+" @Embedded\n"
+" @AttributeOverrides({\n"
+" @AttributeOverride(name = \"iso2\", column = @Column(name =
\"bornIso2"
+"\")),\n"
+" @AttributeOverride(name = \"name\", column = @Column(name = "
+"\"bornCountryName\"))\n"
+" })\n"
+" Country bornIn;\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"<emphasis
role=\"bold\">@AccessType(\"property\")</emphasis> //override
"
+"access type for all properties in Country\n"
+"public class Country implements Serializable {\n"
+" private String iso2;\n"
+" private String name;\n"
+"\n"
+" public String getIso2() {\n"
+" return iso2;\n"
+" }\n"
+"\n"
+" public void setIso2(String iso2) {\n"
+" this.iso2 = iso2;\n"
+" }\n"
+"\n"
+" @Column(name = \"countryName\")\n"
+" public String getName() {\n"
+" return name;\n"
+" }\n"
+"\n"
+" public void setName(String name) {\n"
+" this.name = name;\n"
+" }\n"
+"}"
+msgstr ""
+"@Entity\n"
+"public class Person implements Serializable {\n"
+" @Id @GeneratedValue //access type field\n"
+" Integer id;\n"
+"\n"
+" @Embedded\n"
+" @AttributeOverrides({\n"
+" @AttributeOverride(name = \"iso2\", column = @Column(name =
\"bornIso2"
+"\")),\n"
+" @AttributeOverride(name = \"name\", column = @Column(name = "
+"\"bornCountryName\"))\n"
+" })\n"
+" Country bornIn;\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"<emphasis
role=\"bold\">@AccessType(\"property\")</emphasis> //override
"
+"access type for all properties in Country\n"
+"public class Country implements Serializable {\n"
+" private String iso2;\n"
+" private String name;\n"
+"\n"
+" public String getIso2() {\n"
+" return iso2;\n"
+" }\n"
+"\n"
+" public void setIso2(String iso2) {\n"
+" this.iso2 = iso2;\n"
+" }\n"
+"\n"
+" @Column(name = \"countryName\")\n"
+" public String getName() {\n"
+" return name;\n"
+" }\n"
+"\n"
+" public void setName(String name) {\n"
+" this.name = name;\n"
+" }\n"
+"}"
+
+#. Tag: title
+#: entity.xml:1759
+#, no-c-format
+msgid "Formula"
+msgstr "Formule"
+
+#. Tag: para
+#: entity.xml:1761
+#, no-c-format
+msgid ""
+"Sometimes, you want the Database to do some computation for you rather than "
+"in the JVM, you might also create some kind of virtual column. You can use a
"
+"SQL fragment (aka formula) instead of mapping a property into a column. This
"
+"kind of property is read only (its value is calculated by your formula "
+"fragment)."
+msgstr ""
+"Parfois, vous souhaiteriez que la base de données puisse effectuer quelques "
+"opérations pour vous à la place de JVM. Vous souhaiteriez également créer "
+"certaines colonnes virtuelles. Vous pouvez utiliser un fragment SQL (alias "
+"formule) au lieu de mapper une propriété dans une colonne. Ce genre de "
+"propriétés est en lecture-seule (sa valeur est calculée par votre fragment "
+"de formule)."
+
+#. Tag: programlisting
+#: entity.xml:1767
+#, no-c-format
+msgid ""
+"@Formula(\"obj_length * obj_height * obj_width\")\n"
+"public long getObjectVolume()"
+msgstr ""
+"@Formula(\"obj_length * obj_height * obj_width\")\n"
+"public long getObjectVolume()"
+
+#. Tag: para
+#: entity.xml:1769
+#, no-c-format
+msgid "The SQL fragment can be as complex as you want and even include
subselects."
+msgstr ""
+"Le fragment SQL peut être aussi complexe que vous le souhaitez, voir même "
+"inclure des sous-sélections. "
+
+#. Tag: title
+#: entity.xml:1774
+#, no-c-format
+msgid "Type"
+msgstr "Type"
+
+#. Tag: para
+#: entity.xml:1776
+#, no-c-format
+msgid ""
+"<literal>(a)org.hibernate.annotations.Type</literal> overrides the
default "
+"hibernate type used: this is generally not necessary since the type is "
+"correctly inferred by Hibernate. Please refer to the Hibernate reference "
+"guide for more informations on the Hibernate types."
+msgstr ""
+"<literal>(a)org.hibernate.annotations.Type</literal> surcharge le type
"
+"hibernate utilisé par défaut : cela n'est normalement pas nécessaire puisque
"
+"le type est correctement inféré par Hibernate. Veuillez vous reporter au "
+"guide de référence Hibernate pour davantage d'informations sur les types
"
+"d'Hibernate."
+
+#. Tag: para
+#: entity.xml:1781
+#, no-c-format
+msgid ""
+"<literal>(a)org.hibernate.annotations.TypeDef</literal> and
<literal>(a)org."
+"hibernate.annotations.TypeDefs</literal> allows you to declare type "
+"definitions. These annotations can be placed at the class or package level. "
+"Note that these definitions are be global for the session factory (even when
"
+"defined at the class level). Type definitions have to be defined before any "
+"usage. If the type is used on a single entity, you can plance the definition
"
+"on the entity itself. Otherwise, it is recommended to place the definition a
"
+"the package level since the entity processing order is not guaranteed."
+msgstr ""
+"<literal>(a)org.hibernate.annotations.TypeDef</literal> and
<literal>(a)org."
+"hibernate.annotations.TypeDefs</literal> vous permettent de déclarer des
"
+"définitions de type. Ces annotations sont situées au niveau du package ou de
"
+"la classe. Notez que ces définitions seront globales pour l'usine de "
+"sessions (même au niveau de la classe). Les définitions de type devront "
+"être définies avant tout usage. Si le type est utilisé sur une seule entité, vous
pouvez plancer la définition de l'entité elle-même. Sinon, il est recommandé de placer
la définition un niveau du package puisque l'ordre de traitement de l'entité
n'est pas garanti."
+
+#. Tag: para
+#: entity.xml:1790
+#, no-c-format
+msgid ""
+"Package level annotations are placed in a file named
<filename>package-info."
+"java</filename> in the appropriate package. Place your annotations before
"
+"the package declaration."
+msgstr ""
+"Les annotations niveau paquetage sont placées dans un fichier nommé
<filename>package-info."
+"Java</filename> dans le paquetage approprié. Placez vos annotations avant la
déclaration de package."
+
+#. Tag: programlisting
+#: entity.xml:1793
+#, no-c-format
+msgid ""
+"//in org/hibernate/test/annotations/entity/package-info.java\n"
+"@TypeDefs(\n"
+" {\n"
+" @TypeDef(\n"
+" name=\"caster\",\n"
+" typeClass = CasterStringType.class,\n"
+" parameters = {\n"
+" @Parameter(name=\"cast\", value=\"lower\")\n"
+" }\n"
+" )\n"
+" }\n"
+")\n"
+"package org.hibernate.test.annotations.entity;\n"
+"\n"
+"//in org/hibernate/test/annotations/entity/Forest.java\n"
+"public class Forest {\n"
+" @Type(type=\"caster\")\n"
+" public String getSmallText() {\n"
+" ...\n"
+"}"
+msgstr ""
+"//in org/hibernate/test/annotations/entity/package-info.java\n"
+"@TypeDefs(\n"
+" {\n"
+" @TypeDef(\n"
+" name=\"caster\",\n"
+" typeClass = CasterStringType.class,\n"
+" parameters = {\n"
+" @Parameter(name=\"cast\", value=\"lower\")\n"
+" }\n"
+" )\n"
+" }\n"
+")\n"
+"package org.hibernate.test.annotations.entity;\n"
+"\n"
+"//in org/hibernate/test/annotations/entity/Forest.java\n"
+"public class Forest {\n"
+" @Type(type=\"caster\")\n"
+" public String getSmallText() {\n"
+" ...\n"
+"}"
+
+#. Tag: para
+#: entity.xml:1795
+#, no-c-format
+msgid ""
+"When using composite user type, you will have to express column definitions.
"
+"The <literal>@Columns</literal> has been introduced for that
purpose."
+msgstr ""
+"Quand vous utilisez un type d'utilisation composite, vous devrez exprimer
"
+"les définitions de colonnes. <literal>@Columns</literal> a été
introduit "
+"dans ce but."
+
+#. Tag: programlisting
+#: entity.xml:1799
+#, no-c-format
+msgid ""
+"(a)Type(type=\"org.hibernate.test.annotations.entity.MonetaryAmountUserType"
+"\")\n"
+"@Columns(columns = {\n"
+" @Column(name=\"r_amount\"),\n"
+" @Column(name=\"r_currency\")\n"
+"})\n"
+"public MonetaryAmount getAmount() {\n"
+" return amount;\n"
+"}\n"
+"\n"
+"\n"
+"public class MonetaryAmount implements Serializable {\n"
+" private BigDecimal amount;\n"
+" private Currency currency;\n"
+" ...\n"
+"}"
+msgstr ""
+"(a)Type(type=\"org.hibernate.test.annotations.entity.MonetaryAmountUserType"
+"\")\n"
+"@Columns(columns = {\n"
+" @Column(name=\"r_amount\"),\n"
+" @Column(name=\"r_currency\")\n"
+"})\n"
+"public MonetaryAmount getAmount() {\n"
+" return amount;\n"
+"}\n"
+"\n"
+"\n"
+"public class MonetaryAmount implements Serializable {\n"
+" private BigDecimal amount;\n"
+" private Currency currency;\n"
+" ...\n"
+"}"
+
+#. Tag: title
+#: entity.xml:1803
+#, no-c-format
+msgid "Index"
+msgstr "Index"
+
+#. Tag: para
+#: entity.xml:1805
+#, no-c-format
+msgid ""
+"You can define an index on a particular column using the
<literal>@Index</"
+"literal> annotation on a one column property, the columnNames attribute will
"
+"then be ignored"
+msgstr ""
+"Vous pouvez définir un index d'une colonne particulière en utilisant "
+"l'annotation <literal>@Index</literal> sur une propriété de
colonne, "
+"l'attribut columnNames sera alors ignoré."
+
+#. Tag: programlisting
+#: entity.xml:1809
+#, no-c-format
+msgid ""
+"@Column(secondaryTable=\"Cat1\")\n"
+"@Index(name=\"story1index\")\n"
+"public String getStoryPart1() {\n"
+" return storyPart1;\n"
+"}"
+msgstr ""
+"@Column(secondaryTable=\"Cat1\")\n"
+"@Index(name=\"story1index\")\n"
+"public String getStoryPart1() {\n"
+" return storyPart1;\n"
+"}"
+
+#. Tag: title
+#: entity.xml:1813
+#, no-c-format
+msgid "@Parent"
+msgstr "@Parent"
+
+#. Tag: para
+#: entity.xml:1815
+#, no-c-format
+msgid ""
+"When inside an embeddable object, you can define one of the properties as a "
+"pointer back to the owner element."
+msgstr ""
+"Quand vous vous trouvez à l'intérieur d'un objet imbriquable, vous pouvez
"
+"définir une des propriétés en tant que pointeur vers l'élément du "
+"propriétaire."
+
+#. Tag: programlisting
+#: entity.xml:1818
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Person {\n"
+" @Embeddable public Address address;\n"
+" ...\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"public class Address {\n"
+" @Parent public Person owner;\n"
+" ...\n"
+"}\n"
+"\n"
+"\n"
+"person == person.address.owner"
+msgstr ""
+"@Entity\n"
+"public class Person {\n"
+" @Embeddable public Address address;\n"
+" ...\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"public class Address {\n"
+" @Parent public Person owner;\n"
+" ...\n"
+"}\n"
+"\n"
+"\n"
+"person == person.address.owner"
+
+#. Tag: title
+#: entity.xml:1822
+#, no-c-format
+msgid "Generated properties"
+msgstr "Propriétés générées"
+
+#. Tag: para
+#: entity.xml:1824
+#, no-c-format
+msgid ""
+"Some properties are generated at insert or update time by your database. "
+"Hibernate can deal with such properties and triggers a subsequent select to "
+"read these properties."
+msgstr ""
+"Certaines propriétés sont générées en cours d'insersion ou de mise à jour
"
+"par votre base de données. Hibernate peut gérer de telles propriétés et "
+"déclencher une sélection en conséquence pour sélectionner ces propriétés. "
+
+#. Tag: programlisting
+#: entity.xml:1828
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Antenna {\n"
+" @Id public Integer id;\n"
+" @Generated(GenerationTime.ALWAYS) @Column(insertable = false, updatable "
+"= false)\n"
+" public String longitude;\n"
+"\n"
+" @Generated(GenerationTime.INSERT) @Column(insertable = false)\n"
+" public String latitude;\n"
+"}"
+msgstr ""
+"@Entity\n"
+"public class Antenna {\n"
+" @Id public Integer id;\n"
+" @Generated(GenerationTime.ALWAYS) @Column(insertable = false, updatable "
+"= false)\n"
+" public String longitude;\n"
+"\n"
+" @Generated(GenerationTime.INSERT) @Column(insertable = false)\n"
+" public String latitude;\n"
+"}"
+
+#. Tag: para
+#: entity.xml:1830
+#, no-c-format
+msgid ""
+"Annotate your property as <literal>@Generated</literal> You have to
make "
+"sure your insertability or updatability does not conflict with the "
+"generation strategy you have chosen. When GenerationTime.INSERT is chosen, "
+"the property must not contains insertable columns, when GenerationTime."
+"ALWAYS is chosen, the property must not contains insertable nor updatable "
+"columns."
+msgstr ""
+"Annotez votre propriété en tant que <literal>@Generated</literal>. Vous
"
+"devez vous assurer que votre capacité d'insersion et de mise à jour ne "
+"rentrent pas en conflit avec la stratégie de génération que vous avez "
+"choisie. Quand GenerationTime.INSERT est sélectionné, la propriété ne doit "
+"pas comprendre de colonnes insérables; quand GenerationTime.ALWAYS est "
+"choisi, la propriété ne doit pas contenir de colonnes insérables ou pouvant "
+"être mises à jour."
+
+#. Tag: para
+#: entity.xml:1837
+#, no-c-format
+msgid ""
+"<literal>@Version</literal> properties cannot be
<literal>@Generated(INSERT)"
+"</literal> by design, it has to be either
<literal>NEVER</literal> or "
+"<literal>ALWAYS</literal>."
+msgstr ""
+"Les propriétés de <literal>@Version</literal> ne peuvent pas être
"
+"<literal>@Generated(INSERT)</literal> par design. On doit avoir "
+"<literal>NEVER</literal> ou
<literal>ALWAYS</literal>."
+
+#. Tag: title
+#: entity.xml:1843
+#, no-c-format
+msgid "@Target"
+msgstr "@Target"
+
+#. Tag: para
+#: entity.xml:1845
+#, no-c-format
+msgid ""
+"Sometimes, the type guessed by reflection is not the one you want Hibernate "
+"to use. This is especially true on components when an interface is used. You
"
+"can use <literal>@Target</literal> to by pass the reflection guessing
"
+"mechanism (very much like the <literal>targetEntity</literal> attribute
"
+"available on associations."
+msgstr ""
+"Parfois, le type qui est deviné par réflection n'est pas celui que vous "
+"souhaitez qu'Hibernate utilise. C'est surtout vrai pour des composants
quand "
+"on utilise une interface. Vous pouvez utiliser
<literal>@Target</literal> "
+"pour éviter le mécanisme de réflection (similaire à l'attribut "
+"<literal>targetEntity</literal> disponible pour les
associations)."
+
+#. Tag: programlisting
+#: entity.xml:1852
+#, no-c-format
+msgid ""
+"@Embedded\n"
+" <emphasis
role=\"bold\">(a)Target(OwnerImpl.class)</emphasis>\n"
+" public Owner getOwner() {\n"
+" return owner;\n"
+" }"
+msgstr ""
+"@Embedded\n"
+" <emphasis
role=\"bold\">(a)Target(OwnerImpl.class)</emphasis>\n"
+" public Owner getOwner() {\n"
+" return owner;\n"
+" }"
+
+#. Tag: title
+#: entity.xml:1858
+#, no-c-format
+msgid "Optimistic lock"
+msgstr "Verrou optimiste"
+
+#. Tag: para
+#: entity.xml:1860
+#, no-c-format
+msgid ""
+"It is sometimes useful to avoid increasing the version number even if a "
+"given property is dirty (particularly collections). You can do that by "
+"annotating the property (or collection) with <literal>@OptimisticLock"
+"(excluded=true)</literal>."
+msgstr ""
+"Il est parfois utile d'éviter d'augmenter le numéro de version même si une
propriété donnée est corrompue (surtout les collections). Vous pouvez procéder en annotant
la propriété (ou la collection) avec <literal>@OptimisticLock"
+"(excluded=true)</literal>."
+
+#. Tag: para
+#: entity.xml:1865
+#, no-c-format
+msgid ""
+"More formally, specifies that updates to this property do not require "
+"acquisition of the optimistic lock."
+msgstr "De façon plus formelle, spécifier que les mises à jour de cette propriété ne
nécessitent pas de verou optimiste."
+
+#. Tag: title
+#: entity.xml:1871
+#, no-c-format
+msgid "Inheritance"
+msgstr "Héritage"
+
+#. Tag: para
+#: entity.xml:1873
+#, no-c-format
+msgid ""
+"SINGLE_TABLE is a very powerful strategy but sometimes, and especially for "
+"legacy systems, you cannot add an additional discriminator column. For that "
+"purpose Hibernate has introduced the notion of discriminator formula: "
+"<literal>@DiscriminatorFormula</literal> is a replacement of "
+"<literal>@DiscriminatorColumn</literal> and use a SQL fragment as a
formula "
+"for discriminator resolution (no need to have a dedicated column)."
+msgstr ""
+"SINGLE_TABLE est une stratégie très puissante, mais parfois, et surtout pour
"
+"les systèmes pré-existants, vous ne pouvez pas ajouter de colonne de "
+"discriminator supplémentaire. Dans ce but, Hibernate a introduit la notion "
+"de formule de discriminator : <literal>@DiscriminatorFormula</literal>
est "
+"un remplacement de <literal>@DiscriminatorColumn</literal> et utilise
un "
+"fragment SQL comme formule pour la résolution de discriminator (nul besoin "
+"de colonne dédiée à ce but)."
+
+#. Tag: programlisting
+#: entity.xml:1882
+#, no-c-format
+msgid ""
+"@Entity\n"
+"<emphasis role=\"bold\">@DiscriminatorFormula(\"case when
forest_type is "
+"null then 0 else forest_type end\")</emphasis>\n"
+"public class Forest { ... }"
+msgstr ""
+"@Entity\n"
+"<emphasis role=\"bold\">@DiscriminatorFormula(\"case when
forest_type is "
+"null then 0 else forest_type end\")</emphasis>\n"
+"public class Forest { ... }"
+
+#. Tag: para
+#: entity.xml:1884
+#, no-c-format
+msgid ""
+"By default, when querying the top entities, Hibernate does not put a "
+"restriction clause on the discriminator column. This can be inconvenient if "
+"this column contains values not mapped in your hierarchy (through "
+"<literal>@DiscriminatorValue</literal>). To work around that you can
use "
+"<literal>@ForceDiscriminator</literal> (at the class level, next to
"
+"<literal>@DiscriminatorColumn</literal>). Hibernate will then list the
"
+"available values when loading the entities."
+msgstr ""
+"Par défaut, quand vous cherchez les entités supérieures, Hibernate ne place "
+"pas de clause de restriction sur la colonne du discriminateur. Cela peut "
+"poser un problème si cette colonne contient des valeurs qui ne sont pas "
+"mappées dans votre hiérarchie (par
<literal>@DiscriminatorValue</literal>). "
+"Pour régler ce problème, vous pouvez utiliser
<literal>@ForceDiscriminator</"
+"literal> (au niveau de la classe, à côté de
<literal>@DiscriminatorColumn</"
+"literal>). Hibernate va alors lister les valeurs disponibles au moment du
"
+"téléchargement des entités."
+
+#. Tag: para
+#: entity.xml:1892
+#, no-c-format
+msgid ""
+"You can define the foreign key name generated by Hibernate for subclass "
+"tables in the JOINED inheritance strategy."
+msgstr "Vous pouvez définir un nom de clé étrangère généré par Hibernate pour les
tables de sous-classes dans la stratégie d'héritage JOINED."
+
+#. Tag: programlisting
+#: entity.xml:1895
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Inheritance(strategy = InheritanceType.JOINED)\n"
+"public abstract class File { ... }\n"
+"\n"
+"@Entity\n"
+"@ForeignKey(name = \"FK_DOCU_FILE\")\n"
+"public class Document extends File {"
+msgstr ""
+"@Entity\n"
+"@Inheritance(strategy = InheritanceType.JOINED)\n"
+"public abstract class File { ... }\n"
+"\n"
+"@Entity\n"
+"@ForeignKey(name = \"FK_DOCU_FILE\")\n"
+"public class Document extends File {"
+
+#. Tag: para
+#: entity.xml:1897
+#, no-c-format
+msgid ""
+"The foreign key from the <literal>Document</literal> table to the
"
+"<literal>File</literal> table will be named
<literal>FK_DOCU_FILE</literal>."
+msgstr ""
+"La clé étrangère de la table <literal>Document</literal> pour la table
"
+"<literal>File</literal> sera nommée
<literal>FK_DOCU_FILE</literal>."
+
+#. Tag: title
+#: entity.xml:1903
+#, no-c-format
+msgid "Single Association related annotations"
+msgstr "Annotations liées à des associations simples"
+
+#. Tag: para
+#: entity.xml:1905
+#, no-c-format
+msgid ""
+"By default, when Hibernate cannot resolve the association because the "
+"expected associated element is not in database (wrong id on the association "
+"column), an exception is raised by Hibernate. This might be inconvenient for
"
+"legacy and badly maintained schemas. You can ask Hibernate to ignore such "
+"elements instead of raising an exception using the
<literal>@NotFound</"
+"literal> annotation. This annotation can be used on a
<literal>@OneToOne</"
+"literal> (with FK), <literal>@ManyToOne</literal>,
<literal>@OneToMany</"
+"literal> or <literal>@ManyToMany</literal> association."
+msgstr ""
+"Par défaut, quand Hibernate ne peut pas résoudre l'association parce que
"
+"l'élément associé qu'on espère n'est pas dans la base de données (id
erronée "
+"dans la colonne d'association), Hibernate crée une exception. Cela peut "
+"poser un problème pour les anciens schémas et pour les schémas qui ne sont "
+"pas maintenus convenablement. Vous pouvez demander à Hibernate d'ignorer ces
"
+"éléments au lieu de créer une exception en utilisant une association "
+"<literal>@OneToOne</literal> (avec FK),
<literal>@ManyToOne</literal>, "
+"<literal>@OneToMany</literal> ou
<literal>@ManyToMany</literal>. "
+
+#. Tag: programlisting
+#: entity.xml:1915
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Child {\n"
+" ...\n"
+" @ManyToOne\n"
+" @NotFound(action=NotFoundAction.IGNORE)\n"
+" public Parent getParent() { ... }\n"
+" ...\n"
+"}"
+msgstr ""
+"@Entity\n"
+"public class Child {\n"
+" ...\n"
+" @ManyToOne\n"
+" @NotFound(action=NotFoundAction.IGNORE)\n"
+" public Parent getParent() { ... }\n"
+" ...\n"
+"}"
+
+#. Tag: para
+#: entity.xml:1917
+#, no-c-format
+msgid ""
+"Sometimes you want to delegate to your database the deletion of cascade when
"
+"a given entity is deleted."
+msgstr ""
+"Parfois, vous souhaitez peut-être déléguer la suppression de cascade à votre
"
+"base de données quand une entité donnée est supprimée."
+
+#. Tag: programlisting
+#: entity.xml:1920
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Child {\n"
+" ...\n"
+" @ManyToOne\n"
+" @OnDelete(action=OnDeleteAction.CASCADE)\n"
+" public Parent getParent() { ... }\n"
+" ...\n"
+"}"
+msgstr ""
+"@Entity\n"
+"public class Child {\n"
+" ...\n"
+" @ManyToOne\n"
+" @OnDelete(action=OnDeleteAction.CASCADE)\n"
+" public Parent getParent() { ... }\n"
+" ...\n"
+"}"
+
+#. Tag: para
+#: entity.xml:1922
+#, no-c-format
+msgid ""
+"In this case Hibernate generates a cascade delete constraint at the database
"
+"level."
+msgstr ""
+"Dans un tel cas, Hibernate génère une contrainte de suppression de cascade "
+"au niveau de la base de données."
+
+#. Tag: para
+#: entity.xml:1925
+#, no-c-format
+msgid ""
+"Foreign key constraints, while generated by Hibernate, have a fairly "
+"unreadable name. You can override the constraint name by use "
+"<literal>(a)ForeignKey</literal>."
+msgstr ""
+"Les contraines de clés étrangères, quand elles sont générées par Hibernate, "
+"ont un nom assez illisible. Vous pouvez surcharger le nom de la contrainte "
+"en utilisant <literal>(a)ForeignKey</literal>."
+
+#. Tag: programlisting
+#: entity.xml:1929
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Child {\n"
+" ...\n"
+" @ManyToOne\n"
+" <emphasis
role=\"bold\">@ForeignKey(name=\"FK_PARENT\")</emphasis>\n"
+" public Parent getParent() { ... }\n"
+" ...\n"
+"}\n"
+"\n"
+"alter table Child add constraint FK_PARENT foreign key (parent_id) "
+"references Parent"
+msgstr ""
+"@Entity\n"
+"public class Child {\n"
+" ...\n"
+" @ManyToOne\n"
+" <emphasis
role=\"bold\">@ForeignKey(name=\"FK_PARENT\")</emphasis>\n"
+" public Parent getParent() { ... }\n"
+" ...\n"
+"}\n"
+"\n"
+"alter table Child add constraint FK_PARENT foreign key (parent_id) "
+"references Parent"
+
+#. Tag: title
+#: entity.xml:1932
+#, no-c-format
+msgid "Lazy options and fetching modes"
+msgstr "Options lazy et modes de récupéraiton"
+
+#. Tag: para
+#: entity.xml:1934
+#, no-c-format
+msgid ""
+"EJB3 comes with the <literal>fetch</literal> option to define lazy
loading "
+"and fetching modes, however Hibernate has a much more option set in this "
+"area. To fine tune the lazy loading and fetching strategies, some additional
"
+"annotations have been introduced:"
+msgstr ""
+"EJB3 est fourni avec l'option <literal>fetch</literal> pour
déterminer le "
+"chargement lazy (à la demande) et les modes de récupération. Mais Hibernate "
+"a plus d'une option à ce sujet. Pour définir plus précisément les stratégies
"
+"de récupération et de chargement à la demande, on a jouté quelques "
+"annotations supplémentaires :"
+
+#. Tag: para
+#: entity.xml:1941
+#, no-c-format
+msgid ""
+"<literal>@LazyToOne</literal>: defines the lazyness option on "
+"<literal>@ManyToOne</literal> and
<literal>@OneToOne</literal> associations. "
+"<literal>LazyToOneOption</literal> can be
<literal>PROXY</literal> (ie use a "
+"proxy based lazy loading), <literal>NO_PROXY</literal> (use a bytecode
"
+"enhancement based lazy loading - note that build time bytecode processing is
"
+"necessary) and <literal>FALSE</literal> (association not lazy)"
+msgstr ""
+"<literal>@LazyToOne</literal>: définit l'option de lazyness sur les
"
+"associations <literal>@ManyToOne</literal> et
<literal>@OneToOne</literal>. "
+"<literal>LazyToOneOption</literal> pet être
<literal>PROXY</literal> (c'est "
+"à dire en utilisant une chargement à la demande basé proxy), "
+"<literal>NO_PROXY</literal> (en utilisant un chargement à la demande
basé "
+"bytecode - notez que le traitement de build time bytecode est nécessaire) et
"
+"<literal>FALSE</literal> (association non lazy)"
+
+#. Tag: para
+#: entity.xml:1951
+#, no-c-format
+msgid ""
+"<literal>@LazyCollection</literal>: defines the lazyness option on
"
+"<literal>@ManyTo</literal>Many and
<literal>@OneToMany</literal> "
+"associations. LazyCollectionOption can be <literal>TRUE</literal> (the
"
+"collection is lazy and will be loaded when its state is accessed), "
+"<literal>EXTRA</literal> (the collection is lazy and all operations
will try "
+"to avoid the collection loading, this is especially useful for huge "
+"collections when loading all the elements is not necessary) and FALSE "
+"(association not lazy)"
+msgstr ""
+"<literal>@LazyCollection</literal>: définit l'option lazyness des
"
+"associations <literal>@ManyToMany</literal>et de
<literal>@OneToMany</"
+"literal> associations. LazyCollectionOption peut être
<literal>TRUE</"
+"literal> (la collection est lazy et sera chargée quand on accèdera à son "
+"état), <literal>EXTRA</literal> (la collection est lazy et toutes les
"
+"opérations vont essayer d'éviter le chargement de collection, cela est "
+"particulièrement utile pour les énormes collections quand il n'est pas utile
"
+"de télécharger tous les éléments) et FALSE (associations non lazy)"
+
+#. Tag: para
+#: entity.xml:1963
+#, no-c-format
+msgid ""
+"<literal>@Fetch</literal>: defines the fetching strategy used to load
the "
+"association. <literal>FetchMode</literal> can be
<literal>SELECT</literal> "
+"(a select is triggered when the association needs to be loaded), "
+"<literal>SUBSELECT</literal> (only available for collections, use a
"
+"subselect strategy - please refers to the Hibernate Reference Documentation "
+"for more information) or <literal>JOIN</literal> (use a SQL JOIN to
load the "
+"association while loading the owner entity). <literal>JOIN</literal>
"
+"overrides any lazy attribute (an association loaded through a
<literal>JOIN</"
+"literal> strategy cannot be lazy)."
+msgstr ""
+"<literal>@Fetch</literal>: définit la stratégie utilisée pour
télécharger "
+"l'association. <literal>FetchMode</literal> peut être
<literal>SELECT</"
+"literal> (une sélection est déclenchée quand une association a besoin d'être
"
+"téléchargée), <literal>SUBSELECT</literal> (uniquement disponible pour
"
+"collections, utiliser une stratégie de sous-sélection - veuillez, pour cela,
"
+"vous reporter à la Documentation de référence Hibernate pour davantage "
+"d'informations) ou <literal>JOIN</literal> (utiliser un SQL JOIN
pour "
+"télécharger l'association quand vous téléchargez l'entité du propriétaire).
"
+"<literal>JOIN</literal> surcharge tout attribut lazy (une association
"
+"téléchargée par une stratégie <literal>JOIN</literal> ne peut pas être
lazy)."
+
+#. Tag: para
+#: entity.xml:1977
+#, no-c-format
+msgid "The Hibernate annotations overrides the EJB3 fetching options."
+msgstr "Les annotations Hibernate surchargent les options de récupération
EJB3."
+
+#. Tag: title
+#: entity.xml:1981
+#, no-c-format
+msgid "Lazy and fetch options equivalent"
+msgstr "Les équivalents aux options lazy et fetch"
+
+#. Tag: entry
+#: entity.xml:1986
+#, no-c-format
+msgid "Annotations"
+msgstr "Annotations"
+
+#. Tag: entry
+#: entity.xml:1988
+#, no-c-format
+msgid "Lazy"
+msgstr "Lazy"
+
+#. Tag: entry
+#: entity.xml:1990
+#, no-c-format
+msgid "Fetch"
+msgstr "Fetch"
+
+#. Tag: entry
+#: entity.xml:1996
+#, no-c-format
+msgid "(a)[One|Many]ToOne](fetch=FetchType.LAZY)"
+msgstr "(a)[One|Many]ToOne](fetch=FetchType.LAZY)"
+
+#. Tag: entry
+#: entity.xml:1998
+#, no-c-format
+msgid "@LazyToOne(PROXY)"
+msgstr "@LazyToOne(PROXY)"
+
+#. Tag: entry
+#: entity.xml:2000 entity.xml:2016
+#, no-c-format
+msgid "@Fetch(SELECT)"
+msgstr "@Fetch(SELECT)"
+
+#. Tag: entry
+#: entity.xml:2004
+#, no-c-format
+msgid "(a)[One|Many]ToOne](fetch=FetchType.EAGER)"
+msgstr "(a)[One|Many]ToOne](fetch=FetchType.EAGER)"
+
+#. Tag: entry
+#: entity.xml:2006
+#, no-c-format
+msgid "@LazyToOne(FALSE)"
+msgstr "@LazyToOne(FALSE)"
+
+#. Tag: entry
+#: entity.xml:2008 entity.xml:2024
+#, no-c-format
+msgid "@Fetch(JOIN)"
+msgstr "@Fetch(JOIN)"
+
+#. Tag: entry
+#: entity.xml:2012
+#, no-c-format
+msgid "(a)ManyTo[One|Many](fetch=FetchType.LAZY)"
+msgstr "(a)ManyTo[One|Many](fetch=FetchType.LAZY)"
+
+#. Tag: entry
+#: entity.xml:2014
+#, no-c-format
+msgid "@LazyCollection(TRUE)"
+msgstr "@LazyCollection(TRUE)"
+
+#. Tag: entry
+#: entity.xml:2020
+#, no-c-format
+msgid "(a)ManyTo[One|Many](fetch=FetchType.EAGER)"
+msgstr "(a)ManyTo[One|Many](fetch=FetchType.EAGER)"
+
+#. Tag: entry
+#: entity.xml:2022
+#, no-c-format
+msgid "@LazyCollection(FALSE)"
+msgstr "@LazyCollection(FALSE)"
+
+#. Tag: title
+#: entity.xml:2032
+#, no-c-format
+msgid "@Any"
+msgstr "@Any"
+
+#. Tag: para
+#: entity.xml:2034
+#, no-c-format
+msgid ""
+"The <classname>@Any</classname> annotation defines a polymorphic
association "
+"to classes from multiple tables. This type of mapping always requires more "
+"than one column. The first column holds the type of the associated entity. "
+"The remaining columns hold the identifier. It is impossible to specify a "
+"foreign key constraint for this kind of association, so this is most "
+"certainly not meant as the usual way of mapping (polymorphic) associations. "
+"You should use this only in very special cases (eg. audit logs, user session
"
+"data, etc)."
+msgstr ""
+"L'annotation <classname>@Any</classname> définit une association
polymorphe aux classes de plusieurs tables. Ce type de mappage toujours requiert plus
d'une colonne. La première colonne contient le type de l'entité associée. "
+"Les colonnes restantes contiennent l'identificateur. Il est impossible de
spécifier une contrainte de clé étrangère pour ce type d'association, donc c'est
différent de la manière habituelle de mappage des associations (polymorphes). "
+"Vous devez utiliser cela uniquement dans des cas très particuliers (par ex. auditer
les journaux, les données de session utilisateur, etc.)."
+
+#. Tag: para
+#: entity.xml:2043
+#, no-c-format
+msgid ""
+"The @Any annotation describes the column holding the metadata information. "
+"To link the value of the metadata information and an actual entity type, The
"
+"<classname>@AnyDef</classname> and
<classname>@AnyDefs</classname> "
+"annotations are used."
+msgstr "L'annotation @Any décrit la colonne qui contient les informations des
métadonnées. On utilise les annotations <classname>@AnyDef</classname> et
<classname>@AnyDefs</classname> pour relier la valeur des informations de
métadonnées au type d'entiité lui-même."
+
+#. Tag: programlisting
+#: entity.xml:2048
+#, no-c-format
+msgid ""
+"@Any( metaColumn = @Column( name = \"property_type\" ),
fetch=FetchType."
+"EAGER )\n"
+" @AnyMetaDef( \n"
+" idType = \"integer\", \n"
+" metaType = \"string\", \n"
+" metaValues = {\n"
+" @MetaValue( value = \"S\", targetEntity =
StringProperty."
+"class ),\n"
+" @MetaValue( value = \"I\", targetEntity =
IntegerProperty."
+"class )\n"
+" } )\n"
+" @JoinColumn( name = \"property_id\" )\n"
+" public Property getMainProperty() {\n"
+" return mainProperty;\n"
+" }"
+msgstr ""
+"@Any( metaColumn = @Column( name = \"property_type\" ),
fetch=FetchType."
+"EAGER )\n"
+" @AnyMetaDef( \n"
+" idType = \"integer\", \n"
+" metaType = \"string\", \n"
+" metaValues = {\n"
+" @MetaValue( value = \"S\", targetEntity =
StringProperty."
+"class ),\n"
+" @MetaValue( value = \"I\", targetEntity =
IntegerProperty."
+"class )\n"
+" } )\n"
+" @JoinColumn( name = \"property_id\" )\n"
+" public Property getMainProperty() {\n"
+" return mainProperty;\n"
+" }"
+
+#. Tag: para
+#: entity.xml:2050
+#, no-c-format
+msgid ""
+"<methodname>idType</methodname> represents the target entities
identifier "
+"property type and <methodname>metaType</methodname> the metadata type
"
+"(usually String)."
+msgstr ""
+"<methodname>idType</methodname> représente le type de propriété
d'identifiant des entités cibles et le type de métadonnées
<methodname>metaType</methodname> "
+"(des chaînes normalement)."
+
+#. Tag: para
+#: entity.xml:2054
+#, no-c-format
+msgid ""
+"Note that <classname>@AnyDef</classname> can be mutualized and reused.
It is "
+"recommended to place it as a package metadata in this case."
+msgstr "Notez que <classname>@AnyDef</classname> peut être utilisé
mutuellement et réutilisé. Il est conseillé de le mettre en métadonnées de package dans ce
cas."
+
+#. Tag: programlisting
+#: entity.xml:2058
+#, no-c-format
+msgid ""
+"//on a package\n"
+"@AnyMetaDef( name=\"property\" \n"
+" idType = \"integer\", \n"
+" metaType = \"string\", \n"
+" metaValues = {\n"
+" @MetaValue( value = \"S\", targetEntity = StringProperty.class
),\n"
+" @MetaValue( value = \"I\", targetEntity = IntegerProperty.class
)\n"
+" } )\n"
+"package org.hibernate.test.annotations.any;\n"
+"\n"
+"\n"
+"//in a class\n"
+" @Any( metaDef=\"property\", metaColumn = @Column( name =
\"property_type"
+"\" ), fetch=FetchType.EAGER )\n"
+" @JoinColumn( name = \"property_id\" )\n"
+" public Property getMainProperty() {\n"
+" return mainProperty;\n"
+" }"
+msgstr ""
+"//on a package\n"
+"@AnyMetaDef( name=\"property\" \n"
+" idType = \"integer\", \n"
+" metaType = \"string\", \n"
+" metaValues = {\n"
+" @MetaValue( value = \"S\", targetEntity = StringProperty.class
),\n"
+" @MetaValue( value = \"I\", targetEntity = IntegerProperty.class
)\n"
+" } )\n"
+"package org.hibernate.test.annotations.any;\n"
+"\n"
+"\n"
+"//in a class\n"
+" @Any( metaDef=\"property\", metaColumn = @Column( name =
\"property_type"
+"\" ), fetch=FetchType.EAGER )\n"
+" @JoinColumn( name = \"property_id\" )\n"
+" public Property getMainProperty() {\n"
+" return mainProperty;\n"
+" }"
+
+#. Tag: title
+#: entity.xml:2063
+#, no-c-format
+msgid "Collection related annotations"
+msgstr "Annotations liées à collection"
+
+#. Tag: title
+#: entity.xml:2066
+#, no-c-format
+msgid "Enhance collection settings"
+msgstr "Améliore le paramétrage de collection"
+
+#. Tag: para
+#: entity.xml:2068
+#, no-c-format
+msgid "It is possible to set"
+msgstr "Il est possible de paramétrer"
+
+#. Tag: para
+#: entity.xml:2070
+#, no-c-format
+msgid "the batch size for collections using @BatchSize"
+msgstr "la taille du batch pour les collections en utilisant @BatchSize"
+
+#. Tag: para
+#: entity.xml:2075
+#, no-c-format
+msgid ""
+"the where clause, using @Where (applied on the target entity) or "
+"@WhereJoinTable (applied on the association table)"
+msgstr ""
+"la clause where, qui utilise @Where (appliqué à l'entité cible) ou "
+"@WhereJoinTable (appliqué à la table d'association)"
+
+#. Tag: para
+#: entity.xml:2080
+#, no-c-format
+msgid "the check clause, using @Check"
+msgstr "la clause de vérification, utilisant @Check"
+
+#. Tag: para
+#: entity.xml:2085
+#, no-c-format
+msgid "the SQL order by clause, using @OrderBy"
+msgstr "l'ordre SQL par clause, utilisant @OrderBy"
+
+#. Tag: para
+#: entity.xml:2090
+#, no-c-format
+msgid "the delete cascade strategy through
@OnDelete(action=OnDeleteAction.CASCADE)"
+msgstr "la stratégie delete cascade par
@OnDelete(action=OnDeleteAction.CASCADE"
+
+#. Tag: para
+#: entity.xml:2095
+#, no-c-format
+msgid ""
+"the collection immutability using @Immutable: if set specifies that the "
+"elements of the collection never change (a minor performance optimization in
"
+"some cases)"
+msgstr "Immutabilité de la collection en utilisant @Immutable : si configuré, cela
précise que les éléments de la collection ne changent jamais (une optimisation mineure de
performance dans certains cas)"
+
+#. Tag: para
+#: entity.xml:2100
+#, no-c-format
+msgid ""
+"a custom collection persister (ie the persistence strategy used) using "
+"<literal>@Persister</literal>: the class must implement
<classname>org."
+"hibernate.persister.collectionCollectionPersister</classname>"
+msgstr ""
+"Un persister de collection personnalisé (c'est à dire la stratégie de
persistance utilisée) qui emploie <literal>@Persister</literal>: la classe
doit implementer <classname>org."
+"hibernate.persister.collectionCollectionPersister</classname>"
+
+#. Tag: para
+#: entity.xml:2107
+#, no-c-format
+msgid ""
+"You can also declare a sort comparator. Use the
<literal>@Sort</literal> "
+"annotation. Expressing the comparator type you want between unsorted, "
+"natural or custom comparator. If you want to use your own comparator "
+"implementation, you'll also have to express the implementation class using
"
+"the <literal>comparator</literal> attribute. Note that you need to use
"
+"either a <classname>SortedSet</classname> or a
<classname>SortedMap</"
+"classname> interface."
+msgstr ""
+"Vous pouvez également déclarer un comparateur de triage (sort comparator). "
+"Utiliser pour cela l'annotation <literal>@Sort</literal>. Exprimer
le type "
+"de comparateur que vous voulez: non trié (unsorted), naturel (natural) ou "
+"personnalisé (custom). Si vous souhaitez utiliser votre propre "
+"implémentation de comparateur, vous devrez également exprimer votre classe "
+"d'implémentation en utilisant l'attribut
<literal>comparator</literal>. "
+"Notez bien que vous aurez besoin d'utiliser soit l'interface
<classname>SortedSet</"
+"classname>, soit l'interface
<classname>SortedMap</classname>."
+
+#. Tag: programlisting
+#: entity.xml:2116
+#, no-c-format
+msgid ""
+"(a)OneToMany(cascade=CascadeType.ALL, fetch=FetchType.EAGER)\n"
+" @JoinColumn(name=\"CUST_ID\")\n"
+" @Sort(type = SortType.COMPARATOR, comparator = TicketComparator.class)\n"
+" @Where(clause=\"1=1\")\n"
+" @OnDelete(action=OnDeleteAction.CASCADE)\n"
+" public SortedSet<Ticket> getTickets() {\n"
+" return tickets;\n"
+" }"
+msgstr ""
+"(a)OneToMany(cascade=CascadeType.ALL, fetch=FetchType.EAGER)\n"
+" @JoinColumn(name=\"CUST_ID\")\n"
+" @Sort(type = SortType.COMPARATOR, comparator = TicketComparator.class)\n"
+" @Where(clause=\"1=1\")\n"
+" @OnDelete(action=OnDeleteAction.CASCADE)\n"
+" public SortedSet<Ticket> getTickets() {\n"
+" return tickets;\n"
+" }"
+
+#. Tag: para
+#: entity.xml:2118
+#, no-c-format
+msgid ""
+"Please refer to the previous descriptions of these annotations for more "
+"informations."
+msgstr ""
+"Veuillez vous reporter aux descriptions précédentes de ces annotations pour "
+"davantage d'informations."
+
+#. Tag: para
+#: entity.xml:2121
+#, no-c-format
+msgid ""
+"Foreign key constraints, while generated by Hibernate, have a fairly "
+"unreadable name. You can override the constraint name by use "
+"<literal>@ForeignKey</literal>. Note that this annotation has to be
placed "
+"on the owning side of the relationship, <literal>inverseName</literal>
"
+"referencing to the other side constraint."
+msgstr ""
+"Les contraintes de clés étrangères, malgré qu'elles soient générées par "
+"Hibernate, comportent un nom assez illisible. Vous pouvez surcharger le nom "
+"de contrainte en utilisant <literal>@ForeignKey</literal>. Notez que
cette "
+"annotation doit être placée sur la partie propriétaire de la relation, "
+"<literal>inverseName</literal> faisant référence à la contrainte de
l'autre "
+"côté."
+
+#. Tag: programlisting
+#: entity.xml:2128
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Woman {\n"
+" ...\n"
+" @ManyToMany(cascade = {CascadeType.ALL})\n"
+" <emphasis role=\"bold\">@ForeignKey(name =
\"TO_WOMAN_FK\", inverseName "
+"= \"TO_MAN_FK\")</emphasis>\n"
+" public Set<Man> getMens() {\n"
+" return mens;\n"
+" }\n"
+"}\n"
+"\n"
+"alter table Man_Woman add constraint TO_WOMAN_FK foreign key (woman_id) "
+"references Woman\n"
+"alter table Man_Woman add constraint TO_MAN_FK foreign key (man_id) "
+"references Man"
+msgstr ""
+"@Entity\n"
+"public class Woman {\n"
+" ...\n"
+" @ManyToMany(cascade = {CascadeType.ALL})\n"
+" <emphasis role=\"bold\">@ForeignKey(name =
\"TO_WOMAN_FK\", inverseName "
+"= \"TO_MAN_FK\")</emphasis>\n"
+" public Set<Man> getMens() {\n"
+" return mens;\n"
+" }\n"
+"}\n"
+"\n"
+"alter table Man_Woman add constraint TO_WOMAN_FK foreign key (woman_id) "
+"references Woman\n"
+"alter table Man_Woman add constraint TO_MAN_FK foreign key (man_id) "
+"references Man"
+
+#. Tag: title
+#: entity.xml:2132
+#, no-c-format
+msgid "Extra collection types"
+msgstr "Types de collection supplémentaires"
+
+#. Tag: title
+#: entity.xml:2135
+#, no-c-format
+msgid "List"
+msgstr "List"
+
+#. Tag: para
+#: entity.xml:2137
+#, no-c-format
+msgid ""
+"Beyond EJB3, Hibernate Annotations supports true
<classname>List</classname> "
+"and <classname>Array</classname>. Map your collection the same way as
usual "
+"and add the @<literal>IndexColumn</literal>. This annotation allows you
to "
+"describe the column that will hold the index. You can also declare the index
"
+"value in DB that represent the first element (aka as base index). The usual "
+"value is <literal>0</literal> or
<literal>1</literal>."
+msgstr ""
+"Au delà d'EJB3, Hibernate Annotations supporte
<classname>List</classname> "
+"et <classname>Array</classname>. Mappez votre collection comme
d'habitude, "
+"et ajoutez @<literal>IndexColumn</literal>. Cette annotation vous
permettra "
+"de décrire une colonne qui contiendra l'index. Vous pouvez aussi déclarer la
"
+"valeur de l'index en DB, qui représente le premier élément (alias index de
"
+"base). La valeur habituelle est <literal>0</literal> ou bien
<literal>1</"
+"literal>."
+
+#. Tag: programlisting
+#: entity.xml:2146
+#, no-c-format
+msgid ""
+"@OneToMany(cascade = CascadeType.ALL)\n"
+"@IndexColumn(name = \"drawer_position\", base=1)\n"
+"public List<Drawer> getDrawers() {\n"
+" return drawers;\n"
+"}"
+msgstr ""
+"@OneToMany(cascade = CascadeType.ALL)\n"
+"@IndexColumn(name = \"drawer_position\", base=1)\n"
+"public List<Drawer> getDrawers() {\n"
+" return drawers;\n"
+"}"
+
+#. Tag: para
+#: entity.xml:2149
+#, no-c-format
+msgid ""
+"If you forgot to set <literal>@IndexColumn</literal>, the bag semantic
is "
+"applied. If you want the bag semantic without the limitations of it, "
+"consider using <literal>(a)CollectionId</literal>."
+msgstr ""
+"Si vous oubliez de fixer <literal>@IndexColumn</literal>, la sémantique
de "
+"bag s'applique. Si vous souhaitez avoir la sémantique de bag sans en subir
"
+"ses limitations, considérez l'utilisation de
<literal>@CollectionId</"
+"literal>."
+
+#. Tag: title
+#: entity.xml:2157
+#, no-c-format
+msgid "<title>Map</title>"
+msgstr "<title>Map</title>"
+
+#. Tag: para
+#: entity.xml:2159
+#, no-c-format
+msgid ""
+"Hibernate Annotations also supports true Map mappings, if
<literal>(a)javax."
+"persistence.MapKey</literal> is not set, hibernate will map the key element
"
+"or embeddable object in its/their own columns. To override the default "
+"columns, you can use
<literal>(a)org.hibernate.annotations.MapKey</literal> if "
+"your key is a basic type (defaulted to <literal>mapkey</literal>) or an
"
+"embeddable object, or you can use <literal>(a)org.hibernate.annotations."
+"MapKeyManyToMany</literal> if your key is an entity."
+msgstr ""
+"Les Annotations Hibernate supportent également les mappages de true Map, si "
+"<literal>(a)javax.persistence.MapKey</literal> n'est pas déterminé,
Hibernate "
+"mappera les éléments clé ou objets imbriqués dans leur(s) propre(s) colonne"
+"(s). Pour surcharger les colonnes par défaut, vous pourrez utiliser "
+"<literal>(a)org.hibernate.annotations.MapKey</literal>si votre clé est
d'un "
+"type de base (<literal>mapkey</literal> par défaut) ou bien un objet
"
+"imbricable, ou encore, vous pourrez utiliser <literal>(a)org.hibernate."
+"annotations.MapKeyManyToMany</literal> si votre clé est une entité. "
+
+#. Tag: para
+#: entity.xml:2169
+#, no-c-format
+msgid ""
+"Both <literal>(a)org.hibernate.annotations.MapKey</literal> and
<literal>(a)org."
+"hibernate.annotations.MapKeyManyToMany</literal> allows you to override the
"
+"target element to be used. This is especially useful if your collection does
"
+"not use generics (or if you use interfaces)."
+msgstr ""
+"<literal>(a)org.hibernate.annotations.MapKey</literal> et
<literal>(a)org."
+"hibernate.annotations.MapKeyManyToMany</literal> vous permettent de "
+"surcharger l'élément cible à utiliser. Cela est particulièrement utile si
"
+"votre collection n'utilise pas de génériques (ou si vous utilisez des "
+"interfaces)."
+
+#. Tag: programlisting
+#: entity.xml:2175
+#, no-c-format
+msgid ""
+"@CollectionOfElements(targetElement = SizeImpl.class)\n"
+" @MapKeyManyToMany(<emphasis role=\"bold\">targetEntity =
LuggageImpl."
+"class</emphasis>)\n"
+" private Map<Luggage, Size> sizePerLuggage = new
HashMap<"
+"Luggage, Size>();"
+msgstr ""
+"@CollectionOfElements(targetElement = SizeImpl.class)\n"
+" @MapKeyManyToMany(<emphasis role=\"bold\">targetEntity =
LuggageImpl."
+"class</emphasis>)\n"
+" private Map<Luggage, Size> sizePerLuggage = new
HashMap<"
+"Luggage, Size>();"
+
+#. Tag: title
+#: entity.xml:2182
+#, no-c-format
+msgid "Bidirectional association with indexed collections"
+msgstr "Association bidirectionnelle avec des collections indexées"
+
+#. Tag: para
+#: entity.xml:2184
+#, no-c-format
+msgid ""
+"A bidirectional association where one end is an indexed collection (ie. "
+"represented as a <literal>@IndexColumn</literal>,
<literal>(a)org.hibernate."
+"annotations.MapKey</literal> or
<classname>(a)org.hibernate.annotations."
+"MapKeyManyToMany</classname>) requires special consideration. If a property
"
+"on the associated class explicitly maps the indexed value, the use of "
+"<methodname>mappedBy</methodname> is permitted:"
+msgstr ""
+"Une association bidirectionnelle pour laquelle une extrémité est représentée
"
+"par <literal>@IndexColumn</literal> ou
<literal>(a)org.hibernate.annotations."
+"MapKey[ManyToMany]</literal> attire une certaine considération. S'il y a
une "
+"propriété de la classe du dépendant qui mappe la colonne d'index, il n'y
"
+"aura pas de problèmes et on pourra continuer à utiliser
<methodname>mappedBy</methodname> dans le mappage de collection :"
+
+#. Tag: programlisting
+#: entity.xml:2192
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Parent {\n"
+" @OneToMany(mappedBy=\"parent\")\n"
+" @org.hibernate.annotations.IndexColumn(name=\"order\")\n"
+" private List<Child> children;\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Child {\n"
+" ...\n"
+" //the index column is mapped as a property in the associated entity\n"
+" @Column(name=\"order\")\n"
+" private int order;\n"
+"\n"
+" @ManyToOne\n"
+" @JoinColumn(name=\"parent_id\", nullable=false)\n"
+" private Parent parent;\n"
+" ...\n"
+"}"
+msgstr ""
+"@Entity\n"
+"public class Parent {\n"
+" @OneToMany(mappedBy=\"parent\")\n"
+" @org.hibernate.annotations.IndexColumn(name=\"order\")\n"
+" private List<Child> children;\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Child {\n"
+" ...\n"
+" //the index column is mapped as a property in the associated entity\n"
+" @Column(name=\"order\")\n"
+" private int order;\n"
+"\n"
+" @ManyToOne\n"
+" @JoinColumn(name=\"parent_id\", nullable=false)\n"
+" private Parent parent;\n"
+" ...\n"
+"}"
+
+#. Tag: para
+#: entity.xml:2194
+#, no-c-format
+msgid ""
+"But, if there is no such property on the child class, we can't think of the
"
+"association as truly bidirectional (there is information available at one "
+"end of the association that is not available at the other end: the index). "
+"In this case, we can't map the collection as
<literal>mappedBy</literal>. "
+"Instead, we could use the following mapping:"
+msgstr ""
+"Mais, s'il n'existe pas de propriété sur la classe d'un dépendant, on
ne "
+"pourra pas imaginer l'association totalement bidirectionnelle (il y a des
"
+"informations disponibles à l'une des extrémités de l'association, qui ne
"
+"sont pas disponibles à l'autre). Dans ce cas, nous ne pouvons pas mapper la
"
+"collection <literal>mappedBy</literal>. A la place, nous pouvons
utiliser le "
+"mappage suivant :"
+
+#. Tag: programlisting
+#: entity.xml:2201
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Parent {\n"
+" @OneToMany\n"
+" @org.hibernate.annotations.IndexColumn(name=\"order\")\n"
+" @JoinColumn(name=\"parent_id\", nullable=false)\n"
+" private List<Child> children;\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Child {\n"
+" ...\n"
+" @ManyToOne\n"
+" @JoinColumn(name=\"parent_id\", insertable=false, updatable=false,
"
+"nullable=false)\n"
+" private Parent parent;\n"
+" ...\n"
+"}"
+msgstr ""
+"@Entity\n"
+"public class Parent {\n"
+" @OneToMany\n"
+" @org.hibernate.annotations.IndexColumn(name=\"order\")\n"
+" @JoinColumn(name=\"parent_id\", nullable=false)\n"
+" private List<Child> children;\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Child {\n"
+" ...\n"
+" @ManyToOne\n"
+" @JoinColumn(name=\"parent_id\", insertable=false, updatable=false,
"
+"nullable=false)\n"
+" private Parent parent;\n"
+" ...\n"
+"}"
+
+#. Tag: para
+#: entity.xml:2203
+#, no-c-format
+msgid ""
+"Note that in this mapping, the collection-valued end of the association is "
+"responsible for updating the foreign key."
+msgstr ""
+"Notez que dans ce mappage, l'extrêmité collection-valued de l'association
"
+"est chargée des mises à jour de la clé étrangère. "
+
+#. Tag: title
+#: entity.xml:2208
+#, no-c-format
+msgid "Bag with primary key"
+msgstr "Bag et les clé primaires"
+
+#. Tag: para
+#: entity.xml:2210
+#, no-c-format
+msgid ""
+"Another interesting feature is the ability to define a surrogate primary key
"
+"to a bag collection. This remove pretty much all of the drawbacks of bags: "
+"update and removal are efficient, more than one
<literal>EAGER</literal> bag "
+"per query or per entity. This primary key will be contained in a additional "
+"column of your collection table but will not be visible to the Java "
+"application. @CollectionId is used to mark a collection as id bag, it also "
+"allow to override the primary key column(s), the primary key type and the "
+"generator strategy. The strategy can be <literal>identity</literal>, or
any "
+"defined generator name of your application."
+msgstr ""
+"Il existe une autre fonctionnalité intéressante : la possibilité de définir "
+"une clé primaire de susbstitution pour une collection bag. Cela supprime de "
+"nombreux inconvénients de bags : la mise à jour et la suppression sont "
+"efficaces, avec plus d'un bag <literal>EAGER</literal> par requête
ou par "
+"entité. Cette clé primaire sera contenue dans une colonne supplémentaire de "
+"votre table de collection, mais ne sera pas visible par l'application java.
"
+"@CollectionId est utilisé pour marquer une collection en tant qu'id bag.
"
+"Cela vous permet également de surcharger la(les) colonne(s) de clé(s) "
+"primaire(s), le type de clé(s) primaire(s) et la stratégie de generator. La "
+"stratégie peut être <literal>identity</literal>, ou n'importe quel
nom de "
+"générateur déterminé pour votre application."
+
+#. Tag: programlisting
+#: entity.xml:2221
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@TableGenerator(name=\"ids_generator\", table=\"IDS\")\n"
+"public class Passport {\n"
+" ...\n"
+"\n"
+" @ManyToMany(cascade = CascadeType.ALL)\n"
+" @JoinTable(name=\"PASSPORT_VISASTAMP\")\n"
+" <emphasis role=\"bold\">@CollectionId(\n"
+" columns = @Column(name=\"COLLECTION_ID\"), \n"
+" type=@Type(type=\"long\"), \n"
+" generator = \"ids_generator\"\n"
+" )</emphasis>\n"
+" private Collection<Stamp> visaStamp = new ArrayList();\n"
+" ...\n"
+"}"
+msgstr ""
+"@Entity\n"
+"@TableGenerator(name=\"ids_generator\", table=\"IDS\")\n"
+"public class Passport {\n"
+" ...\n"
+"\n"
+" @ManyToMany(cascade = CascadeType.ALL)\n"
+" @JoinTable(name=\"PASSPORT_VISASTAMP\")\n"
+" <emphasis role=\"bold\">@CollectionId(\n"
+" columns = @Column(name=\"COLLECTION_ID\"), \n"
+" type=@Type(type=\"long\"), \n"
+" generator = \"ids_generator\"\n"
+" )</emphasis>\n"
+" private Collection<Stamp> visaStamp = new ArrayList();\n"
+" ...\n"
+"}"
+
+#. Tag: title
+#: entity.xml:2225
+#, no-c-format
+msgid "Collection of element or composite elements"
+msgstr "Collection d'éléments ou d'éléments composites"
+
+#. Tag: para
+#: entity.xml:2227
+#, no-c-format
+msgid ""
+"Hibernate Annotations also supports collections of core types (Integer, "
+"String, Enums, ...), collections of embeddable objects and even arrays of "
+"primitive types. This is known as collection of elements."
+msgstr ""
+"Hibernate Annotations supporte également des collections de type principaux "
+"(Integer, String, Enums, ...), des collections d'objets imbriquables et même
"
+"des tables de type primitif. Cela est compris comme une collection "
+"d'éléments."
+
+#. Tag: para
+#: entity.xml:2232
+#, no-c-format
+msgid ""
+"A collection of elements has to be annotated as "
+"<literal>@CollectionOfElements</literal> (as a replacement of "
+"<literal>@OneToMany</literal>) To define the collection table, the
"
+"<literal>@JoinTable</literal> annotation is used on the association
"
+"property, <literal>joinColumns</literal> defines the join columns
between "
+"the entity primary table and the collection table (inverseJoincolumn is "
+"useless and should be left empty). For collection of core types or array of "
+"primitive types, you can override the element column definition using a "
+"<literal>@Column</literal> on the association property. You can also
"
+"override the columns of a collection of embeddable object using "
+"<literal>@AttributeOverride</literal>. To reach the collection element,
you "
+"need to append \"element\" to the attribute override name (eg
\"element\" "
+"for core types, or \"element.serial\" for the serial property of an
"
+"embeddable element). To reach the index/key of a collection, append
\"key\" "
+"instead."
+msgstr ""
+"Une collection d'éléments doit être annotée en tant que "
+"<literal>@CollectionOfElements</literal> (en tant que remplacement de
"
+"<literal>@OneToMany</literal>) Pour définir la table de collection,
"
+"l'annotation <literal>@JoinTable</literal> est utilisée sur la
propriété "
+"d'association. <literal>joinColumns</literal> définit les colonnes
jointes "
+"entre la table primaire d'entité et la table de collection "
+"(inverseJioncolumn est inutile et doit rester vide). Pour collection des "
+"types principaux, ou des tables de type primitif, vous pourrez surcharger "
+"l'élément définition de colonne en utilisant un
<literal>@Column</literal> "
+"sur la propriété de l'association. Vous pourrez également surcharger les
"
+"colonnes d'une collection d'objets imbricables en utilisant "
+"<literal>@AttributeOverride</literal>. Pour atteindre l'élément de
"
+"collection, vous aurez besoin d'annexer \"element\" au nom de
surcharge de "
+"l'attribut ( par exemple \"element\" pour les types
principaux\", ou "
+"\"element.serial\" pour la propriété en série d'un élément
imbricable). Pour "
+"atteindre l'index/la clé d'une collection, annexez \"key\" à la
place."
+
+#. Tag: programlisting
+#: entity.xml:2249
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Boy {\n"
+" private Integer id;\n"
+" private Set<String> nickNames = new
HashSet<String>();\n"
+" private int[] favoriteNumbers;\n"
+" private Set<Toy> favoriteToys = new
HashSet<Toy>();\n"
+" private Set<Character> characters = new
HashSet<Character>"
+"();\n"
+"\n"
+" @Id @GeneratedValue\n"
+" public Integer getId() {\n"
+" return id;\n"
+" }\n"
+"\n"
+" <emphasis role=\"bold\">@CollectionOfElements\n"
+" public Set<String></emphasis> getNickNames() {\n"
+" return nickNames;\n"
+" }\n"
+"\n"
+" <emphasis role=\"bold\">@CollectionOfElements\n"
+" @JoinTable(\n"
+" table=@Table(name=\"BoyFavoriteNumbers\"),\n"
+" joinColumns = @JoinColumn(name=\"BoyId\")\n"
+" )\n"
+" @Column(name=\"favoriteNumber\",
nullable=false)</emphasis>\n"
+" @IndexColumn(name=\"nbr_index\")\n"
+" public int[] getFavoriteNumbers() {\n"
+" return favoriteNumbers;\n"
+" }\n"
+"\n"
+" <emphasis role=\"bold\">@CollectionOfElements\n"
+" @AttributeOverride( name=\"element.serial\",
column=@Column(name="
+"\"serial_nbr\") )</emphasis>\n"
+" public Set<Toy> getFavoriteToys() {\n"
+" return favoriteToys;\n"
+" }\n"
+"\n"
+" <emphasis role=\"bold\">@CollectionOfElements\n"
+" public Set<Character></emphasis> getCharacters() {\n"
+" return characters;\n"
+" }\n"
+" ...\n"
+"}\n"
+"\n"
+"public enum Character {\n"
+" GENTLE,\n"
+" NORMAL,\n"
+" AGGRESSIVE,\n"
+" ATTENTIVE,\n"
+" VIOLENT,\n"
+" CRAFTY\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"public class Toy {\n"
+" public String name;\n"
+" public String serial;\n"
+" public Boy owner;\n"
+"\n"
+" public String getName() {\n"
+" return name;\n"
+" }\n"
+"\n"
+" public void setName(String name) {\n"
+" this.name = name;\n"
+" }\n"
+"\n"
+" public String getSerial() {\n"
+" return serial;\n"
+" }\n"
+"\n"
+" public void setSerial(String serial) {\n"
+" this.serial = serial;\n"
+" }\n"
+"\n"
+" <emphasis role=\"bold\">@Parent</emphasis>\n"
+" public Boy getOwner() {\n"
+" return owner;\n"
+" }\n"
+"\n"
+" public void setOwner(Boy owner) {\n"
+" this.owner = owner;\n"
+" }\n"
+"\n"
+" public boolean equals(Object o) {\n"
+" if ( this == o ) return true;\n"
+" if ( o == null || getClass() != o.getClass() ) return false;\n"
+"\n"
+" final Toy toy = (Toy) o;\n"
+"\n"
+" if ( !name.equals( toy.name ) ) return false;\n"
+" if ( !serial.equals( toy.serial ) ) return false;\n"
+"\n"
+" return true;\n"
+" }\n"
+"\n"
+" public int hashCode() {\n"
+" int result;\n"
+" result = name.hashCode();\n"
+" result = 29 * result + serial.hashCode();\n"
+" return result;\n"
+" }\n"
+"}"
+msgstr ""
+"@Entity\n"
+"public class Boy {\n"
+" private Integer id;\n"
+" private Set<String> nickNames = new
HashSet<String>();\n"
+" private int[] favoriteNumbers;\n"
+" private Set<Toy> favoriteToys = new
HashSet<Toy>();\n"
+" private Set<Character> characters = new
HashSet<Character>"
+"();\n"
+"\n"
+" @Id @GeneratedValue\n"
+" public Integer getId() {\n"
+" return id;\n"
+" }\n"
+"\n"
+" <emphasis role=\"bold\">@CollectionOfElements\n"
+" public Set<String></emphasis> getNickNames() {\n"
+" return nickNames;\n"
+" }\n"
+"\n"
+" <emphasis role=\"bold\">@CollectionOfElements\n"
+" @JoinTable(\n"
+" table=@Table(name=\"BoyFavoriteNumbers\"),\n"
+" joinColumns = @JoinColumn(name=\"BoyId\")\n"
+" )\n"
+" @Column(name=\"favoriteNumber\",
nullable=false)</emphasis>\n"
+" @IndexColumn(name=\"nbr_index\")\n"
+" public int[] getFavoriteNumbers() {\n"
+" return favoriteNumbers;\n"
+" }\n"
+"\n"
+" <emphasis role=\"bold\">@CollectionOfElements\n"
+" @AttributeOverride( name=\"element.serial\",
column=@Column(name="
+"\"serial_nbr\") )</emphasis>\n"
+" public Set<Toy> getFavoriteToys() {\n"
+" return favoriteToys;\n"
+" }\n"
+"\n"
+" <emphasis role=\"bold\">@CollectionOfElements\n"
+" public Set<Character></emphasis> getCharacters() {\n"
+" return characters;\n"
+" }\n"
+" ...\n"
+"}\n"
+"\n"
+"public enum Character {\n"
+" GENTLE,\n"
+" NORMAL,\n"
+" AGGRESSIVE,\n"
+" ATTENTIVE,\n"
+" VIOLENT,\n"
+" CRAFTY\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"public class Toy {\n"
+" public String name;\n"
+" public String serial;\n"
+" public Boy owner;\n"
+"\n"
+" public String getName() {\n"
+" return name;\n"
+" }\n"
+"\n"
+" public void setName(String name) {\n"
+" this.name = name;\n"
+" }\n"
+"\n"
+" public String getSerial() {\n"
+" return serial;\n"
+" }\n"
+"\n"
+" public void setSerial(String serial) {\n"
+" this.serial = serial;\n"
+" }\n"
+"\n"
+" <emphasis role=\"bold\">@Parent</emphasis>\n"
+" public Boy getOwner() {\n"
+" return owner;\n"
+" }\n"
+"\n"
+" public void setOwner(Boy owner) {\n"
+" this.owner = owner;\n"
+" }\n"
+"\n"
+" public boolean equals(Object o) {\n"
+" if ( this == o ) return true;\n"
+" if ( o == null || getClass() != o.getClass() ) return false;\n"
+"\n"
+" final Toy toy = (Toy) o;\n"
+"\n"
+" if ( !name.equals( toy.name ) ) return false;\n"
+" if ( !serial.equals( toy.serial ) ) return false;\n"
+"\n"
+" return true;\n"
+" }\n"
+"\n"
+" public int hashCode() {\n"
+" int result;\n"
+" result = name.hashCode();\n"
+" result = 29 * result + serial.hashCode();\n"
+" return result;\n"
+" }\n"
+"}"
+
+#. Tag: para
+#: entity.xml:2251
+#, no-c-format
+msgid ""
+"On a collection of embeddable objects, the embeddable object can have a "
+"property annotated with <literal>@Parent</literal>. This property will
then "
+"point back to the entity containing the collection."
+msgstr ""
+"Dans une collection d'objets imbricables, l'objet imbricable peut avoir une
"
+"propriété annotée avec <literal>@Parent</literal>. Cette propriété
pointera "
+"ensuite vers l'entité qui contient la collection."
+
+#. Tag: para
+#: entity.xml:2257
+#, no-c-format
+msgid ""
+"Previous versions of Hibernate Annotations used the
<literal>@OneToMany</"
+"literal> to mark a collection of elements. Due to semantic inconsistencies,
"
+"we've introduced the annotation
<literal>@CollectionOfElements</literal>. "
+"Marking collections of elements the old way still work but is considered "
+"deprecated and is going to be unsupported in future releases"
+msgstr ""
+"Des anciennes versions d'Hibernate Annotations utilisaient "
+"<literal>@OneToMany</literal> pour marquer une collection
d'éléments. En "
+"raison d'inconsistences sémantiques, nous avons introduit l'annotation
"
+"<literal>@CollectionOfElements</literal>. On peut toujours marquer les
"
+"éléments par l'ancienne méthode, mais cette méthode est considérée comme
"
+"obsolète et ne sera plus prise en charge dans les versions à venir. "
+
+#. Tag: title
+#: entity.xml:2267
+#, no-c-format
+msgid "@ManyToAny"
+msgstr "@ManyToAny"
+
+#. Tag: para
+#: entity.xml:2269
+#, no-c-format
+msgid ""
+"<classname>@ManyToAny</classname> allows polymorphic associations to
classes "
+"from multiple tables. This type of mapping always requires more than one "
+"column. The first column holds the type of the associated entity. The "
+"remaining columns hold the identifier. It is impossible to specify a foreign
"
+"key constraint for this kind of association, so this is most certainly not "
+"meant as the usual way of mapping (polymorphic) associations. You should use
"
+"this only in very special cases (eg. audit logs, user session data, etc)."
+msgstr "<classname>@ ManyToAny</classname> permet des associations
polymorphes aux classes de plusieurs tables. Ce type de mappage requiert toujours plus
d'une colonne. La première colonne contient le type de l'entité associée. Les
colonnes restantes contiennent l'identificateur. Il est impossible de spécifier une
contrainte de clé étrangère pour ce type d'association, donc il ne s'agit pas de
la manière habituelle de mappage des associations (polymorphes). Vous devez utiliser cela
uniquement dans des cas très particuliers (par ex. auditer les journaux, les données de
session utilisateur, etc.)."
+
+#. Tag: programlisting
+#: entity.xml:2279
+#, no-c-format
+msgid ""
+"@ManyToAny(\n"
+" metaColumn = @Column( name = \"property_type\" ) )\n"
+" @AnyMetaDef( \n"
+" idType = \"integer\", \n"
+" metaType = \"string\",\n"
+" metaValues = {\n"
+" @MetaValue( value = \"S\", targetEntity =
StringProperty."
+"class ),\n"
+" @MetaValue( value = \"I\", targetEntity =
IntegerProperty."
+"class ) } )\n"
+" @Cascade( { org.hibernate.annotations.CascadeType.ALL } )\n"
+" @JoinTable( name = \"obj_properties\", joinColumns = @JoinColumn(
name = "
+"\"obj_id\" ),\n"
+" inverseJoinColumns = @JoinColumn( name = \"property_id\" )
)\n"
+" public List<Property> getGeneralProperties() {"
+msgstr ""
+"@ManyToAny(\n"
+" metaColumn = @Column( name = \"property_type\" ) )\n"
+" @AnyMetaDef( \n"
+" idType = \"integer\", \n"
+" metaType = \"string\",\n"
+" metaValues = {\n"
+" @MetaValue( value = \"S\", targetEntity =
StringProperty."
+"class ),\n"
+" @MetaValue( value = \"I\", targetEntity =
IntegerProperty."
+"class ) } )\n"
+" @Cascade( { org.hibernate.annotations.CascadeType.ALL } )\n"
+" @JoinTable( name = \"obj_properties\", joinColumns = @JoinColumn(
name = "
+"\"obj_id\" ),\n"
+" inverseJoinColumns = @JoinColumn( name = \"property_id\" )
)\n"
+" public List<Property> getGeneralProperties() {"
+
+#. Tag: para
+#: entity.xml:2281
+#, no-c-format
+msgid ""
+"Like <classname>@Any</classname>,
<classname>@ManyToAny</classname> can use "
+"named <classname>@AnyDef</classname>s, see <xref
linkend=\"entity-hibspec-"
+"singleassoc-any\"/> for more info."
+msgstr ""
+"Tout comme <classname>@Any</classname>,
<classname>@ManyToAny</classname> peut utiliser les
<classname>@AnyDef</classname> nommés, voir <xref
linkend=\"entity-hibspec-"
+"singleassoc-any\"/> pour en savoir plus."
+
+#. Tag: title
+#: entity.xml:2290
+#, no-c-format
+msgid "Cascade"
+msgstr "Cascade"
+
+#. Tag: para
+#: entity.xml:2292
+#, no-c-format
+msgid ""
+"Hibernate offers more operations than the Java Persistence specification. "
+"You can use the <literal>@Cascade</literal> annotation to cascade the
"
+"following operations:"
+msgstr "Hibernate fournit davantage d'opérations que la spécification de Java
Persistence. Vous pouvez utiliser l'annotation <literal>@Cascade</literal>
pour cascader les opérations suivantes :"
+
+#. Tag: para
+#: entity.xml:2298
+#, no-c-format
+msgid "PERSIST"
+msgstr "PERSIST"
+
+#. Tag: para
+#: entity.xml:2302
+#, no-c-format
+msgid "MERGE"
+msgstr "MERGE"
+
+#. Tag: para
+#: entity.xml:2306
+#, no-c-format
+msgid "REMOVE"
+msgstr "REMOVE"
+
+#. Tag: para
+#: entity.xml:2310
+#, no-c-format
+msgid "REFRESH"
+msgstr "REFRESH"
+
+#. Tag: para
+#: entity.xml:2314
+#, no-c-format
+msgid "DELETE"
+msgstr "DELETE"
+
+#. Tag: para
+#: entity.xml:2318
+#, no-c-format
+msgid "SAVE_UPDATE"
+msgstr "SAVE_UPDATE"
+
+#. Tag: para
+#: entity.xml:2322
+#, no-c-format
+msgid "REPLICATE"
+msgstr "REPLICATE"
+
+#. Tag: para
+#: entity.xml:2326
+#, no-c-format
+msgid "DELETE_ORPHAN"
+msgstr "DELETE_ORPHAN"
+
+#. Tag: para
+#: entity.xml:2330
+#, no-c-format
+msgid "LOCK"
+msgstr "LOCK"
+
+#. Tag: para
+#: entity.xml:2334
+#, no-c-format
+msgid "EVICT"
+msgstr "EVICT"
+
+#. Tag: para
+#: entity.xml:2338
+#, no-c-format
+msgid ""
+"This is especially useful for <literal>SAVE_UPDATE</literal> (which is
the "
+"operation cascaded at flush time if you use plain Hibernate Annotations - "
+"Hibernate EntityManager cascade <literal>PERSIST</literal> at flush
time as "
+"per the specification). DELETE_ORPHAN applies only to
<literal>@OneToMany</"
+"literal> associations, and indicates that the
<methodname>delete()/remove()</"
+"methodname> operation should be applied to any child object that is removed
"
+"from the association. In other words, if a child is dereferenced by a "
+"persistent parent and if <literal>DELETE_ORPHAN</literal> is used, the
"
+"\"orphaned\" child is deleted."
+msgstr ""
+"Ceci est particulièrement utile pour <literal>SAVE_UPDATE</literal> (ce
qui est l'opération en cascade au moment du vidage (flush) si vous utilisez des
annotations Hibernate ordinaires - Hibernate EntityManager cascade
<literal>PERSIST</literal> au vidage suivant la spécification. DELETE_ORPHAN
s'applique uniquement aux associations <literal>@ OneToMany et indiqu,e que
</literal>l'opération
<methodname>delete()/remove()</methodname>"
+" opération doit être appliquée à n'importe quel objet enfant qui est supprimé
de l'association. En d'autres termes, si un parent persistant a supprimé la
référence d'un enfant et si <literal>DELETE_ORPHAN</literal> est utilisé,
l'enfant \"orphelin\" est supprimé."
+
+#. Tag: programlisting
+#: entity.xml:2350
+#, no-c-format
+msgid ""
+"@OneToMany( cascade = {CascadeType.PERSIST, CascadeType.MERGE}
<emphasis\n"
+" role=\"bold\">)\n"
+"(a)Cascade({org.hibernate.annotations.CascadeType.SAVE_UPDATE,\n"
+"
org.hibernate.annotations.CascadeType.DELETE_ORPHAN})</emphasis>\n"
+"public Collection<Employer> getEmployers()"
+msgstr ""
+"@OneToMany( cascade = {CascadeType.PERSIST, CascadeType.MERGE}
<emphasis\n"
+" role=\"bold\">)\n"
+"(a)Cascade({org.hibernate.annotations.CascadeType.SAVE_UPDATE,\n"
+"
org.hibernate.annotations.CascadeType.DELETE_ORPHAN})</emphasis>\n"
+"public Collection<Employer> getEmployers()"
+
+#. Tag: para
+#: entity.xml:2352
+#, no-c-format
+msgid ""
+"It is recommended to use @Cascade to compliment @*To*(cascade=...) as shown "
+"in the previous example."
+msgstr "Il est conseillé d'utiliser @Cascade to compliment @*To*(cascade=...)
comme le montre l'exemple précédent."
+
+#. Tag: title
+#: entity.xml:2357
+#, no-c-format
+msgid "Cache"
+msgstr "Cache"
+
+#. Tag: para
+#: entity.xml:2359
+#, no-c-format
+msgid ""
+"In order to optimize your database accesses, you can activate the so called "
+"second level cache of Hibernate. This cache is configurable on a per entity "
+"and per collection basis."
+msgstr ""
+"Pour pouvoir optimiser les accès à votre base de données, vous pouvez "
+"activer le second niveau cache, comme il est nommé, d'Hibernate. Ce cache
"
+"est configurable sur la base d'une entité et d'une collection. "
+
+#. Tag: para
+#: entity.xml:2363
+#, no-c-format
+msgid ""
+"<literal>(a)org.hibernate.annotations.Cache</literal> defines the caching
"
+"strategy and region of a given second level cache. This annotation can be "
+"applied on the root entity (not the sub entities), and on the collections."
+msgstr ""
+"<literal>(a)org.hibernate.annotations.Cache</literal> détermine la
stratégie "
+"de caching de la région d'un cache de second niveau donné. Cette annotation
"
+"peut être appliquée sur l'entité root (pas sur les sous-entrées), et sur les
"
+"collections."
+
+#. Tag: programlisting
+#: entity.xml:2368
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)\n"
+"public class Forest { ... }"
+msgstr ""
+"@Entity\n"
+"@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)\n"
+"public class Forest { ... }"
+
+#. Tag: programlisting
+#: entity.xml:2370
+#, no-c-format
+msgid ""
+"(a)OneToMany(cascade=CascadeType.ALL, fetch=FetchType.EAGER)\n"
+" @JoinColumn(name=\"CUST_ID\")\n"
+" @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)\n"
+" public SortedSet<Ticket> getTickets() {\n"
+" return tickets;\n"
+" }"
+msgstr ""
+"(a)OneToMany(cascade=CascadeType.ALL, fetch=FetchType.EAGER)\n"
+" @JoinColumn(name=\"CUST_ID\")\n"
+" @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)\n"
+" public SortedSet<Ticket> getTickets() {\n"
+" return tickets;\n"
+" }"
+
+#. Tag: programlisting
+#: entity.xml:2383
+#, no-c-format
+msgid ""
+"@Cache(\n"
+" CacheConcurrencyStrategy usage();\n"
+" String region() default \"\";\n"
+" String include() default \"all\";\n"
+")"
+msgstr ""
+"@Cache(\n"
+" CacheConcurrencyStrategy usage();\n"
+" String region() default \"\";\n"
+" String include() default \"all\";\n"
+")"
+
+#. Tag: para
+#: entity.xml:2387
+#, no-c-format
+msgid ""
+"usage: the given cache concurrency strategy (NONE, READ_ONLY, "
+"NONSTRICT_READ_WRITE, READ_WRITE, TRANSACTIONAL)"
+msgstr ""
+"usage: la stratégie de concurence d'un cache donné (NONE, READ_ONLY, "
+"NONSTRICT_READ_WRITE, READ_WRITE, TRANSACTIONAL)"
+
+#. Tag: para
+#: entity.xml:2392
+#, no-c-format
+msgid ""
+"region (optional): the cache region (default to the fqcn of the class or the
"
+"fq role name of the collection)"
+msgstr ""
+"région (optionnelle) : la région cache (par défaut le FQCN de la classe ou "
+"le nom de role FQ de la collection)"
+
+#. Tag: para
+#: entity.xml:2397
+#, no-c-format
+msgid ""
+"<literal>include</literal> (optional): all to include all properties,
non-"
+"lazy to only include non lazy properties (default all)."
+msgstr ""
+"<literal>include</literal> (optionnel): 'all' pour inclure
toutes les "
+"propriétés, non lazy pour n'inclure que les propriétés non lazy (valeur par
"
+"défaut : all)"
+
+#. Tag: title
+#: entity.xml:2406
+#, no-c-format
+msgid "Filters"
+msgstr "Filtres"
+
+#. Tag: para
+#: entity.xml:2408
+#, no-c-format
+msgid ""
+"Hibernate has the ability to apply arbitrary filters on top of your data. "
+"Those filters are applied at runtime on a given session. First, you need to "
+"define them."
+msgstr ""
+"Hibernate a la possibilité d'appliquer des filtres arbitraires sur vos "
+"données. Ces filtres sont appliqués en cours d'exécution d'une session
"
+"donnée. Vous devrez tout d'abord les définir."
+
+#. Tag: para
+#: entity.xml:2412
+#, no-c-format
+msgid ""
+"<literal>(a)org.hibernate.annotations.FilterDef</literal> or "
+"<literal>@FilterDefs</literal> define filter definition(s) used by
filter(s) "
+"using the same name. A filter definition has a name() and an array of "
+"parameters(). A parameter will allow you to adjust the behavior of the "
+"filter at runtime. Each parameter is defined by a
<literal>@ParamDef</"
+"literal> which has a name and a type. You can also define a
defaultCondition"
+"() parameter for a given <literal>@FilterDef</literal> to set the
default "
+"condition to use when none are defined in each individual
<literal>@Filter</"
+"literal>. A <literal>@FilterDef</literal>(s) can be defined at the
class or "
+"package level."
+msgstr ""
+"<literal>(a)org.hibernate.annotations.FilterDef</literal> ou "
+"<literal>@FilterDefs</literal> définissent des définition(s) utilisées
par "
+"les filtre(s) qui utilisent le même nom. Une définition de filtre comprend "
+"une nom() et une table de paramètre(). Un paramètre vous permettra de régler
"
+"le comportement du filtre en cours d'exécution. Chaque paramètre se définit
"
+"par un <literal>@ParamDef</literal> qui comprend un nom et un type.
Vous "
+"pouvez également définir un paramètre de defaultCondition() pour un "
+"<literal>@FilterDef</literal> donné en vue de fixer quelle condition
par "
+"défaut utiliser quand aucune condition n'est définie pour chaque individu
"
+"<literal>@Filter</literal>.
<literal>@FilterDef</literal>(s) peut être "
+"déterminé au niveau de la classe ou au niveau package."
+
+#. Tag: para
+#: entity.xml:2424
+#, no-c-format
+msgid ""
+"We now need to define the SQL filter clause applied to either the entity "
+"load or the collection load. <literal>@Filter</literal> is used and
placed "
+"either on the entity or the collection element"
+msgstr ""
+"Nous avons maintenant besoin de définir la clause de filtre SQL qui est "
+"appliquée soit au chargement de l'entité, soit au chargement de la "
+"collection. <literal>@Filter</literal> est utilisé et placé sur
l'élement "
+"collection ou entité."
+
+#. Tag: programlisting
+#: entity.xml:2428
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@FilterDef(name=\"minLength\", parameters=@ParamDef(
name=\"minLength\", "
+"type=\"integer\" ) )\n"
+"@Filters( {\n"
+" @Filter(name=\"betweenLength\", condition=\":minLength <=
length and :"
+"maxLength >= length\"),\n"
+" @Filter(name=\"minLength\", condition=\":minLength <=
length\")\n"
+"} )\n"
+"public class Forest { ... }"
+msgstr ""
+"@Entity\n"
+"@FilterDef(name=\"minLength\", parameters=@ParamDef(
name=\"minLength\", "
+"type=\"integer\" ) )\n"
+"@Filters( {\n"
+" @Filter(name=\"betweenLength\", condition=\":minLength <=
length and :"
+"maxLength >= length\"),\n"
+" @Filter(name=\"minLength\", condition=\":minLength <=
length\")\n"
+"} )\n"
+"public class Forest { ... }"
+
+#. Tag: para
+#: entity.xml:2430
+#, no-c-format
+msgid ""
+"When the collection use an association table as a relational representation,
"
+"you might want to apply the filter condition to the association table itself
"
+"or to the target entity table. To apply the constraint on the target entity,
"
+"use the regular <literal>@Filter</literal> annotation. However, if you
wan "
+"to target the association table, use the
<literal>@FilterJoinTable</literal> "
+"annotation."
+msgstr ""
+"Quand la collection utilise une table d'association comme représentation
"
+"relationnelle, vous souhaiterez peut-être appliquer la condition de filtre Ã
"
+"la table d'association elle-même, ou à la table d'entité cible. Pour
"
+"soumettre la contrainte sur l'entité cible, utiliser l'annotation
habituelle "
+"<literal>@Filter</literal>. Mais, si vous souhaitez cibler la table
"
+"d'associations, utiliser l'annotation
<literal>(a)FilterJoinTable</literal>."
+
+#. Tag: programlisting
+#: entity.xml:2438
+#, no-c-format
+msgid ""
+"@OneToMany\n"
+" @JoinTable\n"
+" //filter on the target entity table\n"
+" @Filter(name=\"betweenLength\", condition=\":minLength <=
length and :"
+"maxLength >= length\")\n"
+" //filter on the association table\n"
+" @FilterJoinTable(name=\"security\", condition=\":userlevel
>= "
+"requredLevel\")\n"
+" public Set<Forest> getForests() { ... }"
+msgstr ""
+"@OneToMany\n"
+" @JoinTable\n"
+" //filter on the target entity table\n"
+" @Filter(name=\"betweenLength\", condition=\":minLength <=
length and :"
+"maxLength >= length\")\n"
+" //filter on the association table\n"
+" @FilterJoinTable(name=\"security\", condition=\":userlevel
>= "
+"requredLevel\")\n"
+" public Set<Forest> getForests() { ... }"
+
+#. Tag: title
+#: entity.xml:2442
+#, no-c-format
+msgid "Queries"
+msgstr "Requêtes"
+
+#. Tag: para
+#: entity.xml:2444
+#, no-c-format
+msgid ""
+"Since Hibernate has more features on named queries than the one defined in "
+"the EJB3 specification,
<literal>(a)org.hibernate.annotations.NamedQuery</"
+"literal>,
<literal>(a)org.hibernate.annotations.NamedQueries</literal>, "
+"<literal>(a)org.hibernate.annotations.NamedNativeQuery</literal> and
"
+"<literal>(a)org.hibernate.annotations.NamedNativeQueries</literal> have
been "
+"introduced. They add some attributes to the standard version and can be used
"
+"as a replacement:"
+msgstr ""
+"Comme Hibernate comprend plus de fonctionnalités pour les requêtes "
+"intitulées que celles qui sont définies dans la spécification EJB3, "
+"<literal>(a)org.hibernate.annotations.NamedQuery</literal>,
<literal>(a)org."
+"hibernate.annotations.NamedQueries</literal>,
<literal>(a)org.hibernate."
+"annotations.NamedNativeQuery</literal> et
<literal>(a)org.hibernate."
+"annotations.NamedNativeQueries</literal> ont été introduits. Ils ajoutent
"
+"quelques attributs à la version standard et peuvent être utilisés en "
+"remplacement :"
+
+#. Tag: para
+#: entity.xml:2455
+#, no-c-format
+msgid "flushMode: define the query flush mode (Always, Auto, Commit or
Manual)"
+msgstr "flushMode: définit le mode de suppression de requête (Always, Auto, Commit
or Manual)"
+
+#. Tag: para
+#: entity.xml:2460
+#, no-c-format
+msgid "cacheable: whether the query should be cached or not"
+msgstr "cacheable: si la requête doit être en cache ou non"
+
+#. Tag: para
+#: entity.xml:2464
+#, no-c-format
+msgid "cacheRegion: cache region used if the query is cached"
+msgstr "cacheRegion: région cache utilisée si la requête est en cache"
+
+#. Tag: para
+#: entity.xml:2468
+#, no-c-format
+msgid "fetchSize: JDBC statement fetch size for this query"
+msgstr "fetchSize: taille de récupération d'énoncé JDBC pour cette
requête"
+
+#. Tag: para
+#: entity.xml:2472
+#, no-c-format
+msgid "timeout: query time out"
+msgstr "timeout : délai de recherche"
+
+#. Tag: para
+#: entity.xml:2476
+#, no-c-format
+msgid "callable: for native queries only, to be set to true for stored
procedures"
+msgstr ""
+"callable : pour les recherches natives uniquement, à fixer à true pour les "
+"procédures stockées"
+
+#. Tag: para
+#: entity.xml:2481
+#, no-c-format
+msgid ""
+"comment: if comments are activated, the comment seen when the query is sent "
+"to the database."
+msgstr ""
+"comment : si les commentaires sont activés, le commentaire que l'on voit
"
+"quand la demande est envoyée vers la base de données."
+
+#. Tag: para
+#: entity.xml:2486
+#, no-c-format
+msgid "cacheMode: Cache interaction mode (get, ignore, normal, put or
refresh)"
+msgstr "cacheMode : mode d'interaction cache (get, ignore, normal, put ou
refresh)"
+
+#. Tag: para
+#: entity.xml:2491
+#, no-c-format
+msgid ""
+"readOnly: whether or not the elements retrievent from the query are in read "
+"only mode."
+msgstr ""
+"readOnly : si les éléments extraits suite à la demande sont en mode lecture-"
+"seule."
+
+#. Tag: para
+#: entity.xml:2496
+#, no-c-format
+msgid ""
+"Those hints can be set in a standard
<literal>(a)javax.persistence.NamedQuery</"
+"literal> annotations through the detyped
<literal>@QueryHint</literal>. "
+"Another key advantage is the ability to set those annotations at a package "
+"level."
+msgstr ""
+"Ces éléments pourront être fixés dans un annotation standard
<literal>(a)javax."
+"persistence.NamedQuery</literal> par
<literal>@QueryHint</literal> détypé. "
+"Un autre avantage est que l'on peut fixer ces annotations au niveau du "
+"package."
+
+#. Tag: title
+#: entity.xml:2503
+#, no-c-format
+msgid "Custom SQL for CRUD operations"
+msgstr "Personnaliser SQL pour les opérations CRUD"
+
+#. Tag: para
+#: entity.xml:2505
+#, no-c-format
+msgid ""
+"Hibernate gives you the ability to override every single SQL statement "
+"generated. We have seen native SQL query usage already, but you can also "
+"override the SQL statement used to load or change the state of entities."
+msgstr ""
+"Hibernate vous donne la possibilité de surcharger chaque énoncé SQL généré. "
+"Nous avons déjà vu l'utilisation des requêtes SQL natives, mais vous pouvez
"
+"aussi surcharger l'énoncé SQL qui est utilisé pour charger ou pour changer
"
+"l'état des entités. "
+
+#. Tag: programlisting
+#: entity.xml:2510
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Table(name=\"CHAOS\")\n"
+"<emphasis role=\"bold\">@SQLInsert( sql=\"INSERT INTO
CHAOS(size, name, "
+"nickname, id) VALUES(?,upper(?),?,?)\")\n"
+"@SQLUpdate( sql=\"UPDATE CHAOS SET size = ?, name = upper(?), nickname = ?
"
+"WHERE id = ?\")\n"
+"@SQLDelete( sql=\"DELETE CHAOS WHERE id = ?\")\n"
+"@SQLDeleteAll( sql=\"DELETE CHAOS\")\n"
+"</emphasis><emphasis role=\"bold\">@Loader(namedQuery =
\"chaos\")</"
+"emphasis>\n"
+"@NamedNativeQuery(name=\"chaos\", query=\"select id, size, name,
lower"
+"( nickname ) as nickname from CHAOS where id= ?\", resultClass = Chaos."
+"class)\n"
+"public class Chaos {\n"
+" @Id\n"
+" private Long id;\n"
+" private Long size;\n"
+" private String name;\n"
+" private String nickname;"
+msgstr ""
+"@Entity\n"
+"@Table(name=\"CHAOS\")\n"
+"<emphasis role=\"bold\">@SQLInsert( sql=\"INSERT INTO
CHAOS(size, name, "
+"nickname, id) VALUES(?,upper(?),?,?)\")\n"
+"@SQLUpdate( sql=\"UPDATE CHAOS SET size = ?, name = upper(?), nickname = ?
"
+"WHERE id = ?\")\n"
+"@SQLDelete( sql=\"DELETE CHAOS WHERE id = ?\")\n"
+"@SQLDeleteAll( sql=\"DELETE CHAOS\")\n"
+"</emphasis><emphasis role=\"bold\">@Loader(namedQuery =
\"chaos\")</"
+"emphasis>\n"
+"@NamedNativeQuery(name=\"chaos\", query=\"select id, size, name,
lower"
+"( nickname ) as nickname from CHAOS where id= ?\", resultClass = Chaos."
+"class)\n"
+"public class Chaos {\n"
+" @Id\n"
+" private Long id;\n"
+" private Long size;\n"
+" private String name;\n"
+" private String nickname;"
+
+#. Tag: para
+#: entity.xml:2512
+#, no-c-format
+msgid ""
+"<literal>@SQLInsert</literal>,
<literal>@SQLUpdate</literal>, "
+"<literal>@SQLDelete</literal>,
<literal>@SQLDeleteAll</literal> respectively "
+"override the INSERT statement, UPDATE statement, DELETE statement, DELETE "
+"statement to remove all entities."
+msgstr ""
+"<literal>@SQLInsert</literal>,
<literal>@SQLUpdate</literal>, "
+"<literal>@SQLDelete</literal>,
<literal>@SQLDeleteAll</literal> surchargent "
+"respectivement l'énoncé INSERT, l'énoncé UPDATE, l'énoncé DELETE et
DELETE "
+"pour supprimer toutes les entités."
+
+#. Tag: para
+#: entity.xml:2517
+#, no-c-format
+msgid ""
+"If you expect to call a store procedure, be sure to set the "
+"<literal>callable</literal> attribute to true
(<literal>@SQLInsert"
+"(callable=true, ...)</literal>)."
+msgstr ""
+"SI vous pensez appeler une procédure de stockage, veillez à bien fixer "
+"l'attribut <literal>callable</literal> Ã true
(<literal>@SQLInsert"
+"(callable=true, ...)</literal>)."
+
+#. Tag: para
+#: entity.xml:2521
+#, no-c-format
+msgid ""
+"To check that the execution happens correctly, Hibernate allows you to "
+"define one of those three strategies:"
+msgstr ""
+"Pour vérifier que l'exécution ait lieu correctement, Hibernate vous permet
"
+"de définir une de ces trois sratégies :"
+
+#. Tag: para
+#: entity.xml:2526
+#, no-c-format
+msgid ""
+"NONE: no check is performed: the store procedure is expected to fail upon "
+"issues"
+msgstr ""
+"NONE : pas de vérification : la procédure de stockage risque d'échouer Ã
"
+"cause de problèmes"
+
+#. Tag: para
+#: entity.xml:2531
+#, no-c-format
+msgid "COUNT: use of rowcount to check that the update is successful"
+msgstr ""
+"COUNT : utilisation ddu comptage des rangées pour vérifier que la mise à "
+"jour a bien fonctionné."
+
+#. Tag: para
+#: entity.xml:2536
+#, no-c-format
+msgid ""
+"PARAM: like COUNT but using an output parameter rather that the standard "
+"mechanism"
+msgstr ""
+"PARAM : comme COUNT mais en utilisant un paramètre de sortie plutôt qu'un
"
+"mécanisme standard."
+
+#. Tag: para
+#: entity.xml:2541
+#, no-c-format
+msgid ""
+"To define the result check style, use the <literal>check</literal>
parameter "
+"(<literal>(a)SQLUpdate(check=ResultCheckStyle.COUNT,
...)</literal>)."
+msgstr ""
+"Pour définir le style de vérification des résultats, utilisez le paramètre "
+"<literal>check</literal>
(<literal>(a)SQLUpdate(check=ResultCheckStyle."
+"COUNT, ...)</literal>)."
+
+#. Tag: para
+#: entity.xml:2545
+#, no-c-format
+msgid ""
+"You can also override the SQL load statement by a native SQL query or a HQL "
+"query. You just have to refer to a named query with the "
+"<literal><literal>@Loader</literal></literal>
annotation."
+msgstr ""
+"Vous pouvez également surcharger l'énoncé de chargement SQL par une requête
"
+"SQL ou une requête HQL. Vous avez juste à vous reporter à une requête "
+"intitulée contenant l'annotation
<literal><literal>@Loader</literal></"
+"literal>."
+
+#. Tag: para
+#: entity.xml:2549
+#, no-c-format
+msgid ""
+"You can use the exact same set of annotations to override the collection "
+"related statements."
+msgstr ""
+"Vous pouvez utiliser exactement le même groupe d'annotations pour surcharger
"
+"les énoncés liés à la collection."
+
+#. Tag: programlisting
+#: entity.xml:2552
+#, no-c-format
+msgid ""
+"@OneToMany\n"
+"@JoinColumn(name=\"chaos_fk\")\n"
+"<emphasis role=\"bold\">@SQLInsert( sql=\"UPDATE
CASIMIR_PARTICULE SET "
+"chaos_fk = ? where id = ?\")\n"
+"@SQLDelete( sql=\"UPDATE CASIMIR_PARTICULE SET chaos_fk = null where id =
?"
+"\")</emphasis>\n"
+"private Set<CasimirParticle> particles = new HashSet<"
+"CasimirParticle>();"
+msgstr ""
+"@OneToMany\n"
+"@JoinColumn(name=\"chaos_fk\")\n"
+"<emphasis role=\"bold\">@SQLInsert( sql=\"UPDATE
CASIMIR_PARTICULE SET "
+"chaos_fk = ? where id = ?\")\n"
+"@SQLDelete( sql=\"UPDATE CASIMIR_PARTICULE SET chaos_fk = null where id =
?"
+"\")</emphasis>\n"
+"private Set<CasimirParticle> particles = new HashSet<"
+"CasimirParticle>();"
+
+#. Tag: para
+#: entity.xml:2554
+#, no-c-format
+msgid ""
+"The parameters order is important and is defined by the order Hibernate "
+"handle properties. You can see the expected order by enabling debug logging "
+"for the <literal>org.hibernate.persister.entity</literal> level. With
this "
+"level enabled Hibernate will print out the static SQL that is used to "
+"create, update, delete etc. entities. (To see the expected sequence, "
+"remember to not include your custom SQL through annotations as that will "
+"override the Hibernate generated static sql.)"
+msgstr ""
+"L'ordre des paramètres est important et est déterminé par la façon dont "
+"Hibernate gère les propriétés. Vous pourrez apercevoir l'ordre attendu en
"
+"activant la journalisation de déboggage pour au niveau <literal>org."
+"hibernate.persister.entity</literal>. Une fois ce niveau activé, Hibernate
"
+"imprimera le SQL static qui est utilisé pour créer, mettre à jour et "
+"supprimer etc. les entités. (Pour en voir les conséquences prévues,
souvenez-"
+"vous de ne pas inclure votre SQL personnalisé par des annotations car cela "
+"surchargerait le static sql généré par Hibernate.)"
+
+#. Tag: para
+#: entity.xml:2563
+#, no-c-format
+msgid ""
+"Overriding SQL statements for secondary tables is also possible using "
+"<literal>(a)org.hibernate.annotations.Table</literal> and either (or all)
"
+"attributes <literal>sqlInsert</literal>,
<literal>sqlUpdate</literal>, "
+"<literal>sqlDelete</literal>:"
+msgstr ""
+"Vous pouvez également remplacer les énoncés SQL des tables secondaires SQL en
utilisant <literal>(a)org.hibernate.annotations.Table</literal> ou bien les
attributs "
+"attributes <literal>sqlInsert</literal>,
<literal>sqlUpdate</literal>, "
+"<literal>sqlDelete</literal> (ou bien tous ensemble) :"
+
+#. Tag: programlisting
+#: entity.xml:2568
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@SecondaryTables({\n"
+" @SecondaryTable(name = \"`Cat nbr1`\"),\n"
+" @SecondaryTable(name = \"Cat2\"})\n"
+"(a)org.hibernate.annotations.Tables( {\n"
+" @Table(appliesTo = \"Cat\", comment = \"My cat table\"
),\n"
+" @Table(appliesTo = \"Cat2\", foreignKey =
@ForeignKey(name=\"FK_CAT2_CAT"
+"\"), fetch = FetchMode.SELECT,\n"
+" <emphasis
role=\"bold\">sqlInsert=@SQLInsert(sql=\"insert into Cat2"
+"(storyPart2, id) values(upper(?), ?)\") )</emphasis>\n"
+"} )\n"
+"public class Cat implements Serializable {"
+msgstr ""
+"@Entity\n"
+"@SecondaryTables({\n"
+" @SecondaryTable(name = \"`Cat nbr1`\"),\n"
+" @SecondaryTable(name = \"Cat2\"})\n"
+"(a)org.hibernate.annotations.Tables( {\n"
+" @Table(appliesTo = \"Cat\", comment = \"My cat table\"
),\n"
+" @Table(appliesTo = \"Cat2\", foreignKey =
@ForeignKey(name=\"FK_CAT2_CAT"
+"\"), fetch = FetchMode.SELECT,\n"
+" <emphasis
role=\"bold\">sqlInsert=@SQLInsert(sql=\"insert into Cat2"
+"(storyPart2, id) values(upper(?), ?)\") )</emphasis>\n"
+"} )\n"
+"public class Cat implements Serializable {"
+
+#. Tag: para
+#: entity.xml:2570
+#, no-c-format
+msgid ""
+"The previous example also show that you can give a comment to a given table "
+"(promary or secondary): This comment will be used for DDL generation."
+msgstr "L'exemple précédent montre également que vous pouvez faire une
commentaire sur une table donnée (primaire ou secondaire): ce commentaire sera utilisé
pour générer DDL."
+
+#. Tag: title
+#: entity.xml:2576
+#, no-c-format
+msgid "Tuplizer"
+msgstr "Tuplizer"
+
+#. Tag: para
+#: entity.xml:2578
+#, no-c-format
+msgid ""
+"<classname>org.hibernate.tuple.Tuplizer</classname>, and its
sub-interfaces, "
+"are responsible for managing a particular representation of a piece of data,
"
+"given that representation's
<literal>org.hibernate.EntityMode</literal>. If "
+"a given piece of data is thought of as a data structure, then a tuplizer is "
+"the thing which knows how to create such a data structure and how to extract
"
+"values from and inject values into such a data structure. For example, for "
+"the POJO entity mode, the correpsonding tuplizer knows how create the POJO "
+"through its constructor and how to access the POJO properties using the "
+"defined property accessors. There are two high-level types of Tuplizers, "
+"represented by the
<classname>org.hibernate.tuple.EntityTuplizer</classname> "
+"and <classname>org.hibernate.tuple.ComponentTuplizer</classname>
interfaces. "
+"EntityTuplizers are responsible for managing the above mentioned contracts "
+"in regards to entities, while <classname>ComponentTuplizers</classname>
do "
+"the same for components. Check the Hibernate reference documentation for "
+"more information."
+msgstr ""
+"<classname>org.Hibernate.tuple.Tuplizer</classname>, et ses
sous-interfaces, sont chargés de gérer une représentation particulière d'un élément de
données, compte tenu de cette représentation
<literal>org.Hibernate.EntityMode</literal>. Si un élément donné de données
est considéré comme une structure de données, un tuplizer est la chose qui sait comment
créer une telle structure de données et comment extraire des valeurs et les injecter dans
une telle structure. Par exemple, pour le mode d'entité POJO, le tuplizer
correspondant sait comment créer le POJO par le biais de son constructeur et comment
accéder aux propriétés POJO utilisant les accesseurs de propriété définie. Il existe deux
types de haut niveau de Tuplizers, représentés par les interfaces
<classname>org.Hibernate.tuple.EntityTuplizer</classname> "
+"et <classname>org.Hibernate.tuple.ComponentTuplizer</classname>.
"
+"Les EntityTuplizers sont responsables de la gestion des contrats mentionnés
ci-dessus pour ce qui concerne les entités, tandis que les
<classname>ComponentTuplizers</classname> font de même pour les composants.
Consultez la documentation de référence Hibernate pour plus d'informations."
+
+#. Tag: para
+#: entity.xml:2596
+#, no-c-format
+msgid ""
+"To define tuplixer in annotations, simply use the
<literal>@Tuplizer</"
+"literal> annotation on the according element"
+msgstr ""
+"Pour définir tuplixer dans les annotations, utilisez simplement l'annotation
<literal>@ Tuplizer</"
+"sur l'élément qui convient"
+
+#. Tag: programlisting
+#: entity.xml:2599
+#, no-c-format
+msgid ""
+"@Entity\n"
+"<emphasis role=\"bold\">@Tuplizer(impl =
DynamicEntityTuplizer.class)</"
+"emphasis>\n"
+"public interface Cuisine {\n"
+" @Id\n"
+" @GeneratedValue\n"
+" public Long getId();\n"
+" public void setId(Long id);\n"
+"\n"
+" public String getName();\n"
+" public void setName(String name);\n"
+"\n"
+" <emphasis role=\"bold\">@Tuplizer(impl =
DynamicComponentTuplizer.class)"
+"</emphasis>\n"
+" public Country getCountry();\n"
+" public void setCountry(Country country);\n"
+"\n"
+"\n"
+"}"
+msgstr ""
+"@Entity\n"
+"<emphasis role=\"bold\">@Tuplizer(impl =
DynamicEntityTuplizer.class)</"
+"emphasis>\n"
+"public interface Cuisine {\n"
+" @Id\n"
+" @GeneratedValue\n"
+" public Long getId();\n"
+" public void setId(Long id);\n"
+"\n"
+" public String getName();\n"
+" public void setName(String name);\n"
+"\n"
+" <emphasis role=\"bold\">@Tuplizer(impl =
DynamicComponentTuplizer.class)"
+"</emphasis>\n"
+" public Country getCountry();\n"
+" public void setCountry(Country country);\n"
+"\n"
+"\n"
+"}"
+
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/fr-FR/setup.po
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/fr-FR/setup.po
(rev 0)
+++ annotations/branches/v3_4_0_GA_CP/src/main/docbook/fr-FR/setup.po 2009-12-22 06:50:19
UTC (rev 18313)
@@ -0,0 +1,461 @@
+# translation of setup.po to French
+# Language /tmp/mike/JBEAP420/Annotations translations for JBEAP package.
+# Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+#
+# Automatically generated, 2007.
+# Corina Roe <croe(a)redhat.com>, 2009.
+msgid ""
+msgstr ""
+"Project-Id-Version: setup\n"
+"Report-Msgid-Bugs-To:
http://bugs.kde.org\n"
+"POT-Creation-Date: 2009-11-10 02:15+0000\n"
+"PO-Revision-Date: 2009-11-18 12:13+1000\n"
+"Last-Translator: Corina Roe <croe(a)redhat.com>\n"
+"Language-Team: French <i18(a)redhat.com>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: KBabel 1.11.4\n"
+
+#. Tag: title
+#: setup.xml:28
+#, no-c-format
+msgid "Setting up an annotations project"
+msgstr "Mise en place d'un projet annotations"
+
+#. Tag: title
+#: setup.xml:31
+#, no-c-format
+msgid "Requirements"
+msgstr "Prérequis"
+
+#. Tag: para
+#: setup.xml:35
+#, no-c-format
+msgid ""
+"<ulink
url=\"http://www.hibernate.org/6.html\">Download</ulink> and unpack
"
+"the Hibernate Annotations distribution from the Hibernate website."
+msgstr ""
+"<ulink
url=\"http://www.hibernate.org/6.html\">Télécharger</ulin... et
dépaqueter la distribution Hibernate Annotations du site "
+"Hibernate."
+
+#. Tag: emphasis
+#: setup.xml:41
+#, no-c-format
+msgid "This release requires Hibernate Core 3.3 and above."
+msgstr "Cette version requiert Hibernate Core 3.3 ou version supérieure."
+
+#. Tag: para
+#: setup.xml:46
+#, no-c-format
+msgid "This release is known to work on Hibernate Core 3.3.0.SP1"
+msgstr "Cette version est fameuse pour fonctionner sur Hibernate core
3.2.0.SP1"
+
+#. Tag: para
+#: setup.xml:50
+#, no-c-format
+msgid ""
+"Make sure you have JDK 5.0 installed or above. You can of course continue "
+"using XDoclet and get some of the benefits of annotation-based metadata with
"
+"older JDK versions. Note that this document only describes JDK 5.0 "
+"annotations and you have to refer to the XDoclet documentation for more "
+"information."
+msgstr ""
+"Veillez bien à ce que JDK 5.0 ou version supérieure soit bien installé. Vous
pouvez, biensûr, "
+"continuer à utiliser XDoclet et profiter des avantages des métadonnées "
+"basées-annotations des anciennes versions JDK. Notez bien que ce document ne
"
+"décrit qu'Annotations JDK 5.0 et vous devrez donc vous référer à la
documentation "
+"XDoclet pour obtenir davantage d'informations."
+
+#. Tag: title
+#: setup.xml:60
+#, no-c-format
+msgid "Configuration"
+msgstr "Configuration "
+
+#. Tag: para
+#: setup.xml:62
+#, no-c-format
+msgid ""
+"First, set up your classpath (after you have created a new project in your "
+"favorite IDE):"
+msgstr ""
+"Tout d'abord, configurez votre chemin d'accès (après avoir créé un nouveau
"
+"projet dans votre IDE favori) :"
+
+#. Tag: para
+#: setup.xml:65
+#, no-c-format
+msgid ""
+"Copy all Hibernate3 core and required 3rd party library files (see lib/"
+"README.txt in Hibernate)."
+msgstr ""
+"Copier tous les Hibernate3 core et les fichiers de bibliothèques (voir lib/"
+"README.tx dans Hibernate)."
+
+#. Tag: para
+#: setup.xml:70
+#, no-c-format
+msgid ""
+"Copy <filename>hibernate-annotations.jar</filename>,
<filename>lib/hibernate-"
+"comons-annotations.jar</filename> and
<filename>lib/ejb3-persistence.jar</"
+"filename> from the Hibernate Annotations distribution to your classpath as
"
+"well."
+msgstr ""
+"Copier <filename>hibernate-annotations.jar</filename>,
<filename>lib/hibernate-"
+"comons-annotations.jar</filename> et
<filename>lib/ejb3-persistence.jar</"
+"filename> Ã partir de la distribution Hibernate Annotations "
+"vers votre chemin d'accès également."
+
+#. Tag: para
+#: setup.xml:77
+#, no-c-format
+msgid ""
+"If you wish to use <ulink
url=\"http://validator.hibernate.org\">Hibernate "
+"Validator</ulink>, download it from the Hibernate website and add "
+"<filename>hibernate-validator.jar</filename> in your classpath."
+msgstr ""
+"Si vous souhaitez utiliser <ulink
url=\"http://validator.hibernate.org\">Hibernate "
+"Validator</ulink>, télédéchargez le du site Hibernate website et rajouter
"
+"<filename>hibernate-validator.jar</filename> Ã votre chemin de
classe."
+
+#. Tag: para
+#: setup.xml:82
+#, no-c-format
+msgid ""
+"If you wish to use <ulink
url=\"http://search.hibernate.org\">Hibernate "
+"Search</ulink>, download it from the Hibernate website and add "
+"<filename>hibernate-search.jar</filename> and
<filename>lucene-core-x.y.z."
+"jar</filename> in your classpath."
+msgstr ""
+"Si vous souhaitez utiliser <ulink
url=\"http://search.hibernate.org\">Hibernate "
+"Search</ulink>, télédéchargez le du site Hibernate website et rajouter
"
+"<filename>hibernate-search.jar</filename> et
<filename>lucene-core-x.y.z."
+"jar</filename> Ã votre chemin de classe."
+
+#. Tag: para
+#: setup.xml:88
+#, no-c-format
+msgid ""
+"We also recommend a small wrapper class to startup Hibernate in a static "
+"initializer block, known as <classname>HibernateUtil</classname>. You
might "
+"have seen this class in various forms in other areas of the Hibernate "
+"documentation. For Annotation support you have to enhance this helper class "
+"as follows:"
+msgstr ""
+"Nous recommandons également une petite classe wrapper pour démarrer "
+"Hibernate dans un bloc d'initializer statique, connu en tant que "
+"<classname>HibernateUtil</classname>. Vous avez peut-être pu voir cette
"
+"classe sous plusieurs formes dans d'autres sections de la documentation "
+"Hibernate. Pour le support d'Annotation, vous devrez améliorer cette classe
"
+"helper comme suit :"
+
+#. Tag: programlisting
+#: setup.xml:92
+#, no-c-format
+msgid ""
+"package hello;\n"
+"\n"
+"import org.hibernate.*;\n"
+"import org.hibernate.cfg.*;\n"
+"import test.*;\n"
+"import test.animals.Dog;\n"
+"\n"
+"public class HibernateUtil {\n"
+"\n"
+"private static final SessionFactory sessionFactory;\n"
+"\n"
+" static {\n"
+" try {\n"
+"\n"
+" sessionFactory = new <emphasis role=\"bold"
+"\">AnnotationConfiguration()</emphasis>\n"
+" configure().buildSessionFactory();\n"
+" } catch (Throwable ex) {\n"
+" // Log exception!\n"
+" throw new ExceptionInInitializerError(ex);\n"
+" }\n"
+" }\n"
+"\n"
+" public static Session getSession()\n"
+" throws HibernateException {\n"
+" return sessionFactory.openSession();\n"
+" }\n"
+"}"
+msgstr ""
+"package hello;\n"
+"\n"
+"import org.hibernate.*;\n"
+"import org.hibernate.cfg.*;\n"
+"import test.*;\n"
+"import test.animals.Dog;\n"
+"\n"
+"public class HibernateUtil {\n"
+"\n"
+"private static final SessionFactory sessionFactory;\n"
+"\n"
+" static {\n"
+" try {\n"
+"\n"
+" sessionFactory = new <emphasis role=\"bold"
+"\">AnnotationConfiguration()</emphasis>\n"
+" configure().buildSessionFactory();\n"
+" } catch (Throwable ex) {\n"
+" // Log exception!\n"
+" throw new ExceptionInInitializerError(ex);\n"
+" }\n"
+" }\n"
+"\n"
+" public static Session getSession()\n"
+" throws HibernateException {\n"
+" return sessionFactory.openSession();\n"
+" }\n"
+"}"
+
+#. Tag: para
+#: setup.xml:94
+#, no-c-format
+msgid ""
+"Interesting here is the use of <classname>AnnotationConfiguration</"
+"classname>. The packages and annotated classes are declared in your regular
"
+"XML configuration file (usually
<filename>hibernate.cfg.xml</filename>). "
+"Here is the equivalent of the above declaration:"
+msgstr ""
+"Il est intéressant ici de noter l'utilisation de "
+"<classname>AnnotationConfiguration</classname>. Les packages et les
classes "
+"annotées sont déclarées dans votre fichier de configuration XML habituel "
+"(normalement <filename>hibernate.cfg.xml</filename>). Voici ci dessous
"
+"l'équivalent de la déclaration ci-dessus :"
+
+#. Tag: programlisting
+#: setup.xml:100
+#, no-c-format
+msgid ""
+"<!DOCTYPE hibernate-configuration PUBLIC\n"
+" \"-//Hibernate/Hibernate Configuration DTD 3.0//EN\"\n"
+" \"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"
+"\">\n"
+"\n"
+" <hibernate-configuration>\n"
+" <session-factory>\n"
+" <emphasis role=\"bold\"><mapping
package=\"test.animals\"/"
+">\n"
+" <mapping class=\"test.Flight\"/>\n"
+" <mapping class=\"test.Sky\"/>\n"
+" <mapping class=\"test.Person\"/>\n"
+" <mapping
class=\"test.animals.Dog\"/></emphasis>\n"
+"<emphasis role=\"bold\"> <mapping
resource=\"test/animals/orm."
+"xml\"/></emphasis>\n"
+" </session-factory>\n"
+" </hibernate-configuration>"
+msgstr ""
+"<!DOCTYPE hibernate-configuration PUBLIC\n"
+" \"-//Hibernate/Hibernate Configuration DTD 3.0//EN\"\n"
+" \"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"
+"\">\n"
+"\n"
+" <hibernate-configuration>\n"
+" <session-factory>\n"
+" <emphasis role=\"bold\"><mapping
package=\"test.animals\"/"
+">\n"
+" <mapping class=\"test.Flight\"/>\n"
+" <mapping class=\"test.Sky\"/>\n"
+" <mapping class=\"test.Person\"/>\n"
+" <mapping
class=\"test.animals.Dog\"/></emphasis>\n"
+"<emphasis role=\"bold\"> <mapping
resource=\"test/animals/orm."
+"xml\"/></emphasis>\n"
+" </session-factory>\n"
+" </hibernate-configuration>"
+
+#. Tag: para
+#: setup.xml:102
+#, no-c-format
+msgid ""
+"Note that you can mix the hbm.xml use and the new annotation one. The "
+"resource element can be either an hbm file or an EJB3 XML deployment "
+"descriptor. The distinction is transparent for your configuration process."
+msgstr ""
+"Notez que vous pouvez mêler l'utilisation d'hbm.xml et celle de la nouvelle
"
+"annotation. L'élément de ressource peut être soit un fichier hbm, soit un
"
+"descripteur de déploiement EJB3 XML. La distinction est transparente pour "
+"votre processus de configuration."
+
+#. Tag: para
+#: setup.xml:107
+#, no-c-format
+msgid ""
+"Alternatively, you can define the annotated classes and packages using the "
+"programmatic API"
+msgstr ""
+"Sinon, vous pouvez déterminer les packages et les classes annotées en "
+"utilisant l'API programmatique."
+
+#. Tag: programlisting
+#: setup.xml:110
+#, no-c-format
+msgid ""
+"sessionFactory = new <emphasis
role=\"bold\">AnnotationConfiguration()\n"
+" .addPackage(\"test.animals\") //the fully qualified package
name\n"
+" .addAnnotatedClass(Flight.class)\n"
+" .addAnnotatedClass(Sky.class)\n"
+" .addAnnotatedClass(Person.class)\n"
+" .addAnnotatedClass(Dog.class)</emphasis>\n"
+"<emphasis
role=\"bold\">.addResource(\"test/animals/orm.xml\")</emphasis>\n"
+" configure()..buildSessionFactory();"
+msgstr ""
+"sessionFactory = new <emphasis
role=\"bold\">AnnotationConfiguration()\n"
+" .addPackage(\"test.animals\") //the fully qualified package
name\n"
+" .addAnnotatedClass(Flight.class)\n"
+" .addAnnotatedClass(Sky.class)\n"
+" .addAnnotatedClass(Person.class)\n"
+" .addAnnotatedClass(Dog.class)</emphasis>\n"
+"<emphasis
role=\"bold\">.addResource(\"test/animals/orm.xml\")</emphasis>\n"
+" configure()..buildSessionFactory();"
+
+#. Tag: para
+#: setup.xml:112
+#, no-c-format
+msgid ""
+"You can also use the Hibernate EntityManager which has its own configuration
"
+"mechanism. Please refer to this project documentation for more details."
+msgstr ""
+"Vous pouvez également utiliser l'EntityManager Hibernate qui contient son
"
+"propre mécanisme de configuration. Veuillez vous référer à cette "
+"documentation de projet pour davantage de détails."
+
+#. Tag: para
+#: setup.xml:116
+#, no-c-format
+msgid ""
+"There is no other difference in the way you use Hibernate APIs with "
+"annotations, except for this startup routine change or in the configuration "
+"file. You can use your favorite configuration method for other properties "
+"( <filename>hibernate.properties</filename>,
<filename>hibernate.cfg.xml</"
+"filename>, programmatic APIs, etc). You can even mix annotated persistent
"
+"classes and classic <filename>hbm.cfg.xml</filename> declarations with
the "
+"same <classname>SessionFactory</classname>. You can however not declare
a "
+"class several times (whether annotated or through hbm.xml). You cannot mix "
+"configuration strategies (hbm vs annotations) in a mapped entity hierarchy "
+"either."
+msgstr ""
+"Il n'y a pas d'autres différences dans la façon dont vous utilisez les API
"
+"Hibernate avec Annotations, sauf pour ce changement de routine de démarrage "
+"ou dans le fichier de configuration. Vous pouvez utiliser votre méthode de "
+"configuration favorite pour les autres propriétés (
<filename>hibernate."
+"properties</filename>, <filename>hibernate.cfg.xml</filename>,
programmatic "
+"APIs, etc). Vous pouvez même mixer les classes persistantes annotées et les "
+"déclarations classiques <filename>hbm.cfg.xml</filename> avec les mêmes
"
+"<classname>SessionFactory</classname>. Vous avez la possibilité de ne
pas "
+"déclarer une classe plusieurs fois (qu'elle soit annotée ou par hbm.xml).
"
+"Vous ne pouvez pas mixer les stratégies de configuration (hbm vs "
+"annotations) dans une hiérarchie d'entités mappée non plus."
+
+#. Tag: para
+#: setup.xml:128
+#, no-c-format
+msgid ""
+"To ease the migration process from hbm files to annotations, the "
+"configuration mechanism detects the mapping duplication between annotations "
+"and hbm files. HBM files are then prioritized over annotated metadata on a "
+"class to class basis. You can change the priority using
<literal>hibernate."
+"mapping.precedence</literal> property. The default is <literal>hbm,
class</"
+"literal>, changing it to <literal>class, hbm</literal> will
prioritize the "
+"annotated classes over hbm files when a conflict occurs."
+msgstr ""
+"Pour faciliter le processus de migration des fichiers hbm vers les "
+"annotations, le mécanisme de configuration détecte la duplication de mappage
"
+"entre les annotations et les fichiers hbm. Les fichiers HBM ont alors "
+"priorité par rapport aux metadonnées annotées sur la base d'une classe Ã
"
+"l'autre. Vous pouvez changer l'ordre de priorité en utilisant la propriété
"
+"<literal>hibernate.mapping.precedence</literal>. La valeur par défaut
est "
+"<literal>hbm, class</literal>; la changer en <literal>class,
hbm</literal> "
+"va donner la priorité aux classes annotées par rapport aux fichiers hbm "
+"quand un conflit a lieu."
+
+#. Tag: title
+#: setup.xml:139
+#, no-c-format
+msgid "Properties"
+msgstr "Propriétés"
+
+#. Tag: para
+#: setup.xml:141
+#, no-c-format
+msgid ""
+"Asides from the Hibernate core properties, Hibernate Annotations reacts to "
+"the following one"
+msgstr "En dehors des propriétés Hibernate core, Hibernate Annotations réagit à la
propriété suivante :"
+
+#. Tag: title
+#: setup.xml:146
+#, no-c-format
+msgid "Logging"
+msgstr "Logging"
+
+#. Tag: para
+#: setup.xml:148
+#, no-c-format
+msgid ""
+"Hibernate Annotations utilizes <ulink
url=\"http://www.slf4j.org/\">Simple "
+"Logging Facade for Java</ulink> (SLF4J) in order to log various system
"
+"events. SLF4J can direct your logging output to several logging frameworks "
+"(NOP, Simple, log4j version 1.2, JDK 1.4 logging, JCL or logback) depending "
+"on your chosen binding. In order to setup logging properly you will need "
+"<filename>slf4j-api.jar</filename> in your classpath together with the
jar "
+"file for your preferred binding -
<filename>slf4j-log4j12.jar</filename> in "
+"the case of Log4J. See the SLF4J <ulink type=\"\"
url=\"http://www.slf4j.org/"
+"manual.html\">documentation</ulink> for more detail."
+msgstr ""
+"Hibernate Annotations utilise <ulink
url=\"http://www.slf4j.org/\">Simple "
+"Logging Facade for Java</ulink> (SLF4J) pour pouvoir journaliser différents
événements système. SLF4J peut rediriger vos sorties vers divers frameworks de
journalisation (NOP, simple, log4j version 1.2, 1.4 JDK journalisation, JCL ou logback) en
fonction de votre liaison choisie. Pour configurer la connexion correctement, vous aurez
besoin de "
+"<filename>slf4j-api.jar</filename> dans le chemin d'accès aux
classes avec le fichier jar pour votre liaison préférée -
<filename>slf4j-log4j12.jar</filename> dans le cas de Log4J. Voir la SLF4J
<ulink type=\"\"
url=\"http://www.slf4j.org/"
+"manual.html\">documentation</ulink> pour en savoir plus."
+
+#. Tag: para
+#: setup.xml:160
+#, no-c-format
+msgid "The logging categories interesting for Hibernate Annotations are:"
+msgstr "Les catégories de journalisation intéressantes d'Hibernate Annotations
sont les suivantes :"
+
+#. Tag: title
+#: setup.xml:164
+#, no-c-format
+msgid "Hibernate Annotations Log Categories"
+msgstr "Catégories de journalisation d'Hibernate Annotations."
+
+#. Tag: entry
+#: setup.xml:169
+#, no-c-format
+msgid "Category"
+msgstr "Catégorie"
+
+#. Tag: entry
+#: setup.xml:171
+#, no-c-format
+msgid "Function"
+msgstr "Fonction"
+
+#. Tag: emphasis
+#: setup.xml:177
+#, no-c-format
+msgid "org.hibernate.cfg"
+msgstr "org.hibernate.cfg"
+
+#. Tag: entry
+#: setup.xml:179
+#, no-c-format
+msgid "Log all configuration related events (not only annotations)."
+msgstr "Enregistrer tous les événements de configuration (et non pas les annotations
uniquement)."
+
+#. Tag: para
+#: setup.xml:186
+#, no-c-format
+msgid ""
+"For further category configuration refer to the <ulink
url=\"http://www."
+"hibernate.org/hib_docs/v3/reference/en/html_single/#configuration-logging"
+"\">Logging</ulink> in the Hibernate Core documentation."
+msgstr ""
+"Pour obtenir davantage d'informations sur la configuration de catégories,
veuillez vous référer à <ulink url=\"http://www."
+"hibernate.org/hib_docs/v3/reference/en/html_single/#configuration-logging"
+"\">Logging</ulink> dans la documentation Hibernate Core."
+
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/fr-FR/xml-overriding.po
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/fr-FR/xml-overriding.po
(rev 0)
+++ annotations/branches/v3_4_0_GA_CP/src/main/docbook/fr-FR/xml-overriding.po 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,712 @@
+# translation of xml-overriding.po to French
+# Language /tmp/mike/JBEAP420/Annotations translations for JBEAP package.
+# Copyright (C) 2007, 2009 Free Software Foundation, Inc.
+#
+# Automatically generated, 2007.
+# Corina Roe <croe(a)redhat.com>, 2009.
+msgid ""
+msgstr ""
+"Project-Id-Version: xml-overriding\n"
+"Report-Msgid-Bugs-To:
http://bugs.kde.org\n"
+"POT-Creation-Date: 2009-09-15 03:08+0000\n"
+"PO-Revision-Date: 2009-11-18 11:29+1000\n"
+"Last-Translator: Corina Roe <croe(a)redhat.com>\n"
+"Language-Team: French <i18(a)redhat.com>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: KBabel 1.11.4\n"
+
+#. Tag: title
+#: xml-overriding.xml:28
+#, no-c-format
+msgid "Overriding metadata through XML"
+msgstr "Surcharger les metadonnées par XML"
+
+#. Tag: para
+#: xml-overriding.xml:30
+#, no-c-format
+msgid ""
+"The primary target for metadata in EJB3 is annotations, but the EJB3 "
+"specification provides a way to override or replace the annotation defined "
+"metadata through an XML deployment descriptor. In the current release only "
+"pure EJB3 annotations overriding are supported. If you wish to use Hibernate
"
+"specific features in some entities, you'll have to either use annotations or
"
+"fallback to hbm files. You can of course mix and match annotated entities "
+"and entities describes in hbm files."
+msgstr ""
+"La cible principale des métadonnées d'EJB3 est Annotations, mais la "
+"spécification EJB3 fournit un moyen de surcharger ou de remplacer les "
+"métadonnées définies par Annotations grâce à un descripteur de déploiement "
+"XML. Dans la version actuelle, seules les surcharges d'annotations EJB3 "
+"pures sont prises en charge. SI vous souhaitez utiliser les fonctionnalités "
+"spécifiques Hibernate pour certaines entités, vous devrez, soit utiliser "
+"Annotations, soit vous retourner sur les fichiers hbm. Vous pouvez, bien "
+"entendu, mélanger et faire correspondre les entités annotées et les entités "
+"décrites dans les fichiers hbm."
+
+#. Tag: para
+#: xml-overriding.xml:38
+#, no-c-format
+msgid "The unit test suite shows some additional XML file samples."
+msgstr "La suite de tests montre quelques exemples de fichiers XML
supplémentaires."
+
+#. Tag: title
+#: xml-overriding.xml:41
+#, no-c-format
+msgid "Principles"
+msgstr "Principes"
+
+#. Tag: para
+#: xml-overriding.xml:43
+#, no-c-format
+msgid ""
+"The XML deployment descriptor structure has been designed to reflect the "
+"annotations one. So if you know the annotations structure, using the XML "
+"schema will be straightforward for you."
+msgstr ""
+"La structure du descriptor de déploiement XML a été conçue pour refléter "
+"celle d'Annotations. Donc, si vous êtes familiers avec la structure "
+"d'Annotations, il vous sera facile d'utiliser le schéma XML."
+
+#. Tag: para
+#: xml-overriding.xml:47
+#, no-c-format
+msgid ""
+"You can define one ot more XML files describing your metadata, these files "
+"will be merged by the overriding engine."
+msgstr ""
+"Vous pouvez déterminer un ou plusieurs fichiers XML pour décrire vos "
+"metadonnées. Ces fichiers seront fusionnés par le moteur de surcharge."
+
+#. Tag: title
+#: xml-overriding.xml:51
+#, no-c-format
+msgid "Global level metadata"
+msgstr "Métadonnées au niveau global"
+
+#. Tag: para
+#: xml-overriding.xml:53
+#, no-c-format
+msgid ""
+"You can define global level metadata available for all XML files. You must "
+"not define these metadata more than once per deployment."
+msgstr ""
+"Vous pouvez déterminer les métadonnées de niveau global qui sont disponibles
"
+"pour tous les fichiers XML. Vous ne devez pas définir ces métadonnées plus "
+"d'une fois par déploiement."
+
+#. Tag: programlisting
+#: xml-overriding.xml:56
+#, no-c-format
+msgid ""
+"<?xml version=\"1.0\"
encoding=\"UTF-8\"?>\n"
+"\n"
+"<entity-mappings \n"
+"
xmlns=\"http://java.sun.com/xml/ns/persistence/orm\"\n"
+"
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
+"
xsi:schemaLocation=\"http://java.sun.com/xml/ns/persistence/orm
orm_1_0.xsd"
+"\"\n"
+" version=\"1.0\">\n"
+"\n"
+" <persistence-unit-metadata>\n"
+" <xml-mapping-metadata-complete/>\n"
+" <persistence-unit-defaults>\n"
+" <schema>myschema</schema>\n"
+" <catalog>mycatalog</catalog>\n"
+" <cascade-persist/>\n"
+" </persistence-unit-defaults>\n"
+" </persistence-unit-metadata>"
+msgstr ""
+"<?xml version=\"1.0\"
encoding=\"UTF-8\"?>\n"
+"\n"
+"<entity-mappings \n"
+"
xmlns=\"http://java.sun.com/xml/ns/persistence/orm\"\n"
+"
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
+"
xsi:schemaLocation=\"http://java.sun.com/xml/ns/persistence/orm
orm_1_0.xsd"
+"\"\n"
+" version=\"1.0\">\n"
+"\n"
+" <persistence-unit-metadata>\n"
+" <xml-mapping-metadata-complete/>\n"
+" <persistence-unit-defaults>\n"
+" <schema>myschema</schema>\n"
+" <catalog>mycatalog</catalog>\n"
+" <cascade-persist/>\n"
+" </persistence-unit-defaults>\n"
+" </persistence-unit-metadata>"
+
+#. Tag: para
+#: xml-overriding.xml:58
+#, no-c-format
+msgid ""
+"<literal>xml-mapping-metadata-complete</literal> means that all entity,
"
+"mapped-superclasses and embeddable metadata should be picked up from XML (ie
"
+"ignore annotations)."
+msgstr ""
+"<literal>xml-mapping-metadata-complete</literal> signifie que toutes
les "
+"entités, les superclasses-mappées et les métadonnées intégrables devront "
+"être extraites à partir d'XML (c'est à dire en ignorant
Annotations)."
+
+#. Tag: para
+#: xml-overriding.xml:62
+#, no-c-format
+msgid ""
+"<literal>schema / catalog</literal> will override all default
definitions of "
+"schema and catalog in the metadata (both XML and annotations)."
+msgstr ""
+"<literal>schema / catalog</literal> va surcharger toutes les
définitions par "
+"défaut de schémas ou de catalogues dans les metadonnées (XML et
annotations)."
+
+#. Tag: para
+#: xml-overriding.xml:66
+#, no-c-format
+msgid ""
+"<literal>cascade-persist</literal> means that all associations have
PERSIST "
+"as a cascade type. We recommend you to not use this feature."
+msgstr ""
+"<literal>cascade-persist</literal> signifie que toutes les associations
on "
+"PERSIST comme type de cascade. Nous vous conseillons de ne pas utiliser "
+"cette fonctionnalité."
+
+#. Tag: title
+#: xml-overriding.xml:72
+#, no-c-format
+msgid "Entity level metadata"
+msgstr "Métadonnées au niveau entité"
+
+#. Tag: para
+#: xml-overriding.xml:74
+#, no-c-format
+msgid "You can either define or override metadata informations on a given
entity."
+msgstr ""
+"Vous pouvez soit définir, soit surcharger les métadonnées sur une entité "
+"donnée."
+
+#. Tag: section
+#: xml-overriding.xml:75
+#, no-c-format
+msgid ""
+"<programlistingco> <areaspec> <area coords=\"3 85\"
id=\"aa1\"/> <area "
+"coords=\"9 85\" id=\"aa2\"/> <area coords=\"10
85\" id=\"aa3\"/> <area "
+"coords=\"11 85\" id=\"aa4\"/> <area coords=\"17
85\" id=\"aa5\"/> <area "
+"coords=\"23 85\" id=\"aa6\"/> <area coords=\"24
85\" id=\"aa7\"/> <area "
+"coords=\"25 85\" id=\"aa8\"/> <area coords=\"26
85\" id=\"aa9\"/> <area "
+"coords=\"31 85\" id=\"aa10\"/> </areaspec>
<programlisting><?xml version="
+"\"1.0\" encoding=\"UTF-8\"?>\n"
+"\n"
+"<entity-mappings \n"
+"
xmlns=\"http://java.sun.com/xml/ns/persistence/orm\"\n"
+"
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
+"
xsi:schemaLocation=\"http://java.sun.com/xml/ns/persistence/orm
orm_1_0.xsd"
+"\"\n"
+" version=\"1.0\">\n"
+"\n"
+"
<package>org.hibernate.test.annotations.reflection</"
+"package>\n"
+" <entity class=\"Administration\" access=\"PROPERTY\"
metadata-"
+"complete=\"true\">\n"
+" <table name=\"tbl_admin\">\n"
+" <unique-constraint>\n"
+"
<column-name>firstname</column-name>\n"
+"
<column-name>lastname</column-name>\n"
+" </unique-constraint>\n"
+" </table>\n"
+" <secondary-table name=\"admin2\">\n"
+" <primary-key-join-column name=\"admin_id\"
referenced-column-"
+"name=\"id\"/>\n"
+" <unique-constraint>\n"
+"
<column-name>address</column-name>\n"
+" </unique-constraint>\n"
+" </secondary-table>\n"
+" <id-class class=\"SocialSecurityNumber\"/>\n"
+" <inheritance strategy=\"JOINED\"/>\n"
+" <sequence-generator name=\"seqhilo\"
sequence-name=\"seqhilo\"/"
+">\n"
+" <table-generator name=\"table\"
table=\"tablehilo\"/>\n"
+" ...\n"
+" </entity>\n"
+"\n"
+" <entity class=\"PostalAdministration\">\n"
+" <primary-key-join-column name=\"id\"/>\n"
+" ...\n"
+" </entity>\n"
+"</entity-mappings></programlisting> <calloutlist>
<callout arearefs="
+"\"aa1\"> <para><literal>entity-mappings</literal>:
entity-mappings is the "
+"root element for all XML files. You must declare the xml schema, the schema "
+"file is included in the hibernate-annotations.jar file, no internet access "
+"will be processed by Hibernate Annotations.</para> </callout>
<callout "
+"arearefs=\"aa2\"> <para><literal>package</literal>
(optional): default "
+"package used for all non qualified class names in the given deployment "
+"descriptor file.</para> </callout> <callout
arearefs=\"aa3\"> "
+"<para><literal>entity</literal>: desribes an entity.</para>
"
+"<para><literal>metadata-complete</literal> defines whether the
metadata "
+"description for this element is complete or not (in other words, if "
+"annotations present at the class level should be considered or not).</para>
"
+"<para>An entity has to have a <literal>class</literal> attribute
refering "
+"the java class the metadata applies on.</para> <para>You can overrides
"
+"entity name through the <literal>name</literal> attribute, if none is
"
+"defined and if an <literal>(a)Entity.name</literal> is present, then it
is "
+"used (provided that metadata complete is not set).</para> <para>For
metadata "
+"complete (see below) element, you can define an
<literal>access</literal> "
+"(either <literal>FIELD</literal> or
<literal>PROPERTY</literal> (default)). "
+"For non medatada complete element, if <literal>access</literal> is not
"
+"defined, the @Id position will lead position, if
<literal>access</literal> "
+"is defined, the value is used.</para> </callout> <callout
arearefs=\"aa4\"> "
+"<para><literal>table</literal>: you can declare table properties
(name, "
+"schema, catalog), if none is defined, the java annotation is used.</para>
"
+"<para>You can define one or several unique constraints as seen in the "
+"example</para> </callout> <callout arearefs=\"aa5\">
"
+"<para><literal>secondary-table</literal>: defines a secondary
table very "
+"much like a regular table except that you can define the primary key / "
+"foreign key column(s) through the
<literal>primary-key-join-column</literal> "
+"element. On non metadata complete, annotation secondary tables are used only
"
+"if there is no <literal>secondary-table</literal> definition,
annotations "
+"are ignored otherwise.</para> </callout> <callout
arearefs=\"aa6\"> "
+"<para><literal>id-class</literal>: defines the id class in a
similar way "
+"<literal>@IdClass</literal> does</para> </callout>
<callout arearefs=\"aa7"
+"\"> <para><literal>inheritance</literal>: defines the
inheritance strategy "
+"(<literal>JOINED</literal>,
<literal>TABLE_PER_CLASS</literal>, "
+"<literal>SINGLE_TABLE</literal>), Available only at the root entity
level</"
+"para> </callout> <callout arearefs=\"aa8\">
<para><literal>sequence-"
+"generator</literal>: defines a sequence generator</para>
</callout> <callout "
+"arearefs=\"aa9\">
<para><literal>table-generator</literal>: defines a table "
+"generator</para> </callout> <callout arearefs=\"aa10\">
"
+"<para><literal><literal>primary-key-join-column</literal></literal>:
defines "
+"the primary key join column for sub entities when JOINED inheritance "
+"strategy is used</para> </callout> </calloutlist>
</programlistingco> "
+"<programlistingco> <areaspec> <area coords=\"11 85\"
id=\"ab1\"/> <area "
+"coords=\"18 85\" id=\"ab2\"/> <area coords=\"22
85\" id=\"ab3\"/> <area "
+"coords=\"28 85\" id=\"ab4\"/> <area coords=\"34
85\" id=\"ab5\"/> </"
+"areaspec> <programlisting><?xml version=\"1.0\"
encoding=\"UTF-8\"?>\n"
+"\n"
+"<entity-mappings \n"
+"
xmlns=\"http://java.sun.com/xml/ns/persistence/orm\"\n"
+"
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
+"
xsi:schemaLocation=\"http://java.sun.com/xml/ns/persistence/orm
orm_1_0.xsd"
+"\"\n"
+" version=\"1.0\">\n"
+"\n"
+"
<package>org.hibernate.test.annotations.reflection</"
+"package>\n"
+" <entity class=\"Music\" access=\"PROPERTY\"
metadata-complete=\"true"
+"\">\n"
+"
<discriminator-value>Generic</discriminator-value>\n"
+" <discriminator-column length=\"34\"/>\n"
+" ...\n"
+" </entity>\n"
+"\n"
+" <entity class=\"PostalAdministration\">\n"
+" <primary-key-join-column name=\"id\"/>\n"
+" <named-query name=\"adminById\">\n"
+" <query>select m from Administration m where m.id =
:id</"
+"query>\n"
+" <hint name=\"org.hibernate.timeout\"
value=\"200\"/>\n"
+" </named-query>\n"
+" <named-native-query name=\"allAdmin\"
result-set-mapping=\"adminrs"
+"\">\n"
+" <query>select *, count(taxpayer_id) as taxPayerNumber
\n"
+" from Administration, TaxPayer\n"
+" where taxpayer_admin_id = admin_id group by
...</query>\n"
+" <hint name=\"org.hibernate.timeout\"
value=\"200\"/>\n"
+" </named-native-query>\n"
+" <sql-result-set-mapping name=\"adminrs\">\n"
+" <entity-result
entity-class=\"Administration\">\n"
+" <field-result name=\"name\"
column=\"fld_name\"/>\n"
+" </entity-result>\n"
+" <column-result
name=\"taxPayerNumber\"/>\n"
+" </sql-result-set-mapping>\n"
+" <attribute-override name=\"ground\">\n"
+" <column name=\"fld_ground\" unique=\"true\"
scale=\"2\"/>\n"
+" </attribute-override>\n"
+" <association-override name=\"referer\">\n"
+" <join-column name=\"referer_id\"
referenced-column-name=\"id"
+"\"/>\n"
+" </association-override>\n"
+" ...\n"
+" </entity>\n"
+"</entity-mappings></programlisting> <calloutlist>
<callout arearefs="
+"\"ab1\"> <para><literal>discriminator-value /
discriminator-column</"
+"literal>: defines the discriminator value and the column holding it when the
"
+"SINGLE_TABLE inheritance strategy is chosen</para> </callout>
<callout "
+"arearefs=\"ab2\">
<para><literal>named-query</literal>: defines named "
+"queries and possibly the hints associated to them. Those definitions are "
+"additive to the one defined in annotations, if two definitions have the same
"
+"name, the XML one has priority.</para> </callout> <callout
arearefs=\"ab3\"> "
+"<para><literal>named-native-query</literal>: defines an named
native query "
+"and its sql result set mapping. Alternatively, you can define the "
+"<literal>result-class</literal>. Those definitions are additive to the
one "
+"defined in annotations, if two definitions have the same name, the XML one "
+"has priority.</para> </callout> <callout
arearefs=\"ab4\"> "
+"<para><literal>sql-result-set-mapping</literal>: describes the
result set "
+"mapping structure. You can define both entity and column mappings. Those "
+"definitions are additive to the one defined in annotations, if two "
+"definitions have the same name, the XML one has priority</para>
</callout> "
+"<callout arearefs=\"ab5\">
<para><literal>attribute-override / association-"
+"override</literal>: defines a column or join column overriding. This "
+"overriding is additive to the one defined in annotations</para>
</callout> </"
+"calloutlist> </programlistingco>"
+msgstr ""
+"<programlistingco> <areaspec> <area coords=\"3 85\"
id=\"aa1\"/> <area "
+"coords=\"9 85\" id=\"aa2\"/> <area coords=\"10
85\" id=\"aa3\"/> <area "
+"coords=\"11 85\" id=\"aa4\"/> <area coords=\"17
85\" id=\"aa5\"/> <area "
+"coords=\"23 85\" id=\"aa6\"/> <area coords=\"24
85\" id=\"aa7\"/> <area "
+"coords=\"25 85\" id=\"aa8\"/> <area coords=\"26
85\" id=\"aa9\"/> <area "
+"coords=\"31 85\" id=\"aa10\"/> </areaspec>
<programlisting><?xml version="
+"\"1.0\" encoding=\"UTF-8\"?>\n"
+"\n"
+"<entity-mappings \n"
+"
xmlns=\"http://java.sun.com/xml/ns/persistence/orm\"\n"
+"
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
+"
xsi:schemaLocation=\"http://java.sun.com/xml/ns/persistence/orm
orm_1_0.xsd"
+"\"\n"
+" version=\"1.0\">\n"
+"\n"
+"
<package>org.hibernate.test.annotations.reflection</"
+"package>\n"
+" <entity class=\"Administration\" access=\"PROPERTY\"
metadata-"
+"complete=\"true\">\n"
+" <table name=\"tbl_admin\">\n"
+" <unique-constraint>\n"
+"
<column-name>firstname</column-name>\n"
+"
<column-name>lastname</column-name>\n"
+" </unique-constraint>\n"
+" </table>\n"
+" <secondary-table name=\"admin2\">\n"
+" <primary-key-join-column name=\"admin_id\"
referenced-column-"
+"name=\"id\"/>\n"
+" <unique-constraint>\n"
+"
<column-name>address</column-name>\n"
+" </unique-constraint>\n"
+" </secondary-table>\n"
+" <id-class class=\"SocialSecurityNumber\"/>\n"
+" <inheritance strategy=\"JOINED\"/>\n"
+" <sequence-generator name=\"seqhilo\"
sequence-name=\"seqhilo\"/"
+">\n"
+" <table-generator name=\"table\"
table=\"tablehilo\"/>\n"
+" ...\n"
+" </entity>\n"
+"\n"
+" <entity class=\"PostalAdministration\">\n"
+" <primary-key-join-column name=\"id\"/>\n"
+" ...\n"
+" </entity>\n"
+"</entity-mappings></programlisting> <calloutlist>
<callout arearefs="
+"\"aa1\"> <para><literal>entity-mappings</literal>:
entity-mappings is the "
+"root element for all XML files. You must declare the xml schema, the schema "
+"file is included in the hibernate-annotations.jar file, no internet access "
+"will be processed by Hibernate Annotations.</para> </callout>
<callout "
+"arearefs=\"aa2\"> <para><literal>package</literal>
(optional): default "
+"package used for all non qualified class names in the given deployment "
+"descriptor file.</para> </callout> <callout
arearefs=\"aa3\"> "
+"<para><literal>entity</literal>: desribes an entity.</para>
"
+"<para><literal>metadata-complete</literal> defines whether the
metadata "
+"description for this element is complete or not (in other words, if "
+"annotations present at the class level should be considered or not).</para>
"
+"<para>An entity has to have a <literal>class</literal> attribute
refering "
+"the java class the metadata applies on.</para> <para>You can overrides
"
+"entity name through the <literal>name</literal> attribute, if none is
"
+"defined and if an <literal>(a)Entity.name</literal> is present, then it
is "
+"used (provided that metadata complete is not set).</para> <para>For
metadata "
+"complete (see below) element, you can define an
<literal>access</literal> "
+"(either <literal>FIELD</literal> or
<literal>PROPERTY</literal> (default)). "
+"For non medatada complete element, if <literal>access</literal> is not
"
+"defined, the @Id position will lead position, if
<literal>access</literal> "
+"is defined, the value is used.</para> </callout> <callout
arearefs=\"aa4\"> "
+"<para><literal>table</literal>: you can declare table properties
(name, "
+"schema, catalog), if none is defined, the java annotation is used.</para>
"
+"<para>You can define one or several unique constraints as seen in the "
+"example</para> </callout> <callout arearefs=\"aa5\">
"
+"<para><literal>secondary-table</literal>: defines a secondary
table very "
+"much like a regular table except that you can define the primary key / "
+"foreign key column(s) through the
<literal>primary-key-join-column</literal> "
+"element. On non metadata complete, annotation secondary tables are used only
"
+"if there is no <literal>secondary-table</literal> definition,
annotations "
+"are ignored otherwise.</para> </callout> <callout
arearefs=\"aa6\"> "
+"<para><literal>id-class</literal>: defines the id class in a
similar way "
+"<literal>@IdClass</literal> does</para> </callout>
<callout arearefs=\"aa7"
+"\"> <para><literal>inheritance</literal>: defines the
inheritance strategy "
+"(<literal>JOINED</literal>,
<literal>TABLE_PER_CLASS</literal>, "
+"<literal>SINGLE_TABLE</literal>), Available only at the root entity
level</"
+"para> </callout> <callout arearefs=\"aa8\">
<para><literal>sequence-"
+"generator</literal>: defines a sequence generator</para>
</callout> <callout "
+"arearefs=\"aa9\">
<para><literal>table-generator</literal>: defines a table "
+"generator</para> </callout> <callout arearefs=\"aa10\">
"
+"<para><literal><literal>primary-key-join-column</literal></literal>:
defines "
+"the primary key join column for sub entities when JOINED inheritance "
+"strategy is used</para> </callout> </calloutlist>
</programlistingco> "
+"<programlistingco> <areaspec> <area coords=\"11 85\"
id=\"ab1\"/> <area "
+"coords=\"18 85\" id=\"ab2\"/> <area coords=\"22
85\" id=\"ab3\"/> <area "
+"coords=\"28 85\" id=\"ab4\"/> <area coords=\"34
85\" id=\"ab5\"/> </"
+"areaspec> <programlisting><?xml version=\"1.0\"
encoding=\"UTF-8\"?>\n"
+"\n"
+"<entity-mappings \n"
+"
xmlns=\"http://java.sun.com/xml/ns/persistence/orm\"\n"
+"
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
+"
xsi:schemaLocation=\"http://java.sun.com/xml/ns/persistence/orm
orm_1_0.xsd"
+"\"\n"
+" version=\"1.0\">\n"
+"\n"
+"
<package>org.hibernate.test.annotations.reflection</"
+"package>\n"
+" <entity class=\"Music\" access=\"PROPERTY\"
metadata-complete=\"true"
+"\">\n"
+"
<discriminator-value>Generic</discriminator-value>\n"
+" <discriminator-column length=\"34\"/>\n"
+" ...\n"
+" </entity>\n"
+"\n"
+" <entity class=\"PostalAdministration\">\n"
+" <primary-key-join-column name=\"id\"/>\n"
+" <named-query name=\"adminById\">\n"
+" <query>select m from Administration m where m.id =
:id</"
+"query>\n"
+" <hint name=\"org.hibernate.timeout\"
value=\"200\"/>\n"
+" </named-query>\n"
+" <named-native-query name=\"allAdmin\"
result-set-mapping=\"adminrs"
+"\">\n"
+" <query>select *, count(taxpayer_id) as taxPayerNumber
\n"
+" from Administration, TaxPayer\n"
+" where taxpayer_admin_id = admin_id group by
...</query>\n"
+" <hint name=\"org.hibernate.timeout\"
value=\"200\"/>\n"
+" </named-native-query>\n"
+" <sql-result-set-mapping name=\"adminrs\">\n"
+" <entity-result
entity-class=\"Administration\">\n"
+" <field-result name=\"name\"
column=\"fld_name\"/>\n"
+" </entity-result>\n"
+" <column-result
name=\"taxPayerNumber\"/>\n"
+" </sql-result-set-mapping>\n"
+" <attribute-override name=\"ground\">\n"
+" <column name=\"fld_ground\" unique=\"true\"
scale=\"2\"/>\n"
+" </attribute-override>\n"
+" <association-override name=\"referer\">\n"
+" <join-column name=\"referer_id\"
referenced-column-name=\"id"
+"\"/>\n"
+" </association-override>\n"
+" ...\n"
+" </entity>\n"
+"</entity-mappings></programlisting> <calloutlist>
<callout arearefs="
+"\"ab1\"> <para><literal>discriminator-value /
discriminator-column</"
+"literal>: defines the discriminator value and the column holding it when the
"
+"SINGLE_TABLE inheritance strategy is chosen</para> </callout>
<callout "
+"arearefs=\"ab2\">
<para><literal>named-query</literal>: defines named "
+"queries and possibly the hints associated to them. Those definitions are "
+"additive to the one defined in annotations, if two definitions have the same
"
+"name, the XML one has priority.</para> </callout> <callout
arearefs=\"ab3\"> "
+"<para><literal>named-native-query</literal>: defines an named
native query "
+"and its sql result set mapping. Alternatively, you can define the "
+"<literal>result-class</literal>. Those definitions are additive to the
one "
+"defined in annotations, if two definitions have the same name, the XML one "
+"has priority.</para> </callout> <callout
arearefs=\"ab4\"> "
+"<para><literal>sql-result-set-mapping</literal>: describes the
result set "
+"mapping structure. You can define both entity and column mappings. Those "
+"definitions are additive to the one defined in annotations, if two "
+"definitions have the same name, the XML one has priority</para>
</callout> "
+"<callout arearefs=\"ab5\">
<para><literal>attribute-override / association-"
+"override</literal>: defines a column or join column overriding. This "
+"overriding is additive to the one defined in annotations</para>
</callout> </"
+"calloutlist> </programlistingco>"
+
+#. Tag: para
+#: xml-overriding.xml:246
+#, no-c-format
+msgid ""
+"Same applies for <literal><embeddable></literal> and
<literal><"
+"mapped-superclass></literal>."
+msgstr ""
+"La même chose s'applique pour
<literal><embeddable></literal> et pour "
+"<literal><mapped-superclass></literal>."
+
+#. Tag: title
+#: xml-overriding.xml:251
+#, no-c-format
+msgid "Property level metadata"
+msgstr "Métadonnées au niveau propriété"
+
+#. Tag: para
+#: xml-overriding.xml:253
+#, no-c-format
+msgid ""
+"You can of course defines XML overriding for properties. If metadata "
+"complete is defined, then additional properties (ie at the Java level) will "
+"be ignored. Otherwise, once you start overriding a property, all annotations
"
+"on the given property are ignored. All property level metadata behave in "
+"<literal>entity/attributes</literal>,
<literal>mapped-superclass/attributes</"
+"literal> or <literal>embeddable/attributes</literal>."
+msgstr ""
+"Vous pouvez biensûr définir le surchargement XML pour les propriétés. Si "
+"metadata complete est défini, alors les propriétés supplémentaires (c'est Ã
"
+"dire niveau Java) seront ignorées. Sinon, une fois que vous aurez surchargé "
+"une propriété, toutes les annotations d'une propriété donnée seront "
+"ignorées. Toutes les métadonnées (metadata) du niveau propriété, se "
+"comportent en <literal>entity/attributes</literal>,
<literal>mapped-"
+"superclass/attributes</literal> ou
<literal>embeddable/attributes</literal>."
+
+#. Tag: programlisting
+#: xml-overriding.xml:261
+#, no-c-format
+msgid ""
+"<attributes>\n"
+" <id name=\"id\">\n"
+" <column name=\"fld_id\"/>\n"
+" <generated-value generator=\"generator\"
strategy=\"SEQUENCE"
+"\"/>\n"
+" <temporal>DATE</temporal>\n"
+" <sequence-generator name=\"generator\"
sequence-name=\"seq\"/"
+">\n"
+" </id>\n"
+" <version name=\"version\"/>\n"
+" <embedded name=\"embeddedObject\">\n"
+" <attribute-override
name\"subproperty\">\n"
+" <column name=\"my_column\"/>\n"
+" </attribute-override>\n"
+" </embedded>\n"
+" <basic name=\"status\"
optional=\"false\">\n"
+" <enumerated>STRING</enumerated>\n"
+" </basic>\n"
+" <basic name=\"serial\"
optional=\"true\">\n"
+" <column name=\"serialbytes\"/>\n"
+" <lob/>\n"
+" </basic>\n"
+" <basic name=\"terminusTime\"
fetch=\"LAZY\">\n"
+" <temporal>TIMESTAMP</temporal>\n"
+" </basic>\n"
+" </attributes>"
+msgstr ""
+"<attributes>\n"
+" <id name=\"id\">\n"
+" <column name=\"fld_id\"/>\n"
+" <generated-value generator=\"generator\"
strategy=\"SEQUENCE"
+"\"/>\n"
+" <temporal>DATE</temporal>\n"
+" <sequence-generator name=\"generator\"
sequence-name=\"seq\"/"
+">\n"
+" </id>\n"
+" <version name=\"version\"/>\n"
+" <embedded name=\"embeddedObject\">\n"
+" <attribute-override
name\"subproperty\">\n"
+" <column name=\"my_column\"/>\n"
+" </attribute-override>\n"
+" </embedded>\n"
+" <basic name=\"status\"
optional=\"false\">\n"
+" <enumerated>STRING</enumerated>\n"
+" </basic>\n"
+" <basic name=\"serial\"
optional=\"true\">\n"
+" <column name=\"serialbytes\"/>\n"
+" <lob/>\n"
+" </basic>\n"
+" <basic name=\"terminusTime\"
fetch=\"LAZY\">\n"
+" <temporal>TIMESTAMP</temporal>\n"
+" </basic>\n"
+" </attributes>"
+
+#. Tag: para
+#: xml-overriding.xml:263
+#, no-c-format
+msgid ""
+"You can override a property through <literal>id</literal>,
<literal>embedded-"
+"id</literal>, <literal>version</literal>,
<literal>embedded</literal> and "
+"<literal>basic</literal>. Each of these elements can have subelements
"
+"accordingly: <literal>lob</literal>,
<literal>temporal</literal>, "
+"<literal>enumerated</literal>,
<literal>column</literal>."
+msgstr ""
+"Vous pouvez surcharger une propriété par <literal>id</literal>, "
+"<literal>embedded-id</literal>, <literal>version</literal>,
"
+"<literal>embedded</literal> et <literal>basic</literal>.
Chacun de ces "
+"éléments peuvent avoir des sous-éléments en conséqunce :
<literal>lob</"
+"literal>, <literal>temporal</literal>,
<literal>enumerated</literal>, "
+"<literal>column</literal>."
+
+#. Tag: title
+#: xml-overriding.xml:272
+#, no-c-format
+msgid "Association level metadata"
+msgstr "Métadonnées du niveau association"
+
+#. Tag: para
+#: xml-overriding.xml:274
+#, no-c-format
+msgid ""
+"You can define XML overriding for associations. All association level "
+"metadata behave in <literal>entity/attributes</literal>,
<literal>mapped-"
+"superclass/attributes</literal> or
<literal>embeddable/attributes</literal>."
+msgstr ""
+"Vous pouvez définir la surcharge XML pour les associations. Toutes les "
+"métadonnées du niveau association se comportent en <literal>entity/"
+"attributes</literal>,
<literal>mapped-superclass/attributes</literal> ou en "
+"<literal>embeddable/attributes</literal>."
+
+#. Tag: programlisting
+#: xml-overriding.xml:279
+#, no-c-format
+msgid ""
+"<attributes>\n"
+" <one-to-many name=\"players\"
fetch=\"EAGER\">\n"
+" <map-key name=\"name\"/>\n"
+" <join-column name=\"driver\"/>\n"
+" <join-column name=\"number\"/>\n"
+" </one-to-many>\n"
+" <many-to-many name=\"roads\"
target-entity=\"Administration"
+"\">\n"
+" <order-by>maxSpeed</order-by>\n"
+" <join-table name=\"bus_road\">\n"
+" <join-column name=\"driver\"/>\n"
+" <join-column name=\"number\"/>\n"
+" <inverse-join-column
name=\"road_id\"/>\n"
+" <unique-constraint>\n"
+"
<column-name>driver</column-name>\n"
+"
<column-name>number</column-name>\n"
+" </unique-constraint>\n"
+" </join-table>\n"
+" </many-to-many>\n"
+" <many-to-many name=\"allTimeDrivers\"
mapped-by=\"drivenBuses"
+"\">\n"
+" </attributes>"
+msgstr ""
+"<attributes>\n"
+" <one-to-many name=\"players\"
fetch=\"EAGER\">\n"
+" <map-key name=\"name\"/>\n"
+" <join-column name=\"driver\"/>\n"
+" <join-column name=\"number\"/>\n"
+" </one-to-many>\n"
+" <many-to-many name=\"roads\"
target-entity=\"Administration"
+"\">\n"
+" <order-by>maxSpeed</order-by>\n"
+" <join-table name=\"bus_road\">\n"
+" <join-column name=\"driver\"/>\n"
+" <join-column name=\"number\"/>\n"
+" <inverse-join-column
name=\"road_id\"/>\n"
+" <unique-constraint>\n"
+"
<column-name>driver</column-name>\n"
+"
<column-name>number</column-name>\n"
+" </unique-constraint>\n"
+" </join-table>\n"
+" </many-to-many>\n"
+" <many-to-many name=\"allTimeDrivers\"
mapped-by=\"drivenBuses"
+"\">\n"
+" </attributes>"
+
+#. Tag: para
+#: xml-overriding.xml:281
+#, no-c-format
+msgid ""
+"You can override an association through <literal>one-to-many</literal>,
"
+"<literal>one-to-one</literal>,
<literal>many-to-one</literal>, and "
+"<literal>many-to-many</literal>. Each of these elements can have
subelements "
+"accordingly: <literal>join-table</literal> (which can have
<literal>join-"
+"column</literal>s and <literal>inverse-join-column</literal>s),
"
+"<literal><literal>join-column</literal>s</literal>,
<literal>map-key</"
+"literal>, and <literal>order-by</literal>.
<literal>mapped-by</literal> and "
+"<literal>target-entity</literal> can be defined as attributes when it
makes "
+"sense. Once again the structure is reflects the annotations structure. You "
+"can find all semantic informations in the chapter describing annotations."
+msgstr ""
+"Vous pouvez surcharger une association par
<literal>one-to-many</literal>, "
+"<literal>one-to-one</literal>,
<literal>many-to-one</literal>, ou "
+"<literal>many-to-many</literal>. Chacun de ces éléments peuvent
comporter "
+"des sous-éléments en conséquence : <literal>join-table</literal> (qui
peut "
+"avoir <literal>join-column</literal>s et
<literal>inverse-join-column</"
+"literal>s),
<literal><literal>join-column</literal>s</literal>,
<literal>map-"
+"key</literal>, et <literal>order-by</literal>.
<literal>mapped-by</literal> "
+"et <literal>target-entity</literal>"
+
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/ja-JP/Author_Group.po
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/ja-JP/Author_Group.po
(rev 0)
+++ annotations/branches/v3_4_0_GA_CP/src/main/docbook/ja-JP/Author_Group.po 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,5 @@
+#. Tag: author
+#: Author_Group.xml:6
+#, no-c-format
+msgid "<firstname>Red Hat Documentation Group</firstname>
<surname></surname>"
+msgstr ""
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/ja-JP/Book_Info.po
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/ja-JP/Book_Info.po
(rev 0)
+++ annotations/branches/v3_4_0_GA_CP/src/main/docbook/ja-JP/Book_Info.po 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,25 @@
+#. Tag: title
+#: Book_Info.xml:6
+#, no-c-format
+msgid "Hibernate Annotations Reference Guide"
+msgstr ""
+
+#. Tag: subtitle
+#: Book_Info.xml:7
+#, no-c-format
+msgid "for Use with JBoss Enterprise Application Platform 5.0"
+msgstr ""
+
+#. Tag: para
+#: Book_Info.xml:14
+#, no-c-format
+msgid ""
+"The JBoss Enterprise Application Platform Edition of the Hibernate "
+"Annotations Reference Guide"
+msgstr ""
+
+#. Tag: holder
+#: Book_Info.xml:25
+#, no-c-format
+msgid "&HOLDER;"
+msgstr ""
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/ja-JP/Feedback.po
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/ja-JP/Feedback.po
(rev 0)
+++ annotations/branches/v3_4_0_GA_CP/src/main/docbook/ja-JP/Feedback.po 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,19 @@
+#. Tag: title
+#: Feedback.xml:6
+#, no-c-format
+msgid "Feedback"
+msgstr ""
+
+#. Tag: para
+#: Feedback.xml:7
+#, no-c-format
+msgid ""
+"If you spot a typo in this guide, or if you have thought of a way to make "
+"this manual better, we would love to hear from you! Submit a report in "
+"<ulink
url=\"http://jira.jboss.com/jira/browse/JBPAPP\">JIRA</ul... against
"
+"the Product: JBoss Enterprise Application Platform, Version: "
+"<replaceable><version></replaceable>, Component:
<emphasis>Doc</"
+"emphasis>. If you have a suggestion for improving the documentation, try to
"
+"be as specific as possible. If you have found an error, include the section "
+"number and some of the surrounding text so we can find it easily."
+msgstr ""
Added:
annotations/branches/v3_4_0_GA_CP/src/main/docbook/ja-JP/Hibernate_Annotations_Reference_Guide.po
===================================================================
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/ja-JP/Preface.po
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/ja-JP/Preface.po
(rev 0)
+++ annotations/branches/v3_4_0_GA_CP/src/main/docbook/ja-JP/Preface.po 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,45 @@
+#. Tag: title
+#: Preface.xml:2
+#, no-c-format
+msgid "Preface"
+msgstr ""
+
+#. Tag: para
+#: Preface.xml:4
+#, no-c-format
+msgid ""
+"Hibernate, like all other object/relational mapping tools, requires metadata
"
+"that governs the transformation of data from one representation to the "
+"other. In Hibernate 2.x mapping metadata is most of the time declared in XML
"
+"text files. Alternatively XDoclet can be used utilizing Javadoc source code "
+"annotations together with a compile time preprocessor."
+msgstr ""
+
+#. Tag: para
+#: Preface.xml:11
+#, no-c-format
+msgid ""
+"The same kind of annotation support is now available in the standard JDK, "
+"although more powerful and with better tools support. IntelliJ IDEA and "
+"Eclipse for example, support auto-completion and syntax highlighting of JDK "
+"5.0 annotations which are compiled into the bytecode and read at runtime "
+"using reflection. No external XML files are needed."
+msgstr ""
+
+#. Tag: para
+#: Preface.xml:17
+#, no-c-format
+msgid ""
+"The EJB3 specification recognizes the interest and the success of the "
+"transparent object/relational mapping paradigm. It standardizes the basic "
+"APIs and the metadata needed for any object/relational persistence "
+"mechanism. <emphasis>Hibernate EntityManager</emphasis> implements the
"
+"programming interfaces and lifecycle rules as defined by the EJB3 "
+"persistence specification and together with <emphasis>Hibernate
Annotations</"
+"emphasis> offers a complete (and standalone) EJB3 persistence solution on
"
+"top of the mature Hibernate core. You may use a combination of all three "
+"together, annotations without EJB3 programming interfaces and lifecycle, or "
+"even pure native Hibernate, depending on the business and technical needs of
"
+"your project. At all times you cann fall back to Hibernate native APIs, or "
+"if required, even to native JDBC and SQL."
+msgstr ""
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/ja-JP/Revision_History.po
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/ja-JP/Revision_History.po
(rev 0)
+++
annotations/branches/v3_4_0_GA_CP/src/main/docbook/ja-JP/Revision_History.po 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,19 @@
+#. Tag: title
+#: Revision_History.xml:6
+#, no-c-format
+msgid "Revision History"
+msgstr ""
+
+#. Tag: author
+#: Revision_History.xml:12
+#, no-c-format
+msgid ""
+"<firstname>Laura</firstname> <surname>Bailey</surname>
<email>lbailey(a)redhat."
+"com</email>"
+msgstr ""
+
+#. Tag: member
+#: Revision_History.xml:19
+#, no-c-format
+msgid "Initial draft."
+msgstr ""
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/ja-JP/additionalmodules.po
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/ja-JP/additionalmodules.po
(rev 0)
+++
annotations/branches/v3_4_0_GA_CP/src/main/docbook/ja-JP/additionalmodules.po 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,178 @@
+#. Tag: title
+#: additionalmodules.xml:28
+#, no-c-format
+msgid "Additional modules"
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:30
+#, no-c-format
+msgid ""
+"Hibernate Annotations mainly focus on persistence metadata. The project also
"
+"have a nice integration with two Hibernate modules."
+msgstr ""
+
+#. Tag: title
+#: additionalmodules.xml:34
+#, no-c-format
+msgid "Hibernate Validator"
+msgstr ""
+
+#. Tag: title
+#: additionalmodules.xml:37 additionalmodules.xml:117
+#, no-c-format
+msgid "Description"
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:39
+#, no-c-format
+msgid ""
+"Annotations are a very convenient and elegant way to specify invariant "
+"constraints for a domain model. You can, for example, express that a "
+"property should never be null, that the account balance should be strictly "
+"positive, etc. These domain model constraints are declared in the bean "
+"itself by annotating its properties. A validator can then read them and "
+"check for constraint violations. The validation mechanism can be executed in
"
+"different layers in your application without having to duplicate any of "
+"these rules (presentation layer, data access layer). Following the DRY "
+"principle, Hibernate Validator has been designed for that purpose."
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:50
+#, no-c-format
+msgid ""
+"Hibernate Validator works at two levels. First, it is able to check in-"
+"memory instances of a class for constraint violations. Second, it can apply "
+"the constraints to the Hibernate metamodel and incorporate them into the "
+"generated database schema."
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:55
+#, no-c-format
+msgid ""
+"Each constraint annotation is associated to a validator implementation "
+"responsible for checking the constraint on the entity instance. A validator "
+"can also (optionally) apply the constraint to the Hibernate metamodel, "
+"allowing Hibernate to generate DDL that expresses the constraint. With the "
+"appropriate event listener, you can execute the checking operation on "
+"inserts and updates done by Hibernate. Hibernate Validator is not limited to
"
+"use with Hibernate. You can easily use it anywhere in your application."
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:64
+#, no-c-format
+msgid ""
+"When checking instances at runtime, Hibernate Validator returns information "
+"about constraint violations in an array of
<classname>InvalidValue</"
+"classname> s. Among other information, the
<classname>InvalidValue</"
+"classname> contains an error description message that can embed the "
+"parameter values bundle with the annotation (eg. length limit), and message "
+"strings that may be externalized to a
<classname>ResourceBundle</classname> ."
+msgstr ""
+
+#. Tag: title
+#: additionalmodules.xml:74 additionalmodules.xml:132
+#, no-c-format
+msgid "Integration with Hibernate Annotations"
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:76
+#, no-c-format
+msgid ""
+"If Hibernate Validator (<filename>hibernate-validator.jar</filename>)
is "
+"available in the classpath, Hibernate Annotations will integrate in two
ways:"
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:82
+#, no-c-format
+msgid ""
+"Constraints will be applied to the Data Definition Language. In other words,
"
+"the database schema will reflect the constraints (provided that you use the "
+"hbm2ddl tool)."
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:88
+#, no-c-format
+msgid ""
+"Before an entity change is applied to the database (insert or update), the "
+"entity is validated. Validation errors, if any, will be carried over through
"
+"an <classname>InvalidStateException</classname>."
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:95
+#, no-c-format
+msgid ""
+"For entities free of validation rules, the runtime performance cost is null."
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:98
+#, no-c-format
+msgid ""
+"To disable constraint propagation to DDL, set up <literal>hibernate."
+"validator.apply_to_ddl</literal> to false in the configuration file. Such a
"
+"need is very uncommon and not recommended."
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:103
+#, no-c-format
+msgid ""
+"To disable pre-entity change validation, set up
<literal>hibernate.validator."
+"autoregister_listeners</literal> to false in the configuration file. Such a
"
+"need is very uncommon and not recommended."
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:108
+#, no-c-format
+msgid ""
+"Check the Hibernate Validator reference documentation for more information."
+msgstr ""
+
+#. Tag: title
+#: additionalmodules.xml:114
+#, no-c-format
+msgid "Hibernate Search"
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:119
+#, no-c-format
+msgid ""
+"Full text search engines like <productname>Apache Lucene</productname>
are a "
+"very powerful technology to bring free text/efficient queries to "
+"applications. If suffers several mismatches when dealing with a object "
+"domain model (keeping the index up to date, mismatch between the index "
+"structure and the domain model, querying mismatch...) Hibernate Search "
+"indexes your domain model thanks to a few annotations, takes care of the "
+"database / index synchronization and brings you back regular managed objects
"
+"from free text queries. Hibernate Search is using <ulink
url=\"http://lucene."
+"apache.org\">Apache Lucene</ulink> under the cover."
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:134
+#, no-c-format
+msgid ""
+"Hibernate Search integrates with Hibernate Annotations transparently "
+"provided that hibernate-search.jar is present in the classpath. If you do "
+"not wish to automatically register Hibernate Search event listeners, you can
"
+"set <literal>hibernate.search.autoregister_listeners</literal> to
false. "
+"Such a need is very uncommon and not recommended."
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:141
+#, no-c-format
+msgid ""
+"Check the Hibernate Search reference documentation for more information."
+msgstr ""
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/ja-JP/entity.po
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/ja-JP/entity.po
(rev 0)
+++ annotations/branches/v3_4_0_GA_CP/src/main/docbook/ja-JP/entity.po 2009-12-22 06:50:19
UTC (rev 18313)
@@ -0,0 +1,5481 @@
+#. Tag: title
+#: entity.xml:28
+#, no-c-format
+msgid "Entity Beans"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:31
+#, no-c-format
+msgid "Intro"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:33
+#, no-c-format
+msgid ""
+"This section covers EJB 3.0 (aka Java Persistence) entity annotations and "
+"Hibernate-specific extensions."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:38
+#, no-c-format
+msgid "Mapping with EJB3/JPA Annotations"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:40
+#, no-c-format
+msgid ""
+"EJB3 entities are plain POJOs. Actually they represent the exact same "
+"concept as the Hibernate persistent entities. Their mappings are defined "
+"through JDK 5.0 annotations (an XML descriptor syntax for overriding is "
+"defined in the EJB3 specification). Annotations can be split in two "
+"categories, the logical mapping annotations (allowing you to describe the "
+"object model, the class associations, etc.) and the physical mapping "
+"annotations (describing the physical schema, tables, columns, indexes, etc).
"
+"We will mix annotations from both categories in the following code examples."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:50
+#, no-c-format
+msgid ""
+"EJB3 annotations are in the <literal>javax.persistence.*</literal>
package. "
+"Most JDK 5 compliant IDE (like Eclipse, IntelliJ IDEA and Netbeans) can "
+"autocomplete annotation interfaces and attributes for you (even without a "
+"specific \"EJB3\" module, since EJB3 annotations are plain JDK 5 "
+"annotations)."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:56
+#, no-c-format
+msgid ""
+"For more and runnable concrete examples read the JBoss EJB 3.0 tutorial or "
+"review the Hibernate Annotations test suite. Most of the unit tests have "
+"been designed to represent a concrete example and be a inspiration source."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:62
+#, no-c-format
+msgid "Declaring an entity bean"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:64
+#, no-c-format
+msgid ""
+"Every bound persistent POJO class is an entity bean and is declared using "
+"the <literal>@Entity</literal> annotation (at the class level):"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:68
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Flight implements Serializable {\n"
+" Long id;\n"
+"\n"
+" @Id\n"
+" public Long getId() { return id; }\n"
+"\n"
+" public void setId(Long id) { this.id = id; }\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:70
+#, no-c-format
+msgid ""
+"<literal>@Entity</literal> declares the class as an entity bean (i.e. a
"
+"persistent POJO class), <literal>@Id</literal> declares the identifier
"
+"property of this entity bean. The other mapping declarations are implicit. "
+"This configuration by exception concept is central to the new EJB3 "
+"specification and a major improvement. The class Flight is mapped to the "
+"Flight table, using the column id as its primary key column."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:78
+#, no-c-format
+msgid ""
+"Depending on whether you annotate fields or methods, the access type used by
"
+"Hibernate will be <literal>field</literal> or
<literal>property</literal>. "
+"The EJB3 spec requires that you declare annotations on the element type that
"
+"will be accessed, i.e. the getter method if you use
<literal>property</"
+"literal> access, the field if you use <literal>field</literal>
access. "
+"Mixing EJB3 annotations in both fields and methods should be avoided. "
+"Hibernate will guess the access type from the position of
<literal>@Id</"
+"literal> or <literal>(a)EmbeddedId</literal>."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:89
+#, no-c-format
+msgid "Defining the table"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:91
+#, no-c-format
+msgid ""
+"<literal>@Table</literal> is set at the class level; it allows you to
define "
+"the table, catalog, and schema names for your entity bean mapping. If no "
+"<literal>@Table</literal> is defined the default values are used: the
"
+"unqualified class name of the entity."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:96
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Table(name=\"tbl_sky\")\n"
+"public class Sky implements Serializable {\n"
+"..."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:98
+#, no-c-format
+msgid ""
+"The <literal>@Table</literal> element also contains a
<literal>schema</"
+"literal> and a <literal>catalog</literal> attributes, if they need
to be "
+"defined. You can also define unique constraints to the table using the "
+"<literal>@UniqueConstraint</literal> annotation in conjunction with
"
+"<literal>@Table</literal> (for a unique constraint bound to a single
column, "
+"refer to <literal>(a)Column</literal>)."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:105
+#, no-c-format
+msgid ""
+"@Table(name=\"tbl_sky\",\n"
+" <emphasis role=\"bold\">uniqueConstraints =
{@UniqueConstraint"
+"(columnNames={\"month\", \"day\"})}</emphasis>\n"
+")"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:107
+#, no-c-format
+msgid ""
+"A unique constraint is applied to the tuple month, day. Note that the "
+"<literal>columnNames</literal> array refers to the logical column
names."
+msgstr ""
+
+#. Tag: remark
+#: entity.xml:111
+#, no-c-format
+msgid ""
+"The logical column name is defined by the Hibernate NamingStrategy "
+"implementation. The default EJB3 naming strategy use the physical column "
+"name as the logical column name. Note that this may be different than the "
+"property name (if the column name is explicit). Unless you override the "
+"NamingStrategy, you shouldn't worry about that."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:120
+#, no-c-format
+msgid "Versioning for optimistic locking"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:122
+#, no-c-format
+msgid ""
+"You can add optimistic locking capability to an entity bean using the "
+"<literal>@Version</literal> annotation:"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:125
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Flight implements Serializable {\n"
+"...\n"
+" @Version\n"
+" @Column(name=\"OPTLOCK\")\n"
+" public Integer getVersion() { ... }\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:127
+#, no-c-format
+msgid ""
+"The version property will be mapped to the <literal>OPTLOCK</literal>
"
+"column, and the entity manager will use it to detect conflicting updates "
+"(preventing lost updates you might otherwise see with the last-commit-wins "
+"strategy)."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:132
+#, no-c-format
+msgid ""
+"The version column may be a numeric (the recommended solution) or a "
+"timestamp as per the EJB3 spec. Hibernate support any kind of type provided "
+"that you define and implement the appropriate
<classname>UserVersionType</"
+"classname>."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:137
+#, no-c-format
+msgid ""
+"The application must not alter the version number set up by Hibernate in any
"
+"way. To artificially increase the version number, check in Hibernate Entity "
+"Manager's reference documentation
<literal>LockMode.WRITE</literal>"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:145
+#, no-c-format
+msgid "Mapping simple properties"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:148
+#, no-c-format
+msgid "Declaring basic property mappings"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:150
+#, no-c-format
+msgid ""
+"Every non static non transient property (field or method) of an entity bean "
+"is considered persistent, unless you annotate it as
<literal>@Transient</"
+"literal>. Not having an annotation for your property is equivalent to the
"
+"appropriate <literal>@Basic</literal> annotation. The
<literal>@Basic</"
+"literal> annotation allows you to declare the fetching strategy for a "
+"property:"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:157
+#, no-c-format
+msgid ""
+"public transient int counter; //transient property\n"
+"\n"
+"private String firstname; //persistent property\n"
+"\n"
+"@Transient\n"
+"String getLengthInMeter() { ... } //transient property\n"
+"\n"
+"String getName() {... } // persistent property\n"
+"\n"
+"@Basic\n"
+"int getLength() { ... } // persistent property\n"
+"\n"
+"@Basic(fetch = FetchType.LAZY)\n"
+"String getDetailedComment() { ... } // persistent property\n"
+"\n"
+"(a)Temporal(TemporalType.TIME)\n"
+"java.util.Date getDepartureTime() { ... } // persistent property
\n"
+"\n"
+"(a)Enumerated(EnumType.STRING)\n"
+"Starred getNote() { ... } //enum persisted as String in database"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:159
+#, no-c-format
+msgid ""
+"<literal>counter</literal>, a transient field, and
<literal>lengthInMeter</"
+"literal>, a method annotated as <literal>@Transient</literal>, and
will be "
+"ignored by the entity manager. <literal>name</literal>,
<literal>length</"
+"literal>, and <literal>firstname</literal> properties are mapped
persistent "
+"and eagerly fetched (the default for simple properties). The "
+"<literal>detailedComment</literal> property value will be lazily
fetched "
+"from the database once a lazy property of the entity is accessed for the "
+"first time. Usually you don't need to lazy simple properties (not to be "
+"confused with lazy association fetching)."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:171
+#, no-c-format
+msgid ""
+"To enable property level lazy fetching, your classes have to be "
+"instrumented: bytecode is added to the original one to enable such feature, "
+"please refer to the Hibernate reference documentation. If your classes are "
+"not instrumented, property level lazy loading is silently ignored."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:178
+#, no-c-format
+msgid ""
+"The recommended alternative is to use the projection capability of EJB-QL or
"
+"Criteria queries."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:181
+#, no-c-format
+msgid ""
+"EJB3 support property mapping of all basic types supported by Hibernate (all
"
+"basic Java types , their respective wrappers and serializable classes). "
+"Hibernate Annotations support out of the box Enum type mapping either into a
"
+"ordinal column (saving the enum ordinal) or a string based column (saving "
+"the enum string representation): the persistence representation, defaulted "
+"to ordinal, can be overriden through the <literal>@Enumerated</literal>
"
+"annotation as shown in the <literal>note</literal> property
example."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:190
+#, no-c-format
+msgid ""
+"In core Java APIs, the temporal precision is not defined. When dealing with "
+"temporal data you might want to describe the expected precision in database.
"
+"Temporal data can have <literal>DATE</literal>,
<literal>TIME</literal>, or "
+"<literal>TIMESTAMP</literal> precision (ie the actual date, only the
time, "
+"or both). Use the <literal>@Temporal</literal> annotation to fine tune
that."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:197
+#, no-c-format
+msgid ""
+"<literal>@Lob</literal> indicates that the property should be persisted
in a "
+"Blob or a Clob depending on the property type:
<classname>java.sql.Clob</"
+"classname>, <classname>Character[]</classname>,
<classname>char[]</"
+"classname> and java.lang.<classname>String</classname> will be
persisted in "
+"a Clob. <classname>java.sql.Blob</classname>,
<classname>Byte[]</classname>, "
+"<classname>byte[] </classname>and serializable type will be persisted
in a "
+"Blob."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:206
+#, no-c-format
+msgid ""
+"@Lob\n"
+"public String getFullText() {\n"
+" return fullText;\n"
+"}\n"
+"\n"
+"@Lob \n"
+"public byte[] getFullCode() {\n"
+" return fullCode;\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:208
+#, no-c-format
+msgid ""
+"If the property type implements
<classname>java.io.Serializable</classname> "
+"and is not a basic type, and if the property is not annotated with "
+"<literal>@Lob</literal>, then the Hibernate
<literal>serializable</literal> "
+"type is used."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:216
+#, no-c-format
+msgid "Declaring column attributes"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:218
+#, no-c-format
+msgid ""
+"The column(s) used for a property mapping can be defined using the "
+"<literal>@Column</literal> annotation. Use it to override default
values "
+"(see the EJB3 specification for more information on the defaults). You can "
+"use this annotation at the property level for properties that are:"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:226
+#, no-c-format
+msgid "not annotated at all"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:230
+#, no-c-format
+msgid "annotated with <literal>@Basic</literal>"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:234
+#, no-c-format
+msgid "annotated with <literal>@Version</literal>"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:238
+#, no-c-format
+msgid "annotated with <literal>@Lob</literal>"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:242
+#, no-c-format
+msgid "annotated with <literal>@Temporal</literal>"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:246
+#, no-c-format
+msgid ""
+"annotated with
<literal>(a)org.hibernate.annotations.CollectionOfElements</"
+"literal> (for Hibernate only)"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:252
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Flight implements Serializable {\n"
+"...\n"
+"@Column(updatable = false, name = \"flight_name\", nullable = false,
"
+"length=50)\n"
+"public String getName() { ... }"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:254
+#, no-c-format
+msgid ""
+"The <literal>name</literal> property is mapped to the
<literal>flight_name</"
+"literal> column, which is not nullable, has a length of 50 and is not "
+"updatable (making the property immutable)."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:259
+#, no-c-format
+msgid ""
+"This annotation can be applied to regular properties as well as "
+"<literal>@Id</literal> or <literal>@Version</literal>
properties."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:286
+#, no-c-format
+msgid ""
+"@Column(\n"
+" name=\"columnName\";\n"
+" boolean unique() default false;\n"
+" boolean nullable() default true;\n"
+" boolean insertable() default true;\n"
+" boolean updatable() default true;\n"
+" String columnDefinition() default \"\";\n"
+" String table() default \"\";\n"
+" int length() default 255;\n"
+" int precision() default 0; // decimal precision\n"
+" int scale() default 0; // decimal scale"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:290
+#, no-c-format
+msgid ""
+"<literal>name</literal> (optional): the column name (default to the
property "
+"name)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:295
+#, no-c-format
+msgid ""
+"<literal>unique</literal> (optional): set a unique constraint on this
column "
+"or not (default false)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:300
+#, no-c-format
+msgid ""
+"<literal>nullable</literal> (optional): set the column as nullable
(default "
+"true)."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:305
+#, no-c-format
+msgid ""
+"<literal>insertable</literal> (optional): whether or not the column
will be "
+"part of the insert statement (default true)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:311
+#, no-c-format
+msgid ""
+"<literal>updatable</literal> (optional): whether or not the column will
be "
+"part of the update statement (default true)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:317
+#, no-c-format
+msgid ""
+"<literal>columnDefinition</literal> (optional): override the sql DDL
"
+"fragment for this particular column (non portable)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:323
+#, no-c-format
+msgid ""
+"<literal>table</literal> (optional): define the targeted table (default
"
+"primary table)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:328
+#, no-c-format
+msgid ""
+"<literal><literal>length</literal></literal> (optional):
column length "
+"(default 255)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:333
+#, no-c-format
+msgid ""
+"<literal><literal>precision</literal></literal> (optional):
column decimal "
+"precision (default 0)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:338
+#, no-c-format
+msgid ""
+"<literal><literal>scale</literal></literal> (optional):
column decimal scale "
+"if useful (default 0)"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:346
+#, no-c-format
+msgid "Embedded objects (aka components)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:348
+#, no-c-format
+msgid ""
+"It is possible to declare an embedded component inside an entity and even "
+"override its column mapping. Component classes have to be annotated at the "
+"class level with the <literal>@Embeddable</literal> annotation. It is
"
+"possible to override the column mapping of an embedded object for a "
+"particular entity using the <literal>@Embedded</literal> and "
+"<literal>@AttributeOverride</literal> annotation in the associated
property:"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:356
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Person implements Serializable {\n"
+"\n"
+" // Persistent component using defaults\n"
+" Address homeAddress;\n"
+"\n"
+" @Embedded\n"
+" @AttributeOverrides( {\n"
+" @AttributeOverride(name=\"iso2\", column =
@Column(name="
+"\"bornIso2\") ),\n"
+" @AttributeOverride(name=\"name\", column =
@Column(name="
+"\"bornCountryName\") )\n"
+" } )\n"
+" Country bornIn;\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:358
+#, no-c-format
+msgid ""
+"@Embeddable\n"
+"public class Address implements Serializable {\n"
+" String city;\n"
+" Country nationality; //no overriding here\n"
+"}"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:360
+#, no-c-format
+msgid ""
+"@Embeddable\n"
+"public class Country implements Serializable {\n"
+" private String iso2;\n"
+" @Column(name=\"countryName\") private String name;\n"
+"\n"
+" public String getIso2() { return iso2; }\n"
+" public void setIso2(String iso2) { this.iso2 = iso2; }\n"
+"\n"
+" \n"
+" public String getName() { return name; }\n"
+" public void setName(String name) { this.name = name; }\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:362
+#, no-c-format
+msgid ""
+"A embeddable object inherit the access type of its owning entity (note that "
+"you can override that using the Hibernate specific
<literal>@AccessType</"
+"literal> annotations (see <xref
linkend=\"entity-hibspec\"/>)."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:367
+#, no-c-format
+msgid ""
+"The <literal>Person</literal> entity bean has two component properties,
"
+"<literal>homeAddress</literal> and
<literal>bornIn</literal>. "
+"<literal>homeAddress</literal> property has not been annotated, but
"
+"Hibernate will guess that it is a persistent component by looking for the "
+"<literal>@Embeddable</literal> annotation in the Address class. We also
"
+"override the mapping of a column name (to
<literal>bornCountryName</"
+"literal>) with the <literal>@Embedded</literal> and "
+"<literal>@AttributeOverride </literal>annotations for each mapped
attribute "
+"of <literal>Country</literal>. As you can see, <literal>Country
</literal>is "
+"also a nested component of <literal>Address</literal>, again using
auto-"
+"detection by Hibernate and EJB3 defaults. Overriding columns of embedded "
+"objects of embedded objects is currently not supported in the EJB3 spec, "
+"however, Hibernate Annotations supports it through dotted expressions."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:383
+#, no-c-format
+msgid ""
+"@Embedded\n"
+" @AttributeOverrides( {\n"
+" @AttributeOverride(name=\"city\", column =
@Column(name="
+"\"fld_city\") ),\n"
+" @AttributeOverride(name=\"<emphasis
role=\"bold\">nationality."
+"iso2</emphasis>\", column = @Column(name=\"nat_Iso2\")
),\n"
+" @AttributeOverride(name=\"<emphasis
role=\"bold\">nationality."
+"name</emphasis>\", column = @Column(name=\"nat_CountryName\")
)\n"
+" //nationality columns in homeAddress are overridden\n"
+" } )\n"
+" Address homeAddress;"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:383
+#, no-c-format
+msgid ""
+"Hibernate Annotations supports one more feature that is not explicitly "
+"supported by the EJB3 specification. You can annotate a embedded object with
"
+"the <literal>@MappedSuperclass</literal> annotation to make the
superclass "
+"properties persistent (see <literal>@MappedSuperclass</literal> for
more "
+"informations)."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:390
+#, no-c-format
+msgid ""
+"While not supported by the EJB3 specification, Hibernate Annotations allows "
+"you to use association annotations in an embeddable object (ie "
+"<literal>@*ToOne</literal> nor
<literal>@*ToMany</literal>). To override the "
+"association columns you can use
<literal>(a)AssociationOverride</literal>."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:396
+#, no-c-format
+msgid ""
+"If you want to have the same embeddable object type twice in the same "
+"entity, the column name defaulting will not work: at least one of the "
+"columns will have to be explicit. Hibernate goes beyond the EJB3 spec and "
+"allows you to enhance the defaulting mechanism through the "
+"<classname>NamingStrategy</classname>. "
+"<classname>DefaultComponentSafeNamingStrategy</classname> is a small
"
+"improvement over the default EJB3NamingStrategy that allows embedded objects
"
+"to be defaulted even if used twice in the same entity."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:407
+#, no-c-format
+msgid "Non-annotated property defaults"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:409
+#, no-c-format
+msgid "If a property is not annotated, the following rules apply:"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:414
+#, no-c-format
+msgid "If the property is of a single type, it is mapped as @Basic"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:420
+#, no-c-format
+msgid ""
+"Otherwise, if the type of the property is annotated as @Embeddable, it is "
+"mapped as @Embedded"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:426
+#, no-c-format
+msgid ""
+"Otherwise, if the type of the property is Serializable, it is mapped as "
+"@Basic in a column holding the object in its serialized version"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:432
+#, no-c-format
+msgid ""
+"Otherwise, if the type of the property is java.sql.Clob or java.sql.Blob, it
"
+"is mapped as @Lob with the appropriate LobType"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:441
+#, no-c-format
+msgid "Mapping identifier properties"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:443
+#, no-c-format
+msgid ""
+"The <literal>@Id</literal> annotation lets you define which property is
the "
+"identifier of your entity bean. This property can be set by the application "
+"itself or be generated by Hibernate (preferred). You can define the "
+"identifier generation strategy thanks to the
<literal>@GeneratedValue</"
+"literal> annotation:"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:451
+#, no-c-format
+msgid ""
+"AUTO - either identity column, sequence or table depending on the underlying
"
+"DB"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:457
+#, no-c-format
+msgid "TABLE - table holding the id"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:463
+#, no-c-format
+msgid "IDENTITY - identity column"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:469
+#, no-c-format
+msgid "SEQUENCE - sequence"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:475
+#, no-c-format
+msgid ""
+"Hibernate provides more id generators than the basic EJB3 ones. Check <xref
"
+"linkend=\"entity-hibspec\"/> for more informations."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:478
+#, no-c-format
+msgid ""
+"The following example shows a sequence generator using the SEQ_STORE "
+"configuration (see below)"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:481
+#, no-c-format
+msgid ""
+"@Id @GeneratedValue(strategy=GenerationType.SEQUENCE,
generator=\"SEQ_STORE"
+"\")\n"
+"public Integer getId() { ... }"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:483
+#, no-c-format
+msgid "The next example uses the identity generator:"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:485
+#, no-c-format
+msgid ""
+"@Id @GeneratedValue(strategy=GenerationType.IDENTITY)\n"
+"public Long getId() { ... }"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:487
+#, no-c-format
+msgid ""
+"The <literal>AUTO</literal> generator is the preferred type for
portable "
+"applications (across several DB vendors). The identifier generation "
+"configuration can be shared for several <literal>@Id</literal> mappings
with "
+"the generator attribute. There are several configurations available through "
+"<literal>@SequenceGenerator</literal> and
<literal>@TableGenerator</"
+"literal>. The scope of a generator can be the application or the class. "
+"Class-defined generators are not visible outside the class and can override "
+"application level generators. Application level generators are defined at "
+"XML level (see <xref linkend=\"xml-overriding\"/>):"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:499
+#, no-c-format
+msgid ""
+"<table-generator name=\"EMP_GEN\"\n"
+" table=\"GENERATOR_TABLE\"\n"
+" pk-column-name=\"key\"\n"
+" value-column-name=\"hi\"\n"
+" pk-column-value=\"EMP\"\n"
+" allocation-size=\"20\"/>\n"
+"\n"
+"//and the annotation equivalent\n"
+"\n"
+"(a)javax.persistence.TableGenerator(\n"
+" name=\"EMP_GEN\",\n"
+" table=\"GENERATOR_TABLE\",\n"
+" pkColumnName = \"key\",\n"
+" valueColumnName = \"hi\"\n"
+" pkColumnValue=\"EMP\",\n"
+" allocationSize=20\n"
+")\n"
+"\n"
+"<sequence-generator name=\"SEQ_GEN\" \n"
+" sequence-name=\"my_sequence\"\n"
+" allocation-size=\"20\"/>\n"
+"\n"
+"//and the annotation equivalent\n"
+"\n"
+"(a)javax.persistence.SequenceGenerator(\n"
+" name=\"SEQ_GEN\",\n"
+" sequenceName=\"my_sequence\",\n"
+" allocationSize=20\n"
+")"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:501
+#, no-c-format
+msgid ""
+"If JPA XML (like <filename>META-INF/orm.xml</filename>) is used to
define "
+"thegenerators, <literal>EMP_GEN</literal> and
<literal>SEQ_GEN</literal> are "
+"application level generators. <literal>EMP_GEN</literal> defines a
table "
+"based id generator using the hilo algorithm with a
<literal>max_lo</literal> "
+"of 20. The hi value is kept in a <literal>table</literal> "
+"\"<literal>GENERATOR_TABLE</literal>\". The information is
kept in a row "
+"where <literal>pkColumnName</literal> \"key\" is equals to
"
+"<literal>pkColumnValue</literal>
\"<literal>EMP</literal>\" and column "
+"<literal>valueColumnName</literal>
\"<literal>hi</literal>\" contains the "
+"the next high value used."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:512
+#, no-c-format
+msgid ""
+"<literal>SEQ_GEN</literal> defines a sequence generator using a
sequence "
+"named <literal>my_sequence</literal>. The allocation size used for this
"
+"sequence based hilo algorithm is 20. Note that this version of Hibernate "
+"Annotations does not handle <literal>initialValue</literal> in the
sequence "
+"generator. The default allocation size is 50, so if you want to use a "
+"sequence and pickup the value each time, you must set the allocation size to
"
+"1."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:521
+#, no-c-format
+msgid ""
+"Package level definition is no longer supported by the EJB 3.0 "
+"specification. However, you can use the
<literal>@GenericGenerator</literal> "
+"at the package level (see <xref
linkend=\"entity-hibspec-identifier\"/>)."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:527
+#, no-c-format
+msgid ""
+"The next example shows the definition of a sequence generator in a class "
+"scope:"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:530
+#, no-c-format
+msgid ""
+"@Entity\n"
+"(a)javax.persistence.SequenceGenerator(\n"
+" name=\"SEQ_STORE\",\n"
+" sequenceName=\"my_sequence\"\n"
+")\n"
+"public class Store implements Serializable {\n"
+" private Long id;\n"
+"\n"
+" @Id @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="
+"\"SEQ_STORE\")\n"
+" public Long getId() { return id; }\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:532
+#, no-c-format
+msgid ""
+"This class will use a sequence named my_sequence and the SEQ_STORE generator
"
+"is not visible in other classes. Note that you can check the Hibernate "
+"Annotations tests in the
<package>org.hibernate.test.annotations.id</"
+"package> package for more examples."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:538
+#, no-c-format
+msgid "You can define a composite primary key through several syntaxes:"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:543
+#, no-c-format
+msgid ""
+"annotate the component property as @Id and make the component class "
+"@Embeddable"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:549
+#, no-c-format
+msgid "annotate the component property as @EmbeddedId"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:555
+#, no-c-format
+msgid ""
+"annotate the class as @IdClass and annotate each property of the entity "
+"involved in the primary key with @Id"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:561
+#, no-c-format
+msgid ""
+"While quite common to the EJB2 developer, <literal>@IdClass</literal>
is "
+"likely new for Hibernate users. The composite primary key class corresponds "
+"to multiple fields or properties of the entity class, and the names of "
+"primary key fields or properties in the primary key class and those of the "
+"entity class must match and their types must be the same. Let's look at an
"
+"example:"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:568
+#, no-c-format
+msgid ""
+"@Entity\n"
+"<emphasis
role=\"bold\">(a)IdClass(FootballerPk.class)</emphasis>\n"
+"public class Footballer {\n"
+" //part of the id key\n"
+" <emphasis role=\"bold\">@Id</emphasis> public String
getFirstname() {\n"
+" return firstname;\n"
+" }\n"
+"\n"
+" public void setFirstname(String firstname) {\n"
+" this.firstname = firstname;\n"
+" }\n"
+"\n"
+" //part of the id key\n"
+" <emphasis role=\"bold\">@Id</emphasis> public String
getLastname() {\n"
+" return lastname;\n"
+" }\n"
+"\n"
+" public void setLastname(String lastname) {\n"
+" this.lastname = lastname;\n"
+" }\n"
+"\n"
+" public String getClub() {\n"
+" return club;\n"
+" }\n"
+"\n"
+" public void setClub(String club) {\n"
+" this.club = club;\n"
+" }\n"
+"\n"
+" //appropriate equals() and hashCode() implementation\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"public class FootballerPk implements Serializable {\n"
+" //same name and type as in Footballer\n"
+" public String getFirstname() {\n"
+" return firstname;\n"
+" }\n"
+"\n"
+" public void setFirstname(String firstname) {\n"
+" this.firstname = firstname;\n"
+" }\n"
+"\n"
+" //same name and type as in Footballer\n"
+" public String getLastname() {\n"
+" return lastname;\n"
+" }\n"
+"\n"
+" public void setLastname(String lastname) {\n"
+" this.lastname = lastname;\n"
+" }\n"
+"\n"
+" //appropriate equals() and hashCode() implementation\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:570
+#, no-c-format
+msgid ""
+"As you may have seen, <literal>@IdClass</literal> points to the "
+"corresponding primary key class."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:573
+#, no-c-format
+msgid ""
+"While not supported by the EJB3 specification, Hibernate allows you to "
+"define associations inside a composite identifier. Simply use the regular "
+"annotations for that"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:577
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@AssociationOverride( name=\"id.channel\", joinColumns =
@JoinColumn(name="
+"\"chan_id\") )\n"
+"public class TvMagazin {\n"
+" @EmbeddedId public TvMagazinPk id;\n"
+" @Temporal(TemporalType.TIME) Date time;\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"public class TvMagazinPk implements Serializable {\n"
+" @ManyToOne\n"
+" public Channel channel;\n"
+" public String name;\n"
+" @ManyToOne\n"
+" public Presenter presenter;\n"
+"}"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:581
+#, no-c-format
+msgid "Mapping inheritance"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:583
+#, no-c-format
+msgid "EJB3 supports the three types of inheritance:"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:587
+#, no-c-format
+msgid "Table per Class Strategy: the <union-class> element in
Hibernate"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:593
+#, no-c-format
+msgid ""
+"Single Table per Class Hierarchy Strategy: the <subclass> element in
"
+"Hibernate"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:599
+#, no-c-format
+msgid ""
+"Joined Subclass Strategy: the <joined-subclass> element in
Hibernate"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:604
+#, no-c-format
+msgid ""
+"The chosen strategy is declared at the class level of the top level entity "
+"in the hierarchy using the <literal>@Inheritance</literal>
annotation."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:609
+#, no-c-format
+msgid "Annotating interfaces is currently not supported."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:613
+#, no-c-format
+msgid "Table per class"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:615
+#, no-c-format
+msgid ""
+"This strategy has many drawbacks (esp. with polymorphic queries and "
+"associations) explained in the EJB3 spec, the Hibernate reference "
+"documentation, Hibernate in Action, and many other places. Hibernate work "
+"around most of them implementing this strategy using <literal>SQL
UNION</"
+"literal> queries. It is commonly used for the top level of an inheritance
"
+"hierarchy:"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:622
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)\n"
+"public class Flight implements Serializable {"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:624
+#, no-c-format
+msgid ""
+"This strategy support one to many associations provided that they are "
+"bidirectional. This strategy does not support the
<literal>IDENTITY</"
+"literal> generator strategy: the id has to be shared across several tables.
"
+"Consequently, when using this strategy, you should not use <literal>AUTO
</"
+"literal>nor <literal>IDENTITY</literal>."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:633
+#, no-c-format
+msgid "Single table per class hierarchy"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:635
+#, no-c-format
+msgid ""
+"All properties of all super- and subclasses are mapped into the same table, "
+"instances are distinguished by a special discriminator column:"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:639
+#, no-c-format
+msgid ""
+"@Entity\n"
+"(a)Inheritance(strategy=InheritanceType.SINGLE_TABLE)\n"
+"@DiscriminatorColumn(\n"
+" name=\"planetype\",\n"
+" discriminatorType=DiscriminatorType.STRING\n"
+")\n"
+"@DiscriminatorValue(\"Plane\")\n"
+"public class Plane { ... }\n"
+"\n"
+"@Entity\n"
+"@DiscriminatorValue(\"A320\")\n"
+"public class A320 extends Plane { ... }"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:641
+#, no-c-format
+msgid ""
+"<classname>Plane</classname> is the superclass, it defines the
inheritance "
+"strategy <literal>InheritanceType.SINGLE_TABLE</literal>. It also
defines "
+"the discriminator column through the
<literal>@DiscriminatorColumn</literal> "
+"annotation, a discriminator column can also define the discriminator type. "
+"Finally, the <literal>@DiscriminatorValue</literal> annotation defines
the "
+"value used to differentiate a class in the hierarchy. All of these "
+"attributes have sensible default values. The default name of the "
+"discriminator column is <literal>DTYPE</literal>. The default
discriminator "
+"value is the entity name (as defined in
<literal>(a)Entity.name</literal>) for "
+"DiscriminatorType.STRING. <classname>A320</classname> is a subclass;
you "
+"only have to define discriminator value if you don't want to use the default
"
+"value. The strategy and the discriminator type are implicit."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:656
+#, no-c-format
+msgid ""
+"<literal>@Inheritance</literal> and
<literal>@DiscriminatorColumn</literal> "
+"should only be defined at the top of the entity hierarchy."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:662
+#, no-c-format
+msgid "Joined subclasses"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:664
+#, no-c-format
+msgid ""
+"The<literal> @PrimaryKeyJoinColumn</literal> and "
+"<literal>@PrimaryKeyJoinColumns</literal> annotations define the
primary key"
+"(s) of the joined subclass table:"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:668
+#, no-c-format
+msgid ""
+"@Entity\n"
+"(a)Inheritance(strategy=InheritanceType.JOINED)\n"
+"public class Boat implements Serializable { ... }\n"
+"\n"
+"@Entity\n"
+"public class Ferry extends Boat { ... }\n"
+"\n"
+"@Entity\n"
+"@PrimaryKeyJoinColumn(name=\"BOAT_ID\")\n"
+"public class AmericaCupClass extends Boat { ... }"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:670
+#, no-c-format
+msgid ""
+"All of the above entities use the <literal>JOINED</literal> strategy,
the "
+"<literal>Ferry</literal> table is joined with the
<literal>Boat</literal> "
+"table using the same primary key names. The
<literal>AmericaCupClass</"
+"literal> table is joined with <literal>Boat</literal> using the join
"
+"condition <code>Boat.id = AmericaCupClass.BOAT_ID</code>."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:679
+#, no-c-format
+msgid "Inherit properties from superclasses"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:681
+#, no-c-format
+msgid ""
+"This is sometimes useful to share common properties through a technical or a
"
+"business superclass without including it as a regular mapped entity (ie no "
+"specific table for this entity). For that purpose you can map them as "
+"<literal>(a)MappedSuperclass</literal>."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:686
+#, no-c-format
+msgid ""
+"@MappedSuperclass\n"
+"public class BaseEntity {\n"
+" @Basic\n"
+" @Temporal(TemporalType.TIMESTAMP)\n"
+" public Date getLastUpdate() { ... }\n"
+" public String getLastUpdater() { ... }\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity class Order extends BaseEntity {\n"
+" @Id public Integer getId() { ... }\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:688
+#, no-c-format
+msgid ""
+"In database, this hierarchy will be represented as an
<literal>Order</"
+"literal> table having the <literal>id</literal>,
<literal>lastUpdate</"
+"literal> and <literal>lastUpdater</literal> columns. The embedded
superclass "
+"property mappings are copied into their entity subclasses. Remember that the
"
+"embeddable superclass is not the root of the hierarchy though."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:696
+#, no-c-format
+msgid ""
+"Properties from superclasses not mapped as
<literal>@MappedSuperclass</"
+"literal> are ignored."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:701
+#, no-c-format
+msgid ""
+"The access type (field or methods), is inherited from the root entity, "
+"unless you use the Hibernate annotation
<literal>@AccessType</literal>"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:707
+#, no-c-format
+msgid ""
+"The same notion can be applied to <literal>@Embeddable</literal>
objects to "
+"persist properties from their superclasses. You also need to use "
+"<literal>@MappedSuperclass</literal> to do that (this should not be
"
+"considered as a standard EJB3 feature though)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:715
+#, no-c-format
+msgid ""
+"It is allowed to mark a class as <literal>@MappedSuperclass</literal>
in the "
+"middle of the mapped inheritance hierarchy."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:721
+#, no-c-format
+msgid ""
+"Any class in the hierarchy non annotated with
<literal>@MappedSuperclass</"
+"literal> nor <literal>@Entity</literal> will be ignored."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:726
+#, no-c-format
+msgid ""
+"You can override columns defined in entity superclasses at the root entity "
+"level using the <literal>@AttributeOverride</literal>
annotation."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:730
+#, no-c-format
+msgid ""
+"@MappedSuperclass\n"
+"public class FlyingObject implements Serializable {\n"
+"\n"
+" public int getAltitude() {\n"
+" return altitude;\n"
+" }\n"
+"\n"
+" @Transient\n"
+" public int getMetricAltitude() {\n"
+" return metricAltitude;\n"
+" }\n"
+"\n"
+" @ManyToOne\n"
+" public PropulsionType getPropulsion() {\n"
+" return metricAltitude;\n"
+" }\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"@AttributeOverride( name=\"altitude\", column =
@Column(name=\"fld_altitude"
+"\") )\n"
+"@AssociationOverride( name=\"propulsion\", joinColumns =
@JoinColumn(name="
+"\"fld_propulsion_fk\") )\n"
+"public class Plane extends FlyingObject {\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:732
+#, no-c-format
+msgid ""
+"The <literal>altitude</literal> property will be persisted in an
"
+"<literal>fld_altitude</literal> column of table
<literal>Plane</literal> and "
+"the propulsion association will be materialized in a "
+"<literal>fld_propulsion_fk</literal> foreign key column."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:738
+#, no-c-format
+msgid ""
+"You can define <literal>@AttributeOverride</literal>(s) and "
+"<literal>@AssociationOverride</literal>(s) on
<literal>@Entity</literal> "
+"classes, <literal>@MappedSuperclass</literal> classes and properties
"
+"pointing to an <literal>@Embeddable</literal> object."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:747
+#, no-c-format
+msgid "Mapping entity bean associations/relationships"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:750
+#, no-c-format
+msgid "One-to-one"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:752
+#, no-c-format
+msgid ""
+"You can associate entity beans through a one-to-one relationship using "
+"<literal>@OneToOne</literal>. There are three cases for one-to-one
"
+"associations: either the associated entities share the same primary keys "
+"values, a foreign key is held by one of the entities (note that this FK "
+"column in the database should be constrained unique to simulate one-to-one "
+"multiplicity), or a association table is used to store the link between the "
+"2 entities (a unique constraint has to be defined on each fk to ensure the "
+"one to one multiplicity)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:761
+#, no-c-format
+msgid "First, we map a real one-to-one association using shared primary keys:"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:764
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Body {\n"
+" @Id\n"
+" public Long getId() { return id; }\n"
+"\n"
+" @OneToOne(cascade = CascadeType.ALL)\n"
+" @PrimaryKeyJoinColumn\n"
+" public Heart getHeart() {\n"
+" return heart;\n"
+" }\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:766
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Heart {\n"
+" @Id\n"
+" public Long getId() { ...}\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:768
+#, no-c-format
+msgid ""
+"The one to one is marked as true by using the "
+"<literal>@PrimaryKeyJoinColumn</literal> annotation."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:771
+#, no-c-format
+msgid ""
+"In the following example, the associated entities are linked through a "
+"foreign key column:"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:774
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Customer implements Serializable {\n"
+" @OneToOne(cascade = CascadeType.ALL)\n"
+" <emphasis
role=\"bold\">@JoinColumn(name=\"passport_fk\")</emphasis>\n"
+" public Passport getPassport() {\n"
+" ...\n"
+" }\n"
+"\n"
+"@Entity\n"
+"public class Passport implements Serializable {\n"
+" @OneToOne(<emphasis role=\"bold\">mappedBy =
\"passport\"</emphasis>)\n"
+" public Customer getOwner() {\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:776
+#, no-c-format
+msgid ""
+"A <classname>Customer</classname> is linked to a
<classname>Passport</"
+"classname>, with a foreign key column named
<literal>passport_fk</literal> "
+"in the <literal>Customer</literal> table. The join column is declared
with "
+"the <literal>@JoinColumn</literal> annotation which looks like the
"
+"<literal>@Column</literal> annotation. It has one more parameters named
"
+"<literal>referencedColumnName</literal>. This parameter declares the
column "
+"in the targeted entity that will be used to the join. Note that when using "
+"<literal><literal>referencedColumnName</literal></literal>
to a non primary "
+"key column, the associated class has to be
<classname>Serializable</"
+"classname>. Also note that the
<literal><literal>referencedColumnName</"
+"literal></literal> to a non primary key column has to be mapped to a
"
+"property having a single column (other cases might not work)."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:792
+#, no-c-format
+msgid ""
+"The association may be bidirectional. In a bidirectional relationship, one "
+"of the sides (and only one) has to be the owner: the owner is responsible "
+"for the association column(s) update. To declare a side as
<emphasis>not</"
+"emphasis> responsible for the relationship, the attribute
<literal>mappedBy</"
+"literal> is used. <literal>mappedBy</literal> refers to the property
name of "
+"the association on the owner side. In our case, this is
<literal>passport</"
+"literal>. As you can see, you don't have to (must not) declare the join
"
+"column since it has already been declared on the owners side."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:803
+#, no-c-format
+msgid ""
+"If no <literal>@JoinColumn</literal> is declared on the owner side, the
"
+"defaults apply. A join column(s) will be created in the owner table and its "
+"name will be the concatenation of the name of the relationship in the owner "
+"side, <keycap>_</keycap> (underscore), and the name of the primary key
column"
+"(s) in the owned side. In this example <literal>passport_id</literal>
"
+"because the property name is <literal>passport</literal> and the column
id "
+"of <literal>Passport </literal>is
<literal>id</literal>."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:812
+#, no-c-format
+msgid "The third possibility (using an association table) is very exotic."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:815
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Customer implements Serializable {\n"
+" @OneToOne(cascade = CascadeType.ALL)\n"
+" <emphasis role=\"bold\">@JoinTable(name =
\"CustomerPassports\",\n"
+" joinColumns = @JoinColumn(name=\"customer_fk\"),\n"
+" inverseJoinColumns =
@JoinColumn(name=\"passport_fk\")</emphasis>\n"
+" )\n"
+" public Passport getPassport() {\n"
+" ...\n"
+" }\n"
+"\n"
+"@Entity\n"
+"public class Passport implements Serializable {\n"
+" @OneToOne(<emphasis role=\"bold\">mappedBy =
\"passport\"</emphasis>)\n"
+" public Customer getOwner() {\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:817
+#, no-c-format
+msgid ""
+"A <classname>Customer</classname> is linked to a
<classname>Passport</"
+"classname> through a association table named
<literal>CustomerPassports</"
+"literal> ; this association table has a foreign key column named "
+"<literal>passport_fk</literal> pointing to the
<literal>Passport</literal> "
+"table (materialized by the <literal>inverseJoinColumn</literal>, and a
"
+"foreign key column named <literal>customer_fk</literal> pointing to the
"
+"<literal>Customer</literal> table materialized by the
<literal>joinColumns</"
+"literal> attribute."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:827
+#, no-c-format
+msgid ""
+"You must declare the join table name and the join columns explicitly in such
"
+"a mapping."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:832
+#, no-c-format
+msgid "Many-to-one"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:834
+#, no-c-format
+msgid ""
+"Many-to-one associations are declared at the property level with the "
+"annotation <literal>@ManyToOne</literal>:"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:837
+#, no-c-format
+msgid ""
+"@Entity()\n"
+"public class Flight implements Serializable {\n"
+" <emphasis role=\"bold\">@ManyToOne</emphasis>( cascade =
{CascadeType."
+"PERSIST, CascadeType.MERGE} )\n"
+" @JoinColumn(name=\"COMP_ID\")\n"
+" public Company getCompany() {\n"
+" return company;\n"
+" }\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:839
+#, no-c-format
+msgid ""
+"The <literal>@JoinColumn</literal> attribute is optional, the default
value"
+"(s) is like in one to one, the concatenation of the name of the relationship
"
+"in the owner side, <keycap>_</keycap> (underscore), and the name of the
"
+"primary key column in the owned side. In this example
<literal>company_id</"
+"literal> because the property name is <literal>company</literal> and
the "
+"column id of Company is <literal>id</literal>."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:847
+#, no-c-format
+msgid ""
+"<literal>@ManyToOne</literal> has a parameter named
<literal>targetEntity</"
+"literal> which describes the target entity name. You usually don't need this
"
+"parameter since the default value (the type of the property that stores the "
+"association) is good in almost all cases. However this is useful when you "
+"want to use interfaces as the return type instead of the regular entity."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:854
+#, no-c-format
+msgid ""
+"@Entity()\n"
+"public class Flight implements Serializable {\n"
+" @ManyToOne( cascade = {CascadeType.PERSIST, CascadeType.MERGE}, "
+"<emphasis\n"
+"
role=\"bold\">targetEntity=CompanyImpl.class</emphasis> )\n"
+" @JoinColumn(name=\"COMP_ID\")\n"
+" public Company getCompany() {\n"
+" return company;\n"
+" }\n"
+" ...\n"
+"}\n"
+"\n"
+"public interface Company {\n"
+" ..."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:856
+#, no-c-format
+msgid ""
+"You can alse map a many to one association through an association table. "
+"This association table described by the <literal>@JoinTable</literal>
"
+"annotation will contains a foreign key referencing back the entity table "
+"(through <literal>(a)JoinTable.joinColumns</literal>) and a a foreign key
"
+"referencing the target entity table (through <literal>(a)JoinTable."
+"inverseJoinColumns</literal>)."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:864
+#, no-c-format
+msgid ""
+"@Entity()\n"
+"public class Flight implements Serializable {\n"
+" @ManyToOne( cascade = {CascadeType.PERSIST, CascadeType.MERGE} )\n"
+" <emphasis
role=\"bold\">@JoinTable(name=\"Flight_Company\",\n"
+" joinColumns = @JoinColumn(name=\"FLIGHT_ID\"),\n"
+" inverseJoinColumns = @JoinColumn(name=\"COMP_ID\")\n"
+" )</emphasis>\n"
+" public Company getCompany() {\n"
+" return company;\n"
+" }\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:868
+#, no-c-format
+msgid "Collections"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:872
+#, no-c-format
+msgid "Overview"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:874
+#, no-c-format
+msgid ""
+"You can map <classname>Collection</classname>,
<literal>List</literal> (ie "
+"ordered lists, not indexed lists), <literal>Map</literal> and "
+"<classname>Set</classname>. The EJB3 specification describes how to map
an "
+"ordered list (ie a list ordered at load time) using <literal>(a)javax."
+"persistence.OrderBy</literal> annotation: this annotation takes into "
+"parameter a list of comma separated (target entity) properties to order the "
+"collection by (eg <code>firstname asc, age desc</code>), if the string
is "
+"empty, the collection will be ordered by id. For true indexed collections, "
+"please refer to the <xref linkend=\"entity-hibspec\"/>. EJB3 allows
you to "
+"map Maps using as a key one of the target entity property using "
+"<literal>@MapKey(name=\"myProperty\")</literal> (myProperty
is a property "
+"name in the target entity). When using <literal>@MapKey</literal>
(without "
+"property name), the target entity primary key is used. The map key uses the "
+"same column as the property pointed out: there is no additional column "
+"defined to hold the map key, and it does make sense since the map key "
+"actually represent a target property. Be aware that once loaded, the key is "
+"no longer kept in sync with the property, in other words, if you change the "
+"property value, the key will not change automatically in your Java model "
+"(for true map support please refers to <xref
linkend=\"entity-hibspec\"/>). "
+"Many people confuse <literal><map></literal> capabilities
and "
+"<literal>@MapKey</literal> ones. These are two different features.
"
+"<literal>@MapKey</literal> still has some limitations, please check the
"
+"forum or the JIRA tracking system for more informations."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:902
+#, no-c-format
+msgid "Hibernate has several notions of collections."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:907
+#, no-c-format
+msgid "Collections semantics"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:918
+#, no-c-format
+msgid "Semantic"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:920
+#, no-c-format
+msgid "java representation"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:922
+#, no-c-format
+msgid "annotations"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:928
+#, no-c-format
+msgid "Bag semantic"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:930
+#, no-c-format
+msgid "<para>java.util.List</para>"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:930
+#, no-c-format
+msgid "java.util.Collection"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:932
+#, no-c-format
+msgid "(a)org.hibernate.annotations.CollectionOfElements"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:932
+#, no-c-format
+msgid "or @OneToMany"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:932
+#, no-c-format
+msgid "or @ManyToMany"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:936
+#, no-c-format
+msgid ""
+"Bag semantic with primary key (withtout the limitations of Bag semantic)"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:939
+#, no-c-format
+msgid "java.util.List, java.util.Collection"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:941
+#, no-c-format
+msgid ""
+"((a)org.hibernate.annotations.CollectionOfElements or @OneToMany or "
+"@ManyToMany) and @CollectionId"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:946
+#, no-c-format
+msgid "List semantic"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:948
+#, no-c-format
+msgid "<entry>java.util.List</entry>"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:950
+#, no-c-format
+msgid ""
+"((a)org.hibernate.annotations.CollectionOfElements or @OneToMany or "
+"@ManyToMany) and @org.hibernate.annotations.IndexColumn"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:956
+#, no-c-format
+msgid "Set semantic"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:958
+#, no-c-format
+msgid "java.util.Set"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:960
+#, no-c-format
+msgid ""
+"(a)org.hibernate.annotations.CollectionOfElements or @OneToMany or @ManyToMany"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:965
+#, no-c-format
+msgid "Map semantic"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:967
+#, no-c-format
+msgid "java.util.Map"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:969
+#, no-c-format
+msgid ""
+"((a)org.hibernate.annotations.CollectionOfElements or @OneToMany or "
+"@ManyToMany) and (nothing or @org.hibernate.annotations.MapKey/"
+"MapKeyManyToMany for true map support, OR @javax.persistence.MapKey"
+msgstr ""
+
+#. Tag: remark
+#: entity.xml:978
+#, no-c-format
+msgid ""
+"So specifically, java.util.List collections without @org.hibernate."
+"annotations.IndexColumn are going to be considered as bags."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:982
+#, no-c-format
+msgid ""
+"Collection of primitive, core type or embedded objects is not supported by "
+"the EJB3 specification. Hibernate Annotations allows them however (see <xref
"
+"linkend=\"entity-hibspec\"/>)."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:986
+#, no-c-format
+msgid ""
+"@Entity public class City {\n"
+" @OneToMany(mappedBy=\"city\")\n"
+" <emphasis
role=\"bold\">@OrderBy(\"streetName\")</emphasis>\n"
+" public List<Street> getStreets() {\n"
+" return streets;\n"
+" }\n"
+"...\n"
+"}\n"
+"\n"
+"@Entity public class Street {\n"
+" <emphasis role=\"bold\">public String
getStreetName()</emphasis> {\n"
+" return streetName;\n"
+" }\n"
+"\n"
+" @ManyToOne\n"
+" public City getCity() {\n"
+" return city;\n"
+" }\n"
+" ...\n"
+"}\n"
+"\n"
+"\n"
+"@Entity\n"
+"public class Software {\n"
+" @OneToMany(mappedBy=\"software\")\n"
+" <emphasis
role=\"bold\">@MapKey(name=\"codeName\")</emphasis>\n"
+" public Map<String, Version> getVersions() {\n"
+" return versions;\n"
+" }\n"
+"...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"@Table(name=\"tbl_version\")\n"
+"public class Version {\n"
+" <emphasis role=\"bold\">public String
getCodeName()</emphasis> {...}\n"
+"\n"
+" @ManyToOne\n"
+" public Software getSoftware() { ... }\n"
+"...\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:988
+#, no-c-format
+msgid ""
+"So <literal>City</literal> has a collection of
<literal>Street</literal>s "
+"that are ordered by <literal>streetName</literal> (of
<literal>Street</"
+"literal>) when the collection is loaded. <literal>Software</literal>
has a "
+"map of <literal>Version</literal>s which key is the
<literal>Version</"
+"literal> <literal>codeName</literal>."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:995
+#, no-c-format
+msgid ""
+"Unless the collection is a generic, you will have to define "
+"<literal>targetEntity</literal>. This is a annotation attribute that
take "
+"the target entity class as a value."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1002
+#, no-c-format
+msgid "One-to-many"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1004
+#, no-c-format
+msgid ""
+"One-to-many associations are declared at the property level with the "
+"annotation <literal>@OneToMany</literal>. One to many associations may
be "
+"bidirectional."
+msgstr ""
+
+#. Tag: sect4
+#: entity.xml:1006
+#, no-c-format
+msgid ""
+"<sect5> <title>Bidirectional</title> <para>Since many to
one are (almost) "
+"always the owner side of a bidirectional relationship in the EJB3 spec, the "
+"one to many association is annotated by <literal>@OneToMany( mappedBy=...
)</"
+"literal></para> <programlisting>@Entity\n"
+"public class Troop {\n"
+" @OneToMany(mappedBy=\"troop\")\n"
+" public Set<Soldier> getSoldiers() {\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Soldier {\n"
+" @ManyToOne\n"
+" @JoinColumn(name=\"troop_fk\")\n"
+" public Troop getTroop() {\n"
+" ...\n"
+"} </programlisting>
<para><classname>Troop</classname> has a "
+"bidirectional one to many relationship with <literal>Soldier</literal>
"
+"through the <literal>troop</literal> property. You don't have to
(must not) "
+"define any physical mapping in the <literal>mappedBy</literal>
side.</para> "
+"<para>To map a bidirectional one to many, with the one-to-many side as the
"
+"owning side, you have to remove the <literal>mappedBy</literal> element
and "
+"set the many to one <literal>@JoinColumn</literal> as insertable and
"
+"updatable to false. This solution is obviously not optimized and will "
+"produce some additional UPDATE statements.</para>
<programlisting>@Entity\n"
+"public class Troop {\n"
+" @OneToMany\n"
+" @JoinColumn(name=\"troop_fk\") //we need to duplicate the physical
"
+"information\n"
+" public Set<Soldier> getSoldiers() {\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Soldier {\n"
+" @ManyToOne\n"
+" @JoinColumn(name=\"troop_fk\", insertable=false,
updatable=false)\n"
+" public Troop getTroop() {\n"
+" ...\n"
+"}</programlisting> </sect5> <sect5>
<title>Unidirectional</title> <para>A "
+"unidirectional one to many using a foreign key column in the owned entity is
"
+"not that common and not really recommended. We strongly advise you to use a "
+"join table for this kind of association (as explained in the next section). "
+"This kind of association is described through a
<literal>@JoinColumn</"
+"literal></para> <programlisting>\n"
+"@Entity\n"
+"public class Customer implements Serializable {\n"
+" @OneToMany(cascade=CascadeType.ALL, fetch=FetchType.EAGER)\n"
+" @JoinColumn(name=\"CUST_ID\")\n"
+" public Set<Ticket> getTickets() {\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Ticket implements Serializable {\n"
+" ... //no bidir\n"
+"}\n"
+" </programlisting>
<para><literal>Customer</literal> describes "
+"a unidirectional relationship with <literal>Ticket</literal> using the
join "
+"column <literal>CUST_ID</literal>.</para> </sect5>
<sect5> "
+"<title>Unidirectional with join table</title> <para>A
unidirectional one to "
+"many with join table is much preferred. This association is described "
+"through an <literal>(a)JoinTable</literal>.</para>
<programlisting>\n"
+"@Entity\n"
+"public class Trainer {\n"
+" @OneToMany\n"
+" @JoinTable(\n"
+" name=\"TrainedMonkeys\",\n"
+" joinColumns = @JoinColumn( name=\"trainer_id\"),\n"
+" inverseJoinColumns = @JoinColumn(
name=\"monkey_id\")\n"
+" )\n"
+" public Set<Monkey> getTrainedMonkeys() {\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Monkey {\n"
+" ... //no bidir\n"
+"}\n"
+" </programlisting>
<para><literal>Trainer</literal> describes "
+"a unidirectional relationship with <classname>Monkey</classname> using
the "
+"join table <classname>TrainedMonkeys</classname>, with a foreign key
"
+"<literal>trainer_id</literal> to <literal>Trainer</literal>
"
+"(<literal>joinColumns</literal>) and a foreign key
<literal>monkey_id</"
+"literal> to <literal>Monkey</literal>
(<literal>inversejoinColumns</"
+"literal>).</para> </sect5> <sect5
id=\"entity-mapping-association-collection-"
+"manytomany-default\" revision=\"1\">
<title>Defaults</title> <para>Without "
+"describing any physical mapping, a unidirectional one to many with join "
+"table is used. The table name is the concatenation of the owner table name, "
+"<keycap>_</keycap>, and the other side table name. The foreign key
name(s) "
+"referencing the owner table is the concatenation of the owner table, "
+"<keycap>_</keycap>, and the owner primary key column(s) name. The
foreign "
+"key name(s) referencing the other side is the concatenation of the owner "
+"property name, <keycap>_</keycap>, and the other side primary key
column(s) "
+"name. A unique constraint is added to the foreign key referencing the other "
+"side table to reflect the one to many.</para> <programlisting>\n"
+"@Entity\n"
+"public class Trainer {\n"
+" @OneToMany\n"
+" public Set<Tiger> getTrainedTigers() {\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Tiger {\n"
+" ... //no bidir\n"
+"}\n"
+" </programlisting>
<para><classname>Trainer</classname> "
+"describes a unidirectional relationship with
<classname>Tiger</classname> "
+"using the join table <literal>Trainer_Tiger</literal>, with a foreign
key "
+"<literal>trainer_id</literal> to <literal>Trainer</literal>
(table name, "
+"<keycap>_</keycap>, trainer id) and a foreign key
<literal>trainedTigers_id</"
+"literal> to <literal>Monkey</literal> (property name,
<keycap>_</keycap>, "
+"Tiger primary column).</para> </sect5>"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1099
+#, no-c-format
+msgid "Many-to-many"
+msgstr ""
+
+#. Tag: sect4
+#: entity.xml:1099
+#, no-c-format
+msgid ""
+"<sect5> <title>Definition</title> <para>A many-to-many
association is "
+"defined logically using the <literal>@ManyToMany</literal> annotation.
You "
+"also have to describe the association table and the join conditions using "
+"the <literal>@JoinTable</literal> annotation. If the association is
"
+"bidirectional, one side has to be the owner and one side has to be the "
+"inverse end (ie. it will be ignored when updating the relationship values in
"
+"the association table):</para> <programlisting>\n"
+"@Entity\n"
+"public class Employer implements Serializable {\n"
+" @ManyToMany(\n"
+"
targetEntity=org.hibernate.test.metadata.manytomany.Employee.class,\n"
+" cascade={CascadeType.PERSIST, CascadeType.MERGE}\n"
+" )\n"
+" @JoinTable(\n"
+" name=\"EMPLOYER_EMPLOYEE\",\n"
+" joinColumns=@JoinColumn(name=\"EMPER_ID\"),\n"
+" inverseJoinColumns=@JoinColumn(name=\"EMPEE_ID\")\n"
+" )\n"
+" public Collection getEmployees() {\n"
+" return employees;\n"
+" }\n"
+" ...\n"
+"}\n"
+" </programlisting> <programlisting>\n"
+"@Entity\n"
+"public class Employee implements Serializable {\n"
+" @ManyToMany(\n"
+" cascade = {CascadeType.PERSIST, CascadeType.MERGE},\n"
+" mappedBy = \"employees\",\n"
+" targetEntity = Employer.class\n"
+" )\n"
+" public Collection getEmployers() {\n"
+" return employers;\n"
+" }\n"
+"}\n"
+" </programlisting> <para>We've already shown the many
"
+"declarations and the detailed attributes for associations. We'll go deeper
"
+"in the <literal>@JoinTable</literal> description, it defines a "
+"<literal>name</literal>, an array of join columns (an array in
annotation is "
+"defined using { A, B, C }), and an array of inverse join columns. The latter
"
+"ones are the columns of the association table which refer to the "
+"<classname>Employee</classname> primary key (the \"other
side\").</para> "
+"<para>As seen previously, the other side don't have to (must not)
describe "
+"the physical mapping: a simple <literal>mappedBy</literal> argument
"
+"containing the owner side property name bind the two.</para> </sect5>
"
+"<sect5> <title>Default values</title> <para>As any other
annotations, most "
+"values are guessed in a many to many relationship. Without describing any "
+"physical mapping in a unidirectional many to many the following rules "
+"applied. The table name is the concatenation of the owner table name, "
+"<keycap>_</keycap> and the other side table name. The foreign key
name(s) "
+"referencing the owner table is the concatenation of the owner table name, "
+"<keycap>_</keycap> and the owner primary key column(s). The foreign key
name"
+"(s) referencing the other side is the concatenation of the owner property "
+"name, <keycap>_</keycap>, and the other side primary key column(s).
These "
+"are the same rules used for a unidirectional one to many relationship.</"
+"para> <programlisting>\n"
+"@Entity\n"
+"public class Store {\n"
+" @ManyToMany(cascade = CascadeType.PERSIST)\n"
+" public Set<City> getImplantedIn() {\n"
+" ...\n"
+" }\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class City {\n"
+" ... //no bidirectional relationship\n"
+"}\n"
+" </programlisting> <para>A
<literal>Store_City</literal> is "
+"used as the join table. The <literal>Store_id</literal> column is a
foreign "
+"key to the <literal>Store</literal> table. The
<literal>implantedIn_id</"
+"literal> column is a foreign key to the <literal>City</literal>
table.</"
+"para> <para>Without describing any physical mapping in a bidirectional
many "
+"to many the following rules applied. The table name is the concatenation of "
+"the owner table name, <keycap>_</keycap> and the other side table name.
The "
+"foreign key name(s) referencing the owner table is the concatenation of the "
+"other side property name, <keycap>_</keycap>, and the owner primary key
"
+"column(s). The foreign key name(s) referencing the other side is the "
+"concatenation of the owner property name, <keycap>_</keycap>, and the
other "
+"side primary key column(s). These are the same rules used for a "
+"unidirectional one to many relationship.</para>
<programlisting>\n"
+"@Entity\n"
+"public class Store {\n"
+" @ManyToMany(cascade = {CascadeType.PERSIST, CascadeType.MERGE})\n"
+" public Set<Customer> getCustomers() {\n"
+" ...\n"
+" }\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Customer {\n"
+" @ManyToMany(mappedBy=\"customers\")\n"
+" public Set<Store> getStores() {\n"
+" ...\n"
+" }\n"
+"}\n"
+" </programlisting> <para>A
<literal>Store_Customer</literal> "
+"is used as the join table. The <literal>stores_id</literal> column is a
"
+"foreign key to the <literal>Store</literal> table. The "
+"<literal>customers_id</literal> column is a foreign key to the "
+"<literal>Customer</literal> table.</para> </sect5>"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1177
+#, no-c-format
+msgid "Transitive persistence with cascading"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1179
+#, no-c-format
+msgid ""
+"You probably have noticed the <literal>cascade</literal> attribute
taking an "
+"array of <classname>CascadeType</classname> as a value. The cascade
concept "
+"in EJB3 is very is similar to the transitive persistence and cascading of "
+"operations in Hibernate, but with slightly different semantics and cascading
"
+"types:"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1187
+#, no-c-format
+msgid ""
+"CascadeType.PERSIST: cascades the persist (create) operation to associated "
+"entities persist() is called or if the entity is managed"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1192
+#, no-c-format
+msgid ""
+"CascadeType.MERGE: cascades the merge operation to associated entities if "
+"merge() is called or if the entity is managed"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1197
+#, no-c-format
+msgid ""
+"CascadeType.REMOVE: cascades the remove operation to associated entities if "
+"delete() is called"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1202
+#, no-c-format
+msgid ""
+"CascadeType.REFRESH: cascades the refresh operation to associated entities "
+"if refresh() is called"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1207
+#, no-c-format
+msgid "CascadeType.ALL: all of the above"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1213
+#, no-c-format
+msgid ""
+"CascadeType.ALL also covers Hibernate specific operations like save-update, "
+"lock etc... Check <xref linkend=\"entity-hibspec-cascade\"/> for
more "
+"information"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1218
+#, no-c-format
+msgid ""
+"Please refer to the chapter 6.3 of the EJB3 specification for more "
+"information on cascading and create/merge semantics."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1223
+#, no-c-format
+msgid "Association fetching"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1225
+#, no-c-format
+msgid ""
+"You have the ability to either eagerly or lazily fetch associated entities. "
+"The <literal>fetch</literal> parameter can be set to
<literal>FetchType."
+"LAZY</literal> or <literal>FetchType.EAGER</literal>.
<literal>EAGER</"
+"literal> will try to use an outer join select to retrieve the associated "
+"object, while <literal>LAZY</literal> will only trigger a select when
the "
+"associated object is accessed for the first time.
<literal>@OneToMany</"
+"literal> and <literal>@ManyToMany</literal> associations are
defaulted to "
+"<literal>LAZY</literal> and <literal>@OneToOne</literal>
and "
+"<literal>@ManyToOne</literal> are defaulted to
<literal>EAGER</literal>. For "
+"more information about static fetching, check <xref
linkend=\"entity-hibspec-"
+"singleassoc-fetching\"/>."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1238
+#, no-c-format
+msgid ""
+"The recommanded approach is to use <literal>LAZY</literal> onn all
static "
+"fetching definitions and override this choice dynamically through JPA-QL. "
+"JPA-QL has a <literal>fetch</literal> keyword that allows you to
override "
+"laziness when doing a particular query. This is very useful to improve "
+"performance and is decided on a use case to use case basis."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1248
+#, no-c-format
+msgid "Mapping composite primary and foreign keys"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1250
+#, no-c-format
+msgid ""
+"Composite primary keys use a embedded class as the primary key "
+"representation, so you'd use the <literal>@Id</literal> and "
+"<literal>@Embeddable</literal> annotations. Alternatively, you can use
the "
+"<literal>@EmbeddedId</literal> annotation. Note that the dependent
class has "
+"to be serializable and implements
<methodname>equals()</methodname>/"
+"<methodname>hashCode()</methodname>. You can also use
<literal>@IdClass</"
+"literal> as described in <xref
linkend=\"entity-mapping-identifier\"/>."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1259
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class RegionalArticle implements Serializable {\n"
+"\n"
+" @Id\n"
+" public RegionalArticlePk getPk() { ... }\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"public class RegionalArticlePk implements Serializable { ... }"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1261
+#, no-c-format
+msgid "or alternatively"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1263
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class RegionalArticle implements Serializable {\n"
+"\n"
+" @EmbeddedId\n"
+" public RegionalArticlePk getPk() { ... }\n"
+"}\n"
+"\n"
+"public class RegionalArticlePk implements Serializable { ... }"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1265
+#, no-c-format
+msgid ""
+"<literal>@Embeddable</literal> inherit the access type of its owning
entity "
+"unless the Hibernate specific annotation <literal>@AccessType</literal>
is "
+"used. Composite foreign keys (if not using the default sensitive values) are
"
+"defined on associations using the <literal>@JoinColumns</literal>
element, "
+"which is basically an array of <literal>@JoinColumn</literal>. It is
"
+"considered a good practice to express
<literal>referencedColumnNames</"
+"literal> explicitly. Otherwise, Hibernate will suppose that you use the same
"
+"order of columns as in the primary key declaration."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1275
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Parent implements Serializable {\n"
+" @Id\n"
+" public ParentPk id;\n"
+" public int age;\n"
+"\n"
+" @OneToMany(cascade=CascadeType.ALL)\n"
+" @JoinColumns ({\n"
+" @JoinColumn(name=\"parentCivility\", referencedColumnName =
\"isMale"
+"\"),\n"
+" @JoinColumn(name=\"parentLastName\", referencedColumnName =
"
+"\"lastName\"),\n"
+" @JoinColumn(name=\"parentFirstName\", referencedColumnName =
"
+"\"firstName\")\n"
+" })\n"
+" public Set<Child> children; //unidirectional\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1277
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Child implements Serializable {\n"
+" @Id @GeneratedValue\n"
+" public Integer id;\n"
+"\n"
+" @ManyToOne\n"
+" @JoinColumns ({\n"
+" @JoinColumn(name=\"parentCivility\", referencedColumnName =
\"isMale"
+"\"),\n"
+" @JoinColumn(name=\"parentLastName\", referencedColumnName =
"
+"\"lastName\"),\n"
+" @JoinColumn(name=\"parentFirstName\", referencedColumnName =
"
+"\"firstName\")\n"
+" })\n"
+" public Parent parent; //unidirectional\n"
+"}"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1279
+#, no-c-format
+msgid ""
+"@Embeddable\n"
+"public class ParentPk implements Serializable {\n"
+" String firstName;\n"
+" String lastName;\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1281
+#, no-c-format
+msgid "Note the explicit usage of the
<literal>referencedColumnName</literal>."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1286
+#, no-c-format
+msgid "Mapping secondary tables"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1288
+#, no-c-format
+msgid ""
+"You can map a single entity bean to several tables using the "
+"<literal>@SecondaryTable</literal> or
<literal>@SecondaryTables</literal> "
+"class level annotations. To express that a column is in a particular table, "
+"use the <literal>table</literal> parameter of
<literal>@Column</literal> or "
+"<literal>(a)JoinColumn</literal>."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1295
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Table(name=\"MainCat\")\n"
+"<emphasis role=\"bold\">@SecondaryTables({\n"
+" @SecondaryTable(name=\"Cat1\", pkJoinColumns={\n"
+" @PrimaryKeyJoinColumn(name=\"cat_id\",
referencedColumnName=\"id\")\n"
+" ),\n"
+" @SecondaryTable(name=\"Cat2\",
uniqueConstraints={@UniqueConstraint"
+"(columnNames={\"storyPart2\"})})\n"
+"})</emphasis>\n"
+"public class Cat implements Serializable {\n"
+"\n"
+" private Integer id;\n"
+" private String name;\n"
+" private String storyPart1;\n"
+" private String storyPart2;\n"
+"\n"
+" @Id @GeneratedValue\n"
+" public Integer getId() {\n"
+" return id;\n"
+" }\n"
+"\n"
+" public String getName() {\n"
+" return name;\n"
+" }\n"
+" \n"
+" <emphasis
role=\"bold\">@Column(table=\"Cat1\")</emphasis>\n"
+" public String getStoryPart1() {\n"
+" return storyPart1;\n"
+" }\n"
+"\n"
+" <emphasis
role=\"bold\">@Column(table=\"Cat2\")</emphasis>\n"
+" public String getStoryPart2() {\n"
+" return storyPart2;\n"
+" }"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1297
+#, no-c-format
+msgid ""
+"In this example, <literal>name</literal> will be in
<literal>MainCat</"
+"literal>. <literal>storyPart1</literal> will be in
<literal>Cat1</literal> "
+"and <literal>storyPart2</literal> will be in
<literal>Cat2</literal>. "
+"<literal>Cat1</literal> will be joined to
<literal>MainCat</literal> using "
+"the <literal>cat_id</literal> as a foreign key, and
<literal>Cat2</literal> "
+"using <literal>id</literal> (ie the same column name, the
<literal>MainCat</"
+"literal> id column has). Plus a unique constraint on
<literal>storyPart2</"
+"literal> has been set."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1307
+#, no-c-format
+msgid ""
+"Check out the JBoss EJB 3 tutorial or the Hibernate Annotations unit test "
+"suite for more examples."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1313
+#, no-c-format
+msgid "Mapping Queries"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1317
+#, no-c-format
+msgid "Mapping JPAQL/HQL queries"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1319
+#, no-c-format
+msgid ""
+"You can map EJBQL/HQL queries using annotations.
<literal>@NamedQuery</"
+"literal> and <literal>@NamedQueries</literal> can be defined at the
class "
+"level or in a JPA XML file. However their definitions are global to the "
+"session factory/entity manager factory scope. A named query is defined by "
+"its name and the actual query string."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1326
+#, no-c-format
+msgid ""
+"<entity-mappings>\n"
+" <named-query name=\"plane.getAll\">\n"
+" <query>select p from Plane p</query>\n"
+" </named-query>\n"
+" ...\n"
+"</entity-mappings>\n"
+"...\n"
+"\n"
+"@Entity\n"
+"(a)NamedQuery(name=\"night.moreRecentThan\", query=\"select n from
Night n "
+"where n.date >= :date\")\n"
+"public class Night {\n"
+" ...\n"
+"}\n"
+"\n"
+"public class MyDao {\n"
+" doStuff() {\n"
+" Query q = s.getNamedQuery(\"night.moreRecentThan\");\n"
+" q.setDate( \"date\", aMonthAgo );\n"
+" List results = q.list();\n"
+" ...\n"
+" }\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1328
+#, no-c-format
+msgid ""
+"You can also provide some hints to a query through an array of "
+"<literal>QueryHint</literal> through a
<literal>hints</literal> attribute."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1332
+#, no-c-format
+msgid "The availabe Hibernate hints are"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1337
+#, no-c-format
+msgid "Query hints"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1346
+#, no-c-format
+msgid "hint"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1348
+#, no-c-format
+msgid "description"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1354
+#, no-c-format
+msgid "org.hibernate.cacheable"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1356
+#, no-c-format
+msgid ""
+"Whether the query should interact with the second level cache (defualt to "
+"false)"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1361
+#, no-c-format
+msgid "org.hibernate.cacheRegion"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1363
+#, no-c-format
+msgid "Cache region name (default used otherwise)"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1367
+#, no-c-format
+msgid "org.hibernate.timeout"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1369
+#, no-c-format
+msgid "Query timeout"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1373
+#, no-c-format
+msgid "org.hibernate.fetchSize"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1375
+#, no-c-format
+msgid "resultset fetch size"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1379
+#, no-c-format
+msgid "org.hibernate.flushMode"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1381
+#, no-c-format
+msgid "Flush mode used for this query"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1385
+#, no-c-format
+msgid "org.hibernate.cacheMode"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1387
+#, no-c-format
+msgid "Cache mode used for this query"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1391
+#, no-c-format
+msgid "org.hibernate.readOnly"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1393
+#, no-c-format
+msgid ""
+"Entities loaded by this query should be in read only mode or not (default to
"
+"false)"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1398
+#, no-c-format
+msgid "org.hibernate.comment"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1400
+#, no-c-format
+msgid "Query comment added to the generated SQL"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1408
+#, no-c-format
+msgid "Mapping native queries"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1410
+#, no-c-format
+msgid ""
+"You can also map a native query (ie a plain SQL query). To achieve that, you
"
+"need to describe the SQL resultset structure using "
+"<literal>@SqlResultSetMapping</literal> (or
<literal>@SqlResultSetMappings</"
+"literal> if you plan to define several resulset mappings). Like "
+"<literal>@NamedQuery</literal>, a
<literal>@SqlResultSetMapping</literal> "
+"can be defined at class level or in a JPA XML file. However its scope is "
+"global to the application."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1419
+#, no-c-format
+msgid ""
+"As we will see, a <literal>resultSetMapping</literal> parameter is
defined "
+"in <literal>@NamedNativeQuery</literal>, it represents the name of a
defined "
+"<literal>@SqlResultSetMapping</literal>. The resultset mapping declares
the "
+"entities retrieved by this native query. Each field of the entity is bound "
+"to an SQL alias (or column name). All fields of the entity including the "
+"ones of subclasses and the foreign key columns of related entities have to "
+"be present in the SQL query. Field definitions are optional provided that "
+"they map to the same column name as the one declared on the class property."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1429
+#, no-c-format
+msgid ""
+"@NamedNativeQuery(name=\"night&area\", query=\"select
night.id nid, "
+"night.night_duration, \"\n"
+" + \" night.night_date, area.id aid, night.area_id, area.name
\"\n"
+" + \"from Night night, Area area where night.area_id = area.id\",
"
+"<emphasis\n"
+"
role=\"bold\">resultSetMapping=\"joinMapping\"</emphasis>)\n"
+"@SqlResultSetMapping(name=\"joinMapping\", entities={\n"
+" @EntityResult(entityClass=org.hibernate.test.annotations.query.Night."
+"class, fields = {\n"
+" @FieldResult(name=\"id\", column=\"nid\"),\n"
+" @FieldResult(name=\"duration\",
column=\"night_duration\"),\n"
+" @FieldResult(name=\"date\",
column=\"night_date\"),\n"
+" @FieldResult(name=\"area\",
column=\"area_id\"),\n"
+" discriminatorColumn=\"disc\"\n"
+" }),\n"
+" @EntityResult(entityClass=org.hibernate.test.annotations.query.Area."
+"class, fields = {\n"
+" @FieldResult(name=\"id\", column=\"aid\"),\n"
+" @FieldResult(name=\"name\", column=\"name\")\n"
+" })\n"
+" }\n"
+")"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1431
+#, no-c-format
+msgid ""
+"In the above example, the <literal>night&area</literal> named
query use "
+"the <literal>joinMapping</literal> result set mapping. This mapping
returns "
+"2 entities, <literal>Night</literal> and
<literal>Area</literal>, each "
+"property is declared and associated to a column name, actually the column "
+"name retrieved by the query. Let's now see an implicit declaration of the
"
+"property / column."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1438
+#, no-c-format
+msgid ""
+"@Entity\n"
+"<emphasis
role=\"bold\">@SqlResultSetMapping(name=\"implicit\", "
+"entities=(a)EntityResult(entityClass=org.hibernate.test.annotations.query."
+"SpaceShip.class))\n"
+"@NamedNativeQuery(name=\"implicitSample\", query=\"select * from
SpaceShip"
+"\", resultSetMapping=\"implicit\")</emphasis>\n"
+"public class SpaceShip {\n"
+" private String name;\n"
+" private String model;\n"
+" private double speed;\n"
+"\n"
+" @Id\n"
+" public String getName() {\n"
+" return name;\n"
+" }\n"
+"\n"
+" public void setName(String name) {\n"
+" this.name = name;\n"
+" }\n"
+"\n"
+" @Column(name=\"model_txt\")\n"
+" public String getModel() {\n"
+" return model;\n"
+" }\n"
+"\n"
+" public void setModel(String model) {\n"
+" this.model = model;\n"
+" }\n"
+"\n"
+" public double getSpeed() {\n"
+" return speed;\n"
+" }\n"
+"\n"
+" public void setSpeed(double speed) {\n"
+" this.speed = speed;\n"
+" }\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1440
+#, no-c-format
+msgid ""
+"In this example, we only describe the entity member of the result set "
+"mapping. The property / column mappings is done using the entity mapping "
+"values. In this case the <literal>model</literal> property is bound to
the "
+"<literal>model_txt </literal>column. If the association to a related
entity "
+"involve a composite primary key, a <literal>@FieldResult</literal>
element "
+"should be used for each foreign key column. The
<literal>@FieldResult</"
+"literal> name is composed of the property name for the relationship, "
+"followed by a dot (\".\"), followed by the name or the field or property
of "
+"the primary key."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1450
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@SqlResultSetMapping(name=\"compositekey\",\n"
+" entities=(a)EntityResult(entityClass=org.hibernate.test.annotations."
+"query.SpaceShip.class,\n"
+" fields = {\n"
+" @FieldResult(name=\"name\", column =
\"name\"),\n"
+" @FieldResult(name=\"model\", column =
\"model\"),\n"
+" @FieldResult(name=\"speed\", column =
\"speed\"),\n"
+"<emphasis role=\"bold\">
@FieldResult(name=\"captain."
+"firstname\", column = \"firstn\"),\n"
+" @FieldResult(name=\"captain.lastname\", column =
\"lastn"
+"\"),</emphasis>\n"
+" @FieldResult(name=\"dimensions.length\", column =
"
+"\"length\"),\n"
+" @FieldResult(name=\"dimensions.width\", column =
\"width"
+"\")\n"
+" }),\n"
+" columns = { @ColumnResult(name = \"surface\"),\n"
+" @ColumnResult(name = \"volume\") } )\n"
+"\n"
+"@NamedNativeQuery(name=\"compositekey\",\n"
+" query=\"select name, model, speed, lname as lastn, fname as firstn,
"
+"length, width, length * width as surface from SpaceShip\", \n"
+" resultSetMapping=\"compositekey\")\n"
+"} )\n"
+"public class SpaceShip {\n"
+" private String name;\n"
+" private String model;\n"
+" private double speed;\n"
+" private Captain captain;\n"
+" private Dimensions dimensions;\n"
+"\n"
+" @Id\n"
+" public String getName() {\n"
+" return name;\n"
+" }\n"
+"\n"
+" public void setName(String name) {\n"
+" this.name = name;\n"
+" }\n"
+"\n"
+" @ManyToOne(fetch= FetchType.LAZY)\n"
+" @JoinColumns( {\n"
+" @JoinColumn(name=\"fname\", referencedColumnName =
\"firstname"
+"\"),\n"
+" @JoinColumn(name=\"lname\", referencedColumnName =
\"lastname"
+"\")\n"
+" } )\n"
+" public Captain getCaptain() {\n"
+" return captain;\n"
+" }\n"
+"\n"
+" public void setCaptain(Captain captain) {\n"
+" this.captain = captain;\n"
+" }\n"
+"\n"
+" public String getModel() {\n"
+" return model;\n"
+" }\n"
+"\n"
+" public void setModel(String model) {\n"
+" this.model = model;\n"
+" }\n"
+"\n"
+" public double getSpeed() {\n"
+" return speed;\n"
+" }\n"
+"\n"
+" public void setSpeed(double speed) {\n"
+" this.speed = speed;\n"
+" }\n"
+"\n"
+" public Dimensions getDimensions() {\n"
+" return dimensions;\n"
+" }\n"
+"\n"
+" public void setDimensions(Dimensions dimensions) {\n"
+" this.dimensions = dimensions;\n"
+" }\n"
+"}\n"
+"\n"
+"@Entity\n"
+"(a)IdClass(Identity.class)\n"
+"public class Captain implements Serializable {\n"
+" private String firstname;\n"
+" private String lastname;\n"
+"\n"
+" @Id\n"
+" public String getFirstname() {\n"
+" return firstname;\n"
+" }\n"
+"\n"
+" public void setFirstname(String firstname) {\n"
+" this.firstname = firstname;\n"
+" }\n"
+"\n"
+" @Id\n"
+" public String getLastname() {\n"
+" return lastname;\n"
+" }\n"
+"\n"
+" public void setLastname(String lastname) {\n"
+" this.lastname = lastname;\n"
+" }\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1453
+#, no-c-format
+msgid ""
+"If you look at the dimension property, you'll see that Hibernate supports
"
+"the dotted notation for embedded objects (you can even have nested embedded "
+"objects). EJB3 implementations do not have to support this feature, we do
:-)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1459
+#, no-c-format
+msgid ""
+"If you retrieve a single entity and if you use the default mapping, you can "
+"use the <literal>resultClass</literal> attribute instead of "
+"<literal>resultSetMapping</literal>:"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1463
+#, no-c-format
+msgid ""
+"<emphasis
role=\"bold\">@NamedNativeQuery(name=\"implicitSample\",
query="
+"\"select * from SpaceShip\", \n"
+" resultClass=SpaceShip.class)</emphasis>\n"
+"public class SpaceShip {"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1465
+#, no-c-format
+msgid ""
+"In some of your native queries, you'll have to return scalar values, for
"
+"example when building report queries. You can map them in the "
+"<literal>@SqlResultsetMapping</literal> through
<literal>@ColumnResult</"
+"literal>. You actually can even mix, entities and scalar returns in the same
"
+"native query (this is probably not that common though)."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1472
+#, no-c-format
+msgid ""
+"<emphasis
role=\"bold\">@SqlResultSetMapping(name=\"scalar\", "
+"columns=@ColumnResult(name=\"dimension\"))\n"
+"@NamedNativeQuery(name=\"scalar\", query=\"select length*width as
dimension "
+"from SpaceShip\",
resultSetMapping=\"scalar\")</emphasis>"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1474
+#, no-c-format
+msgid ""
+"An other query hint specific to native queries has been introduced: "
+"<literal>org.hibernate.callable</literal> which can be true or false
"
+"depending on whether the query is a stored procedure or not."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1482
+#, no-c-format
+msgid "Hibernate Annotation Extensions"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1484
+#, no-c-format
+msgid ""
+"Hibernate 3.1 offers a variety of additional annotations that you can mix/"
+"match with your EJB 3 entities. They have been designed as a natural "
+"extension of EJB3 annotations."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1488
+#, no-c-format
+msgid ""
+"To empower the EJB3 capabilities, hibernate provides specific annotations "
+"that match hibernate features. The
<classname>org.hibernate.annotations</"
+"classname> package contains all these annotations extensions."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1494
+#, no-c-format
+msgid "Entity"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1496
+#, no-c-format
+msgid ""
+"You can fine tune some of the actions done by Hibernate on entities beyond "
+"what the EJB3 spec offers."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1499
+#, no-c-format
+msgid ""
+"<classname>(a)org.hibernate.annotations.Entity</classname> adds
additional "
+"metadata that may be needed beyond what is defined in the standard "
+"<literal>@Entity</literal>"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1503
+#, no-c-format
+msgid "mutable: whether this entity is mutable or not"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1508
+#, no-c-format
+msgid "dynamicInsert: allow dynamic SQL for inserts"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1513
+#, no-c-format
+msgid "dynamicUpdate: allow dynamic SQL for updates"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1518
+#, no-c-format
+msgid ""
+"selectBeforeUpdate: Specifies that Hibernate should never perform an SQL "
+"UPDATE unless it is certain that an object is actually modified."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1523
+#, no-c-format
+msgid ""
+"polymorphism: whether the entity polymorphism is of PolymorphismType."
+"IMPLICIT (default) or PolymorphismType.EXPLICIT"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1528
+#, no-c-format
+msgid ""
+"optimisticLock: optimistic locking strategy (OptimisticLockType.VERSION, "
+"OptimisticLockType.NONE, OptimisticLockType.DIRTY or OptimisticLockType.ALL)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1534
+#, no-c-format
+msgid ""
+"(a)javax.persistence.Entity is still mandatory, @org.hibernate.annotations."
+"Entity is not a replacement."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1538
+#, no-c-format
+msgid "Here are some additional Hibernate annotation extensions"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1540
+#, no-c-format
+msgid ""
+"<literal>(a)org.hibernate.annotations.BatchSize</literal> allows you to
define "
+"the batch size when fetching instances of this entity ( eg. "
+"<literal>@BatchSize(size=4)</literal> ). When loading a given entity,
"
+"Hibernate will then load all the uninitialized entities of the same type in "
+"the persistence context up to the batch size."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1546
+#, no-c-format
+msgid ""
+"<literal>(a)org.hibernate.annotations.Proxy</literal> defines the
laziness "
+"attributes of the entity. lazy (default to true) define whether the class is
"
+"lazy or not. proxyClassName is the interface used to generate the proxy "
+"(default is the class itself)."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1551
+#, no-c-format
+msgid ""
+"<literal>(a)org.hibernate.annotations.Where</literal> defines an optional
SQL "
+"WHERE clause used when instances of this class is retrieved."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1555
+#, no-c-format
+msgid ""
+"<literal>(a)org.hibernate.annotations.Check</literal> defines an optional
"
+"check constraints defined in the DDL statetement."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1558
+#, no-c-format
+msgid ""
+"<literal>(a)OnDelete(action=OnDeleteAction.CASCADE)</literal> on joined
"
+"subclasses: use a SQL cascade delete on deletion instead of the regular "
+"Hibernate mechanism."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1562
+#, no-c-format
+msgid ""
+"<literal>@Table(appliesTo=\"tableName\", indexes = {
@Index(name=\"index1\", "
+"columnNames={\"column1\", \"column2\"} ) } )</literal>
creates the defined "
+"indexes on the columns of table <literal>tableName</literal>. This can
be "
+"applied on the primary table or any secondary table. The
<literal>@Tables</"
+"literal> annotation allows your to apply indexes on different tables. This
"
+"annotation is expected where
<literal>(a)javax.persistence.Table</literal> or "
+"<literal>(a)javax.persistence.SecondaryTable</literal>(s) occurs."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1572
+#, no-c-format
+msgid ""
+"<literal>(a)org.hibernate.annotations.Table</literal> is a complement,
not a "
+"replacement to <literal>(a)javax.persistence.Table</literal>. Especially,
if "
+"you want to change the default name of a table, you must use
<literal>(a)javax."
+"persistence.Table</literal>, not
<literal>(a)org.hibernate.annotations.Table</"
+"literal>."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1580
+#, no-c-format
+msgid ""
+"<literal>(a)org.hibernate.annotations.Table</literal> can also be used to
"
+"define the following elements of secondary tables:"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1585
+#, no-c-format
+msgid ""
+"<literal>fetch</literal>: If set to JOIN, the default, Hibernate will
use an "
+"inner join to retrieve a secondary table defined by a class or its "
+"superclasses and an outer join for a secondary table defined by a subclass. "
+"If set to select then Hibernate will use a sequential select for a secondary
"
+"table defined on a subclass, which will be issued only if a row turns out to
"
+"represent an instance of the subclass. Inner joins will still be used to "
+"retrieve a secondary defined by the class and its superclasses."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1597
+#, no-c-format
+msgid ""
+"<literal>inverse</literal>: If true, Hibernate will not try to insert
or "
+"update the properties defined by this join. Default to false."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1603
+#, no-c-format
+msgid ""
+"<literal>optional</literal>: If enabled (the default), Hibernate will
insert "
+"a row only if the properties defined by this join are non-null and will "
+"always use an outer join to retrieve the properties."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1610
+#, no-c-format
+msgid ""
+"<literal>foreignKey</literal>: defines the Foreign Key name of a
secondary "
+"table pointing back to the primary table."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1615
+#, no-c-format
+msgid ""
+"<literal>@Immutable</literal> marks an entity or collection as
immutable. An "
+"immutable entity may not be updated by the application. This allows "
+"Hibernate to make some minor performance optimizations. Updates to an "
+"immutable entity will be ignored, but no exception is thrown. "
+"<literal>@Immutable</literal> must be used on root entities only.
"
+"<literal>@Immutable</literal> placed on a collection makes the
collection "
+"immutable, meaning additions and deletions to and from the collection are "
+"not allowed. A <literal>HibernateException</literal> is thrown in this
case."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1625
+#, no-c-format
+msgid ""
+"<literal>@Persister</literal> lets you define your own custom
persistence "
+"strategy. You may, for example, specify your own subclass of
<classname>org."
+"hibernate.persister.EntityPersister</classname> or you might even provide a
"
+"completely new implementation of the interface <literal>org.hibernate."
+"persister.ClassPersister</literal> that implements persistence via, for
"
+"example, stored procedure calls, serialization to flat files or LDAP."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1633
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@BatchSize(size=5)\n"
+"(a)org.hibernate.annotations.Entity(\n"
+" selectBeforeUpdate = true,\n"
+" dynamicInsert = true, dynamicUpdate = true,\n"
+" optimisticLock = OptimisticLockType.ALL,\n"
+" polymorphism = PolymorphismType.EXPLICIT)\n"
+"@Where(clause=\"1=1\")\n"
+"(a)org.hibernate.annotations.Table(name=\"Forest\", indexes = {
@Index(name="
+"\"idx\", columnNames = { \"name\", \"length\" } ) }
)\n"
+"(a)Persister(impl=MyEntityPersister.class)\n"
+"public class Forest { ... }"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1633
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Inheritance(\n"
+" strategy=InheritanceType.JOINED\n"
+")\n"
+"public class Vegetable { ... }\n"
+"\n"
+"@Entity\n"
+"(a)OnDelete(action=OnDeleteAction.CASCADE)\n"
+"public class Carrot extends Vegetable { ... }"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1637
+#, no-c-format
+msgid "Identifier"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1639
+#, no-c-format
+msgid ""
+"Hibernate Annotations goes beyond the Java Persistence specification when "
+"defining identifiers."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1643
+#, no-c-format
+msgid "Generators"
+msgstr ""
+
+#. Tag: literal
+#: entity.xml:1645
+#, no-c-format
+msgid ""
+"<literal>(a)org.hibernate.annotations.GenericGenerator</literal> and
"
+"<literal>(a)org.hibernate.annotations.GenericGenerators</literal> allows
you "
+"to define an Hibernate specific id generator."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1650
+#, no-c-format
+msgid ""
+"@Id @GeneratedValue(generator=\"system-uuid\")\n"
+"@GenericGenerator(name=\"system-uuid\", strategy =
\"uuid\")\n"
+"public String getId() {\n"
+"\n"
+"@Id @GeneratedValue(generator=\"hibseq\")\n"
+"@GenericGenerator(name=\"hibseq\", strategy =
\"seqhilo\",\n"
+" parameters = {\n"
+" @Parameter(name=\"max_lo\", value = \"5\"),\n"
+" @Parameter(name=\"sequence\",
value=\"heybabyhey\")\n"
+" }\n"
+")\n"
+"public Integer getId() {"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1652
+#, no-c-format
+msgid ""
+"<literal>strategy</literal> is the short name of an Hibernate3
generator "
+"strategy or the fully qualified class name of an "
+"<classname>IdentifierGenerator</classname> implementation. You can add
some "
+"parameters through the <literal>parameters</literal> attribute."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1658
+#, no-c-format
+msgid ""
+"Contrary to their standard counterpart,
<literal>@GenericGenerator</literal> "
+"and <literal>@GenericGenerators</literal> can be used in package level
"
+"annotations, making them application level generators (just like if they "
+"were in a JPA XML file)."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1664
+#, no-c-format
+msgid ""
+"@GenericGenerators(\n"
+" {\n"
+" @GenericGenerator(\n"
+" name=\"hibseq\",\n"
+" strategy = \"seqhilo\",\n"
+" parameters = {\n"
+" @Parameter(name=\"max_lo\", value =
\"5\"),\n"
+" @Parameter(name=\"sequence\",
value=\"heybabyhey\")\n"
+" }\n"
+" ),\n"
+" @GenericGenerator(...)\n"
+" }\n"
+")\n"
+"package org.hibernate.test.model"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1668
+#, no-c-format
+msgid "@NaturalId"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1670
+#, no-c-format
+msgid ""
+"While not used as identifier property, some (group of) properties represent "
+"natural identifier of an entity. This is especially true when the schema "
+"uses the recommended approach of using surrogate primary key even if a "
+"natural business key exists. Hibernate allows to map such natural properties
"
+"and reuse them in a <classname>Criteria</classname> query. The natural
"
+"identifier is composed of all the properties marked
<classname>@NaturalId</"
+"classname>."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1679
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Citizen {\n"
+" @Id\n"
+" @GeneratedValue\n"
+" private Integer id;\n"
+" private String firstname;\n"
+" private String lastname;\n"
+" \n"
+" @NaturalId\n"
+" @ManyToOne\n"
+" private State state;\n"
+"\n"
+" @NaturalId\n"
+" private String ssn;\n"
+" ...\n"
+"}\n"
+"\n"
+"\n"
+"\n"
+"//and later on query\n"
+"List results = s.createCriteria( Citizen.class )\n"
+" .add( Restrictions.naturalId().set( \"ssn\",
\"1234\" ).set"
+"( \"state\", ste ) )\n"
+" .list();"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1681
+#, no-c-format
+msgid ""
+"Note that the group of properties representing the natural identifier have "
+"to be unique (Hibernate will generate a unique constraint if the database "
+"schema is generated)."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1688
+#, no-c-format
+msgid "Property"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1691
+#, no-c-format
+msgid "Access type"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1693
+#, no-c-format
+msgid ""
+"The access type is guessed from the position of <literal>@Id</literal>
or "
+"<literal>@EmbeddedId</literal> in the entity hierarchy. Sub-entities,
"
+"embedded objects and mapped superclass inherit the access type from the root
"
+"entity."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1698
+#, no-c-format
+msgid "In Hibernate, you can override the access type to:"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1702
+#, no-c-format
+msgid "use a custom access type strategy"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1706
+#, no-c-format
+msgid "fine tune the access type at the class level or at the property level"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1711
+#, no-c-format
+msgid ""
+"An @AccessType annotation has been introduced to support this behavior. You "
+"can define the access type on"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1716
+#, no-c-format
+msgid "an entity"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1720
+#, no-c-format
+msgid "a superclass"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1724
+#, no-c-format
+msgid "an embeddable object"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1728
+#, no-c-format
+msgid "a property"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1732
+#, no-c-format
+msgid ""
+"The access type is overriden for the annotated element, if overriden on a "
+"class, all the properties of the given class inherit the access type. For "
+"root entities, the access type is considered to be the default one for the "
+"whole hierarchy (overridable at class or property level)."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1738
+#, no-c-format
+msgid ""
+"If the access type is marked as \"property\", the getters are scanned for
"
+"annotations, if the access type is marked as \"field\", the fields are
"
+"scanned for annotations. Otherwise the elements marked with @Id or "
+"@embeddedId are scanned."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1743
+#, no-c-format
+msgid ""
+"You can override an access type for a property, but the element to annotate "
+"will not be influenced: for example an entity having access type "
+"<literal>field</literal>, can annotate a field with
<literal>@AccessType"
+"(\"property\")</literal>, the access type will then be property for
this "
+"attribute, the the annotations still have to be carried on the field."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1750
+#, no-c-format
+msgid ""
+"If a superclass or an embeddable object is not annotated, the root entity "
+"access type is used (even if an access type has been define on an "
+"intermediate superclass or embeddable object). The russian doll principle "
+"does not apply."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1755
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Person implements Serializable {\n"
+" @Id @GeneratedValue //access type field\n"
+" Integer id;\n"
+"\n"
+" @Embedded\n"
+" @AttributeOverrides({\n"
+" @AttributeOverride(name = \"iso2\", column = @Column(name =
\"bornIso2"
+"\")),\n"
+" @AttributeOverride(name = \"name\", column = @Column(name = "
+"\"bornCountryName\"))\n"
+" })\n"
+" Country bornIn;\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"<emphasis
role=\"bold\">@AccessType(\"property\")</emphasis> //override
"
+"access type for all properties in Country\n"
+"public class Country implements Serializable {\n"
+" private String iso2;\n"
+" private String name;\n"
+"\n"
+" public String getIso2() {\n"
+" return iso2;\n"
+" }\n"
+"\n"
+" public void setIso2(String iso2) {\n"
+" this.iso2 = iso2;\n"
+" }\n"
+"\n"
+" @Column(name = \"countryName\")\n"
+" public String getName() {\n"
+" return name;\n"
+" }\n"
+"\n"
+" public void setName(String name) {\n"
+" this.name = name;\n"
+" }\n"
+"}"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1759
+#, no-c-format
+msgid "Formula"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1761
+#, no-c-format
+msgid ""
+"Sometimes, you want the Database to do some computation for you rather than "
+"in the JVM, you might also create some kind of virtual column. You can use a
"
+"SQL fragment (aka formula) instead of mapping a property into a column. This
"
+"kind of property is read only (its value is calculated by your formula "
+"fragment)."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1767
+#, no-c-format
+msgid ""
+"@Formula(\"obj_length * obj_height * obj_width\")\n"
+"public long getObjectVolume()"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1769
+#, no-c-format
+msgid ""
+"The SQL fragment can be as complex as you want and even include subselects."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1774
+#, no-c-format
+msgid "Type"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1776
+#, no-c-format
+msgid ""
+"<literal>(a)org.hibernate.annotations.Type</literal> overrides the
default "
+"hibernate type used: this is generally not necessary since the type is "
+"correctly inferred by Hibernate. Please refer to the Hibernate reference "
+"guide for more informations on the Hibernate types."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1781
+#, no-c-format
+msgid ""
+"<literal>(a)org.hibernate.annotations.TypeDef</literal> and
<literal>(a)org."
+"hibernate.annotations.TypeDefs</literal> allows you to declare type "
+"definitions. These annotations can be placed at the class or package level. "
+"Note that these definitions are be global for the session factory (even when
"
+"defined at the class level). Type definitions have to be defined before any "
+"usage. If the type is used on a single entity, you can plance the definition
"
+"on the entity itself. Otherwise, it is recommended to place the definition a
"
+"the package level since the entity processing order is not guaranteed."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1790
+#, no-c-format
+msgid ""
+"Package level annotations are placed in a file named
<filename>package-info."
+"java</filename> in the appropriate package. Place your annotations before
"
+"the package declaration."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1793
+#, no-c-format
+msgid ""
+"//in org/hibernate/test/annotations/entity/package-info.java\n"
+"@TypeDefs(\n"
+" {\n"
+" @TypeDef(\n"
+" name=\"caster\",\n"
+" typeClass = CasterStringType.class,\n"
+" parameters = {\n"
+" @Parameter(name=\"cast\", value=\"lower\")\n"
+" }\n"
+" )\n"
+" }\n"
+")\n"
+"package org.hibernate.test.annotations.entity;\n"
+"\n"
+"//in org/hibernate/test/annotations/entity/Forest.java\n"
+"public class Forest {\n"
+" @Type(type=\"caster\")\n"
+" public String getSmallText() {\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1795
+#, no-c-format
+msgid ""
+"When using composite user type, you will have to express column definitions.
"
+"The <literal>@Columns</literal> has been introduced for that
purpose."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1799
+#, no-c-format
+msgid ""
+"(a)Type(type=\"org.hibernate.test.annotations.entity.MonetaryAmountUserType"
+"\")\n"
+"@Columns(columns = {\n"
+" @Column(name=\"r_amount\"),\n"
+" @Column(name=\"r_currency\")\n"
+"})\n"
+"public MonetaryAmount getAmount() {\n"
+" return amount;\n"
+"}\n"
+"\n"
+"\n"
+"public class MonetaryAmount implements Serializable {\n"
+" private BigDecimal amount;\n"
+" private Currency currency;\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1803
+#, no-c-format
+msgid "Index"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1805
+#, no-c-format
+msgid ""
+"You can define an index on a particular column using the
<literal>@Index</"
+"literal> annotation on a one column property, the columnNames attribute will
"
+"then be ignored"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1809
+#, no-c-format
+msgid ""
+"@Column(secondaryTable=\"Cat1\")\n"
+"@Index(name=\"story1index\")\n"
+"public String getStoryPart1() {\n"
+" return storyPart1;\n"
+"}"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1813
+#, no-c-format
+msgid "@Parent"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1815
+#, no-c-format
+msgid ""
+"When inside an embeddable object, you can define one of the properties as a "
+"pointer back to the owner element."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1818
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Person {\n"
+" @Embeddable public Address address;\n"
+" ...\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"public class Address {\n"
+" @Parent public Person owner;\n"
+" ...\n"
+"}\n"
+"\n"
+"\n"
+"person == person.address.owner"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1822
+#, no-c-format
+msgid "Generated properties"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1824
+#, no-c-format
+msgid ""
+"Some properties are generated at insert or update time by your database. "
+"Hibernate can deal with such properties and triggers a subsequent select to "
+"read these properties."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1828
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Antenna {\n"
+" @Id public Integer id;\n"
+" @Generated(GenerationTime.ALWAYS) @Column(insertable = false, updatable "
+"= false)\n"
+" public String longitude;\n"
+"\n"
+" @Generated(GenerationTime.INSERT) @Column(insertable = false)\n"
+" public String latitude;\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1830
+#, no-c-format
+msgid ""
+"Annotate your property as <literal>@Generated</literal> You have to
make "
+"sure your insertability or updatability does not conflict with the "
+"generation strategy you have chosen. When GenerationTime.INSERT is chosen, "
+"the property must not contains insertable columns, when GenerationTime."
+"ALWAYS is chosen, the property must not contains insertable nor updatable "
+"columns."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1837
+#, no-c-format
+msgid ""
+"<literal>@Version</literal> properties cannot be
<literal>@Generated(INSERT)"
+"</literal> by design, it has to be either
<literal>NEVER</literal> or "
+"<literal>ALWAYS</literal>."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1843
+#, no-c-format
+msgid "@Target"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1845
+#, no-c-format
+msgid ""
+"Sometimes, the type guessed by reflection is not the one you want Hibernate "
+"to use. This is especially true on components when an interface is used. You
"
+"can use <literal>@Target</literal> to by pass the reflection guessing
"
+"mechanism (very much like the <literal>targetEntity</literal> attribute
"
+"available on associations."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1852
+#, no-c-format
+msgid ""
+"@Embedded\n"
+" <emphasis
role=\"bold\">(a)Target(OwnerImpl.class)</emphasis>\n"
+" public Owner getOwner() {\n"
+" return owner;\n"
+" }"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1858
+#, no-c-format
+msgid "Optimistic lock"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1860
+#, no-c-format
+msgid ""
+"It is sometimes useful to avoid increasing the version number even if a "
+"given property is dirty (particularly collections). You can do that by "
+"annotating the property (or collection) with <literal>@OptimisticLock"
+"(excluded=true)</literal>."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1865
+#, no-c-format
+msgid ""
+"More formally, specifies that updates to this property do not require "
+"acquisition of the optimistic lock."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1871
+#, no-c-format
+msgid "Inheritance"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1873
+#, no-c-format
+msgid ""
+"SINGLE_TABLE is a very powerful strategy but sometimes, and especially for "
+"legacy systems, you cannot add an additional discriminator column. For that "
+"purpose Hibernate has introduced the notion of discriminator formula: "
+"<literal>@DiscriminatorFormula</literal> is a replacement of "
+"<literal>@DiscriminatorColumn</literal> and use a SQL fragment as a
formula "
+"for discriminator resolution (no need to have a dedicated column)."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1882
+#, no-c-format
+msgid ""
+"@Entity\n"
+"<emphasis role=\"bold\">@DiscriminatorFormula(\"case when
forest_type is "
+"null then 0 else forest_type end\")</emphasis>\n"
+"public class Forest { ... }"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1884
+#, no-c-format
+msgid ""
+"By default, when querying the top entities, Hibernate does not put a "
+"restriction clause on the discriminator column. This can be inconvenient if "
+"this column contains values not mapped in your hierarchy (through "
+"<literal>@DiscriminatorValue</literal>). To work around that you can
use "
+"<literal>@ForceDiscriminator</literal> (at the class level, next to
"
+"<literal>@DiscriminatorColumn</literal>). Hibernate will then list the
"
+"available values when loading the entities."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1892
+#, no-c-format
+msgid ""
+"You can define the foreign key name generated by Hibernate for subclass "
+"tables in the JOINED inheritance strategy."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1895
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Inheritance(strategy = InheritanceType.JOINED)\n"
+"public abstract class File { ... }\n"
+"\n"
+"@Entity\n"
+"@ForeignKey(name = \"FK_DOCU_FILE\")\n"
+"public class Document extends File {"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1897
+#, no-c-format
+msgid ""
+"The foreign key from the <literal>Document</literal> table to the
"
+"<literal>File</literal> table will be named
<literal>FK_DOCU_FILE</literal>."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1903
+#, no-c-format
+msgid "Single Association related annotations"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1905
+#, no-c-format
+msgid ""
+"By default, when Hibernate cannot resolve the association because the "
+"expected associated element is not in database (wrong id on the association "
+"column), an exception is raised by Hibernate. This might be inconvenient for
"
+"legacy and badly maintained schemas. You can ask Hibernate to ignore such "
+"elements instead of raising an exception using the
<literal>@NotFound</"
+"literal> annotation. This annotation can be used on a
<literal>@OneToOne</"
+"literal> (with FK), <literal>@ManyToOne</literal>,
<literal>@OneToMany</"
+"literal> or <literal>@ManyToMany</literal> association."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1915
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Child {\n"
+" ...\n"
+" @ManyToOne\n"
+" @NotFound(action=NotFoundAction.IGNORE)\n"
+" public Parent getParent() { ... }\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1917
+#, no-c-format
+msgid ""
+"Sometimes you want to delegate to your database the deletion of cascade when
"
+"a given entity is deleted."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1920
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Child {\n"
+" ...\n"
+" @ManyToOne\n"
+" @OnDelete(action=OnDeleteAction.CASCADE)\n"
+" public Parent getParent() { ... }\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1922
+#, no-c-format
+msgid ""
+"In this case Hibernate generates a cascade delete constraint at the database
"
+"level."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1925
+#, no-c-format
+msgid ""
+"Foreign key constraints, while generated by Hibernate, have a fairly "
+"unreadable name. You can override the constraint name by use "
+"<literal>(a)ForeignKey</literal>."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1929
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Child {\n"
+" ...\n"
+" @ManyToOne\n"
+" <emphasis
role=\"bold\">@ForeignKey(name=\"FK_PARENT\")</emphasis>\n"
+" public Parent getParent() { ... }\n"
+" ...\n"
+"}\n"
+"\n"
+"alter table Child add constraint FK_PARENT foreign key (parent_id) "
+"references Parent"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1932
+#, no-c-format
+msgid "Lazy options and fetching modes"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1934
+#, no-c-format
+msgid ""
+"EJB3 comes with the <literal>fetch</literal> option to define lazy
loading "
+"and fetching modes, however Hibernate has a much more option set in this "
+"area. To fine tune the lazy loading and fetching strategies, some additional
"
+"annotations have been introduced:"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1941
+#, no-c-format
+msgid ""
+"<literal>@LazyToOne</literal>: defines the lazyness option on "
+"<literal>@ManyToOne</literal> and
<literal>@OneToOne</literal> associations. "
+"<literal>LazyToOneOption</literal> can be
<literal>PROXY</literal> (ie use a "
+"proxy based lazy loading), <literal>NO_PROXY</literal> (use a bytecode
"
+"enhancement based lazy loading - note that build time bytecode processing is
"
+"necessary) and <literal>FALSE</literal> (association not lazy)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1951
+#, no-c-format
+msgid ""
+"<literal>@LazyCollection</literal>: defines the lazyness option on
"
+"<literal>@ManyTo</literal>Many and
<literal>@OneToMany</literal> "
+"associations. LazyCollectionOption can be <literal>TRUE</literal> (the
"
+"collection is lazy and will be loaded when its state is accessed), "
+"<literal>EXTRA</literal> (the collection is lazy and all operations
will try "
+"to avoid the collection loading, this is especially useful for huge "
+"collections when loading all the elements is not necessary) and FALSE "
+"(association not lazy)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1963
+#, no-c-format
+msgid ""
+"<literal>@Fetch</literal>: defines the fetching strategy used to load
the "
+"association. <literal>FetchMode</literal> can be
<literal>SELECT</literal> "
+"(a select is triggered when the association needs to be loaded), "
+"<literal>SUBSELECT</literal> (only available for collections, use a
"
+"subselect strategy - please refers to the Hibernate Reference Documentation "
+"for more information) or <literal>JOIN</literal> (use a SQL JOIN to
load the "
+"association while loading the owner entity). <literal>JOIN</literal>
"
+"overrides any lazy attribute (an association loaded through a
<literal>JOIN</"
+"literal> strategy cannot be lazy)."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1977
+#, no-c-format
+msgid "The Hibernate annotations overrides the EJB3 fetching options."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1981
+#, no-c-format
+msgid "Lazy and fetch options equivalent"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1986
+#, no-c-format
+msgid "Annotations"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1988
+#, no-c-format
+msgid "Lazy"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1990
+#, no-c-format
+msgid "Fetch"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1996
+#, no-c-format
+msgid "(a)[One|Many]ToOne](fetch=FetchType.LAZY)"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1998
+#, no-c-format
+msgid "@LazyToOne(PROXY)"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:2000 entity.xml:2016
+#, no-c-format
+msgid "@Fetch(SELECT)"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:2004
+#, no-c-format
+msgid "(a)[One|Many]ToOne](fetch=FetchType.EAGER)"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:2006
+#, no-c-format
+msgid "@LazyToOne(FALSE)"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:2008 entity.xml:2024
+#, no-c-format
+msgid "@Fetch(JOIN)"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:2012
+#, no-c-format
+msgid "(a)ManyTo[One|Many](fetch=FetchType.LAZY)"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:2014
+#, no-c-format
+msgid "@LazyCollection(TRUE)"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:2020
+#, no-c-format
+msgid "(a)ManyTo[One|Many](fetch=FetchType.EAGER)"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:2022
+#, no-c-format
+msgid "@LazyCollection(FALSE)"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:2032
+#, no-c-format
+msgid "@Any"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2034
+#, no-c-format
+msgid ""
+"The <classname>@Any</classname> annotation defines a polymorphic
association "
+"to classes from multiple tables. This type of mapping always requires more "
+"than one column. The first column holds the type of the associated entity. "
+"The remaining columns hold the identifier. It is impossible to specify a "
+"foreign key constraint for this kind of association, so this is most "
+"certainly not meant as the usual way of mapping (polymorphic) associations. "
+"You should use this only in very special cases (eg. audit logs, user session
"
+"data, etc)."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2043
+#, no-c-format
+msgid ""
+"The @Any annotation describes the column holding the metadata information. "
+"To link the value of the metadata information and an actual entity type, The
"
+"<classname>@AnyDef</classname> and
<classname>@AnyDefs</classname> "
+"annotations are used."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2048
+#, no-c-format
+msgid ""
+"@Any( metaColumn = @Column( name = \"property_type\" ),
fetch=FetchType."
+"EAGER )\n"
+" @AnyMetaDef( \n"
+" idType = \"integer\", \n"
+" metaType = \"string\", \n"
+" metaValues = {\n"
+" @MetaValue( value = \"S\", targetEntity =
StringProperty."
+"class ),\n"
+" @MetaValue( value = \"I\", targetEntity =
IntegerProperty."
+"class )\n"
+" } )\n"
+" @JoinColumn( name = \"property_id\" )\n"
+" public Property getMainProperty() {\n"
+" return mainProperty;\n"
+" }"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2050
+#, no-c-format
+msgid ""
+"<methodname>idType</methodname> represents the target entities
identifier "
+"property type and <methodname>metaType</methodname> the metadata type
"
+"(usually String)."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2054
+#, no-c-format
+msgid ""
+"Note that <classname>@AnyDef</classname> can be mutualized and reused.
It is "
+"recommended to place it as a package metadata in this case."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2058
+#, no-c-format
+msgid ""
+"//on a package\n"
+"@AnyMetaDef( name=\"property\" \n"
+" idType = \"integer\", \n"
+" metaType = \"string\", \n"
+" metaValues = {\n"
+" @MetaValue( value = \"S\", targetEntity = StringProperty.class
),\n"
+" @MetaValue( value = \"I\", targetEntity = IntegerProperty.class
)\n"
+" } )\n"
+"package org.hibernate.test.annotations.any;\n"
+"\n"
+"\n"
+"//in a class\n"
+" @Any( metaDef=\"property\", metaColumn = @Column( name =
\"property_type"
+"\" ), fetch=FetchType.EAGER )\n"
+" @JoinColumn( name = \"property_id\" )\n"
+" public Property getMainProperty() {\n"
+" return mainProperty;\n"
+" }"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:2063
+#, no-c-format
+msgid "Collection related annotations"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:2066
+#, no-c-format
+msgid "Enhance collection settings"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2068
+#, no-c-format
+msgid "It is possible to set"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2070
+#, no-c-format
+msgid "the batch size for collections using @BatchSize"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2075
+#, no-c-format
+msgid ""
+"the where clause, using @Where (applied on the target entity) or "
+"@WhereJoinTable (applied on the association table)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2080
+#, no-c-format
+msgid "the check clause, using @Check"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2085
+#, no-c-format
+msgid "the SQL order by clause, using @OrderBy"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2090
+#, no-c-format
+msgid ""
+"the delete cascade strategy through @OnDelete(action=OnDeleteAction.CASCADE)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2095
+#, no-c-format
+msgid ""
+"the collection immutability using @Immutable: if set specifies that the "
+"elements of the collection never change (a minor performance optimization in
"
+"some cases)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2100
+#, no-c-format
+msgid ""
+"a custom collection persister (ie the persistence strategy used) using "
+"<literal>@Persister</literal>: the class must implement
<classname>org."
+"hibernate.persister.collectionCollectionPersister</classname>"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2107
+#, no-c-format
+msgid ""
+"You can also declare a sort comparator. Use the
<literal>@Sort</literal> "
+"annotation. Expressing the comparator type you want between unsorted, "
+"natural or custom comparator. If you want to use your own comparator "
+"implementation, you'll also have to express the implementation class using
"
+"the <literal>comparator</literal> attribute. Note that you need to use
"
+"either a <classname>SortedSet</classname> or a
<classname>SortedMap</"
+"classname> interface."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2116
+#, no-c-format
+msgid ""
+"(a)OneToMany(cascade=CascadeType.ALL, fetch=FetchType.EAGER)\n"
+" @JoinColumn(name=\"CUST_ID\")\n"
+" @Sort(type = SortType.COMPARATOR, comparator = TicketComparator.class)\n"
+" @Where(clause=\"1=1\")\n"
+" @OnDelete(action=OnDeleteAction.CASCADE)\n"
+" public SortedSet<Ticket> getTickets() {\n"
+" return tickets;\n"
+" }"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2118
+#, no-c-format
+msgid ""
+"Please refer to the previous descriptions of these annotations for more "
+"informations."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2121
+#, no-c-format
+msgid ""
+"Foreign key constraints, while generated by Hibernate, have a fairly "
+"unreadable name. You can override the constraint name by use "
+"<literal>@ForeignKey</literal>. Note that this annotation has to be
placed "
+"on the owning side of the relationship, <literal>inverseName</literal>
"
+"referencing to the other side constraint."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2128
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Woman {\n"
+" ...\n"
+" @ManyToMany(cascade = {CascadeType.ALL})\n"
+" <emphasis role=\"bold\">@ForeignKey(name =
\"TO_WOMAN_FK\", inverseName "
+"= \"TO_MAN_FK\")</emphasis>\n"
+" public Set<Man> getMens() {\n"
+" return mens;\n"
+" }\n"
+"}\n"
+"\n"
+"alter table Man_Woman add constraint TO_WOMAN_FK foreign key (woman_id) "
+"references Woman\n"
+"alter table Man_Woman add constraint TO_MAN_FK foreign key (man_id) "
+"references Man"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:2132
+#, no-c-format
+msgid "Extra collection types"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:2135
+#, no-c-format
+msgid "List"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2137
+#, no-c-format
+msgid ""
+"Beyond EJB3, Hibernate Annotations supports true
<classname>List</classname> "
+"and <classname>Array</classname>. Map your collection the same way as
usual "
+"and add the @<literal>IndexColumn</literal>. This annotation allows you
to "
+"describe the column that will hold the index. You can also declare the index
"
+"value in DB that represent the first element (aka as base index). The usual "
+"value is <literal>0</literal> or
<literal>1</literal>."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2146
+#, no-c-format
+msgid ""
+"@OneToMany(cascade = CascadeType.ALL)\n"
+"@IndexColumn(name = \"drawer_position\", base=1)\n"
+"public List<Drawer> getDrawers() {\n"
+" return drawers;\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2149
+#, no-c-format
+msgid ""
+"If you forgot to set <literal>@IndexColumn</literal>, the bag semantic
is "
+"applied. If you want the bag semantic without the limitations of it, "
+"consider using <literal>(a)CollectionId</literal>."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:2157
+#, no-c-format
+msgid "<title>Map</title>"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2159
+#, no-c-format
+msgid ""
+"Hibernate Annotations also supports true Map mappings, if
<literal>(a)javax."
+"persistence.MapKey</literal> is not set, hibernate will map the key element
"
+"or embeddable object in its/their own columns. To override the default "
+"columns, you can use
<literal>(a)org.hibernate.annotations.MapKey</literal> if "
+"your key is a basic type (defaulted to <literal>mapkey</literal>) or an
"
+"embeddable object, or you can use <literal>(a)org.hibernate.annotations."
+"MapKeyManyToMany</literal> if your key is an entity."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2169
+#, no-c-format
+msgid ""
+"Both <literal>(a)org.hibernate.annotations.MapKey</literal> and
<literal>(a)org."
+"hibernate.annotations.MapKeyManyToMany</literal> allows you to override the
"
+"target element to be used. This is especially useful if your collection does
"
+"not use generics (or if you use interfaces)."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2175
+#, no-c-format
+msgid ""
+"@CollectionOfElements(targetElement = SizeImpl.class)\n"
+" @MapKeyManyToMany(<emphasis role=\"bold\">targetEntity =
LuggageImpl."
+"class</emphasis>)\n"
+" private Map<Luggage, Size> sizePerLuggage = new
HashMap<"
+"Luggage, Size>();"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:2182
+#, no-c-format
+msgid "Bidirectional association with indexed collections"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2184
+#, no-c-format
+msgid ""
+"A bidirectional association where one end is an indexed collection (ie. "
+"represented as a <literal>@IndexColumn</literal>,
<literal>(a)org.hibernate."
+"annotations.MapKey</literal> or
<classname>(a)org.hibernate.annotations."
+"MapKeyManyToMany</classname>) requires special consideration. If a property
"
+"on the associated class explicitly maps the indexed value, the use of "
+"<methodname>mappedBy</methodname> is permitted:"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2192
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Parent {\n"
+" @OneToMany(mappedBy=\"parent\")\n"
+" @org.hibernate.annotations.IndexColumn(name=\"order\")\n"
+" private List<Child> children;\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Child {\n"
+" ...\n"
+" //the index column is mapped as a property in the associated entity\n"
+" @Column(name=\"order\")\n"
+" private int order;\n"
+"\n"
+" @ManyToOne\n"
+" @JoinColumn(name=\"parent_id\", nullable=false)\n"
+" private Parent parent;\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2194
+#, no-c-format
+msgid ""
+"But, if there is no such property on the child class, we can't think of the
"
+"association as truly bidirectional (there is information available at one "
+"end of the association that is not available at the other end: the index). "
+"In this case, we can't map the collection as
<literal>mappedBy</literal>. "
+"Instead, we could use the following mapping:"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2201
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Parent {\n"
+" @OneToMany\n"
+" @org.hibernate.annotations.IndexColumn(name=\"order\")\n"
+" @JoinColumn(name=\"parent_id\", nullable=false)\n"
+" private List<Child> children;\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Child {\n"
+" ...\n"
+" @ManyToOne\n"
+" @JoinColumn(name=\"parent_id\", insertable=false, updatable=false,
"
+"nullable=false)\n"
+" private Parent parent;\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2203
+#, no-c-format
+msgid ""
+"Note that in this mapping, the collection-valued end of the association is "
+"responsible for updating the foreign key."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:2208
+#, no-c-format
+msgid "Bag with primary key"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2210
+#, no-c-format
+msgid ""
+"Another interesting feature is the ability to define a surrogate primary key
"
+"to a bag collection. This remove pretty much all of the drawbacks of bags: "
+"update and removal are efficient, more than one
<literal>EAGER</literal> bag "
+"per query or per entity. This primary key will be contained in a additional "
+"column of your collection table but will not be visible to the Java "
+"application. @CollectionId is used to mark a collection as id bag, it also "
+"allow to override the primary key column(s), the primary key type and the "
+"generator strategy. The strategy can be <literal>identity</literal>, or
any "
+"defined generator name of your application."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2221
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@TableGenerator(name=\"ids_generator\", table=\"IDS\")\n"
+"public class Passport {\n"
+" ...\n"
+"\n"
+" @ManyToMany(cascade = CascadeType.ALL)\n"
+" @JoinTable(name=\"PASSPORT_VISASTAMP\")\n"
+" <emphasis role=\"bold\">@CollectionId(\n"
+" columns = @Column(name=\"COLLECTION_ID\"), \n"
+" type=@Type(type=\"long\"), \n"
+" generator = \"ids_generator\"\n"
+" )</emphasis>\n"
+" private Collection<Stamp> visaStamp = new ArrayList();\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:2225
+#, no-c-format
+msgid "Collection of element or composite elements"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2227
+#, no-c-format
+msgid ""
+"Hibernate Annotations also supports collections of core types (Integer, "
+"String, Enums, ...), collections of embeddable objects and even arrays of "
+"primitive types. This is known as collection of elements."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2232
+#, no-c-format
+msgid ""
+"A collection of elements has to be annotated as "
+"<literal>@CollectionOfElements</literal> (as a replacement of "
+"<literal>@OneToMany</literal>) To define the collection table, the
"
+"<literal>@JoinTable</literal> annotation is used on the association
"
+"property, <literal>joinColumns</literal> defines the join columns
between "
+"the entity primary table and the collection table (inverseJoincolumn is "
+"useless and should be left empty). For collection of core types or array of "
+"primitive types, you can override the element column definition using a "
+"<literal>@Column</literal> on the association property. You can also
"
+"override the columns of a collection of embeddable object using "
+"<literal>@AttributeOverride</literal>. To reach the collection element,
you "
+"need to append \"element\" to the attribute override name (eg
\"element\" "
+"for core types, or \"element.serial\" for the serial property of an
"
+"embeddable element). To reach the index/key of a collection, append
\"key\" "
+"instead."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2249
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Boy {\n"
+" private Integer id;\n"
+" private Set<String> nickNames = new
HashSet<String>();\n"
+" private int[] favoriteNumbers;\n"
+" private Set<Toy> favoriteToys = new
HashSet<Toy>();\n"
+" private Set<Character> characters = new
HashSet<Character>"
+"();\n"
+"\n"
+" @Id @GeneratedValue\n"
+" public Integer getId() {\n"
+" return id;\n"
+" }\n"
+"\n"
+" <emphasis role=\"bold\">@CollectionOfElements\n"
+" public Set<String></emphasis> getNickNames() {\n"
+" return nickNames;\n"
+" }\n"
+"\n"
+" <emphasis role=\"bold\">@CollectionOfElements\n"
+" @JoinTable(\n"
+" table=@Table(name=\"BoyFavoriteNumbers\"),\n"
+" joinColumns = @JoinColumn(name=\"BoyId\")\n"
+" )\n"
+" @Column(name=\"favoriteNumber\",
nullable=false)</emphasis>\n"
+" @IndexColumn(name=\"nbr_index\")\n"
+" public int[] getFavoriteNumbers() {\n"
+" return favoriteNumbers;\n"
+" }\n"
+"\n"
+" <emphasis role=\"bold\">@CollectionOfElements\n"
+" @AttributeOverride( name=\"element.serial\",
column=@Column(name="
+"\"serial_nbr\") )</emphasis>\n"
+" public Set<Toy> getFavoriteToys() {\n"
+" return favoriteToys;\n"
+" }\n"
+"\n"
+" <emphasis role=\"bold\">@CollectionOfElements\n"
+" public Set<Character></emphasis> getCharacters() {\n"
+" return characters;\n"
+" }\n"
+" ...\n"
+"}\n"
+"\n"
+"public enum Character {\n"
+" GENTLE,\n"
+" NORMAL,\n"
+" AGGRESSIVE,\n"
+" ATTENTIVE,\n"
+" VIOLENT,\n"
+" CRAFTY\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"public class Toy {\n"
+" public String name;\n"
+" public String serial;\n"
+" public Boy owner;\n"
+"\n"
+" public String getName() {\n"
+" return name;\n"
+" }\n"
+"\n"
+" public void setName(String name) {\n"
+" this.name = name;\n"
+" }\n"
+"\n"
+" public String getSerial() {\n"
+" return serial;\n"
+" }\n"
+"\n"
+" public void setSerial(String serial) {\n"
+" this.serial = serial;\n"
+" }\n"
+"\n"
+" <emphasis role=\"bold\">@Parent</emphasis>\n"
+" public Boy getOwner() {\n"
+" return owner;\n"
+" }\n"
+"\n"
+" public void setOwner(Boy owner) {\n"
+" this.owner = owner;\n"
+" }\n"
+"\n"
+" public boolean equals(Object o) {\n"
+" if ( this == o ) return true;\n"
+" if ( o == null || getClass() != o.getClass() ) return false;\n"
+"\n"
+" final Toy toy = (Toy) o;\n"
+"\n"
+" if ( !name.equals( toy.name ) ) return false;\n"
+" if ( !serial.equals( toy.serial ) ) return false;\n"
+"\n"
+" return true;\n"
+" }\n"
+"\n"
+" public int hashCode() {\n"
+" int result;\n"
+" result = name.hashCode();\n"
+" result = 29 * result + serial.hashCode();\n"
+" return result;\n"
+" }\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2251
+#, no-c-format
+msgid ""
+"On a collection of embeddable objects, the embeddable object can have a "
+"property annotated with <literal>@Parent</literal>. This property will
then "
+"point back to the entity containing the collection."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2257
+#, no-c-format
+msgid ""
+"Previous versions of Hibernate Annotations used the
<literal>@OneToMany</"
+"literal> to mark a collection of elements. Due to semantic inconsistencies,
"
+"we've introduced the annotation
<literal>@CollectionOfElements</literal>. "
+"Marking collections of elements the old way still work but is considered "
+"deprecated and is going to be unsupported in future releases"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:2267
+#, no-c-format
+msgid "@ManyToAny"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2269
+#, no-c-format
+msgid ""
+"<classname>@ManyToAny</classname> allows polymorphic associations to
classes "
+"from multiple tables. This type of mapping always requires more than one "
+"column. The first column holds the type of the associated entity. The "
+"remaining columns hold the identifier. It is impossible to specify a foreign
"
+"key constraint for this kind of association, so this is most certainly not "
+"meant as the usual way of mapping (polymorphic) associations. You should use
"
+"this only in very special cases (eg. audit logs, user session data, etc)."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2279
+#, no-c-format
+msgid ""
+"@ManyToAny(\n"
+" metaColumn = @Column( name = \"property_type\" ) )\n"
+" @AnyMetaDef( \n"
+" idType = \"integer\", \n"
+" metaType = \"string\",\n"
+" metaValues = {\n"
+" @MetaValue( value = \"S\", targetEntity =
StringProperty."
+"class ),\n"
+" @MetaValue( value = \"I\", targetEntity =
IntegerProperty."
+"class ) } )\n"
+" @Cascade( { org.hibernate.annotations.CascadeType.ALL } )\n"
+" @JoinTable( name = \"obj_properties\", joinColumns = @JoinColumn(
name = "
+"\"obj_id\" ),\n"
+" inverseJoinColumns = @JoinColumn( name = \"property_id\" )
)\n"
+" public List<Property> getGeneralProperties() {"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2281
+#, no-c-format
+msgid ""
+"Like <classname>@Any</classname>,
<classname>@ManyToAny</classname> can use "
+"named <classname>@AnyDef</classname>s, see <xref
linkend=\"entity-hibspec-"
+"singleassoc-any\"/> for more info."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:2290
+#, no-c-format
+msgid "Cascade"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2292
+#, no-c-format
+msgid ""
+"Hibernate offers more operations than the Java Persistence specification. "
+"You can use the <literal>@Cascade</literal> annotation to cascade the
"
+"following operations:"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2298
+#, no-c-format
+msgid "PERSIST"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2302
+#, no-c-format
+msgid "MERGE"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2306
+#, no-c-format
+msgid "REMOVE"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2310
+#, no-c-format
+msgid "REFRESH"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2314
+#, no-c-format
+msgid "DELETE"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2318
+#, no-c-format
+msgid "SAVE_UPDATE"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2322
+#, no-c-format
+msgid "REPLICATE"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2326
+#, no-c-format
+msgid "DELETE_ORPHAN"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2330
+#, no-c-format
+msgid "LOCK"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2334
+#, no-c-format
+msgid "EVICT"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2338
+#, no-c-format
+msgid ""
+"This is especially useful for <literal>SAVE_UPDATE</literal> (which is
the "
+"operation cascaded at flush time if you use plain Hibernate Annotations - "
+"Hibernate EntityManager cascade <literal>PERSIST</literal> at flush
time as "
+"per the specification). DELETE_ORPHAN applies only to
<literal>@OneToMany</"
+"literal> associations, and indicates that the
<methodname>delete()/remove()</"
+"methodname> operation should be applied to any child object that is removed
"
+"from the association. In other words, if a child is dereferenced by a "
+"persistent parent and if <literal>DELETE_ORPHAN</literal> is used, the
"
+"\"orphaned\" child is deleted."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2350
+#, no-c-format
+msgid ""
+"@OneToMany( cascade = {CascadeType.PERSIST, CascadeType.MERGE}
<emphasis\n"
+" role=\"bold\">)\n"
+"(a)Cascade({org.hibernate.annotations.CascadeType.SAVE_UPDATE,\n"
+"
org.hibernate.annotations.CascadeType.DELETE_ORPHAN})</emphasis>\n"
+"public Collection<Employer> getEmployers()"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2352
+#, no-c-format
+msgid ""
+"It is recommended to use @Cascade to compliment @*To*(cascade=...) as shown "
+"in the previous example."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:2357
+#, no-c-format
+msgid "Cache"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2359
+#, no-c-format
+msgid ""
+"In order to optimize your database accesses, you can activate the so called "
+"second level cache of Hibernate. This cache is configurable on a per entity "
+"and per collection basis."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2363
+#, no-c-format
+msgid ""
+"<literal>(a)org.hibernate.annotations.Cache</literal> defines the caching
"
+"strategy and region of a given second level cache. This annotation can be "
+"applied on the root entity (not the sub entities), and on the collections."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2368
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)\n"
+"public class Forest { ... }"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2370
+#, no-c-format
+msgid ""
+"(a)OneToMany(cascade=CascadeType.ALL, fetch=FetchType.EAGER)\n"
+" @JoinColumn(name=\"CUST_ID\")\n"
+" @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)\n"
+" public SortedSet<Ticket> getTickets() {\n"
+" return tickets;\n"
+" }"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2383
+#, no-c-format
+msgid ""
+"@Cache(\n"
+" CacheConcurrencyStrategy usage();\n"
+" String region() default \"\";\n"
+" String include() default \"all\";\n"
+")"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2387
+#, no-c-format
+msgid ""
+"usage: the given cache concurrency strategy (NONE, READ_ONLY, "
+"NONSTRICT_READ_WRITE, READ_WRITE, TRANSACTIONAL)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2392
+#, no-c-format
+msgid ""
+"region (optional): the cache region (default to the fqcn of the class or the
"
+"fq role name of the collection)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2397
+#, no-c-format
+msgid ""
+"<literal>include</literal> (optional): all to include all properties,
non-"
+"lazy to only include non lazy properties (default all)."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:2406
+#, no-c-format
+msgid "Filters"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2408
+#, no-c-format
+msgid ""
+"Hibernate has the ability to apply arbitrary filters on top of your data. "
+"Those filters are applied at runtime on a given session. First, you need to "
+"define them."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2412
+#, no-c-format
+msgid ""
+"<literal>(a)org.hibernate.annotations.FilterDef</literal> or "
+"<literal>@FilterDefs</literal> define filter definition(s) used by
filter(s) "
+"using the same name. A filter definition has a name() and an array of "
+"parameters(). A parameter will allow you to adjust the behavior of the "
+"filter at runtime. Each parameter is defined by a
<literal>@ParamDef</"
+"literal> which has a name and a type. You can also define a
defaultCondition"
+"() parameter for a given <literal>@FilterDef</literal> to set the
default "
+"condition to use when none are defined in each individual
<literal>@Filter</"
+"literal>. A <literal>@FilterDef</literal>(s) can be defined at the
class or "
+"package level."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2424
+#, no-c-format
+msgid ""
+"We now need to define the SQL filter clause applied to either the entity "
+"load or the collection load. <literal>@Filter</literal> is used and
placed "
+"either on the entity or the collection element"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2428
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@FilterDef(name=\"minLength\", parameters=@ParamDef(
name=\"minLength\", "
+"type=\"integer\" ) )\n"
+"@Filters( {\n"
+" @Filter(name=\"betweenLength\", condition=\":minLength <=
length and :"
+"maxLength >= length\"),\n"
+" @Filter(name=\"minLength\", condition=\":minLength <=
length\")\n"
+"} )\n"
+"public class Forest { ... }"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2430
+#, no-c-format
+msgid ""
+"When the collection use an association table as a relational representation,
"
+"you might want to apply the filter condition to the association table itself
"
+"or to the target entity table. To apply the constraint on the target entity,
"
+"use the regular <literal>@Filter</literal> annotation. However, if you
wan "
+"to target the association table, use the
<literal>@FilterJoinTable</literal> "
+"annotation."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2438
+#, no-c-format
+msgid ""
+"@OneToMany\n"
+" @JoinTable\n"
+" //filter on the target entity table\n"
+" @Filter(name=\"betweenLength\", condition=\":minLength <=
length and :"
+"maxLength >= length\")\n"
+" //filter on the association table\n"
+" @FilterJoinTable(name=\"security\", condition=\":userlevel
>= "
+"requredLevel\")\n"
+" public Set<Forest> getForests() { ... }"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:2442
+#, no-c-format
+msgid "Queries"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2444
+#, no-c-format
+msgid ""
+"Since Hibernate has more features on named queries than the one defined in "
+"the EJB3 specification,
<literal>(a)org.hibernate.annotations.NamedQuery</"
+"literal>,
<literal>(a)org.hibernate.annotations.NamedQueries</literal>, "
+"<literal>(a)org.hibernate.annotations.NamedNativeQuery</literal> and
"
+"<literal>(a)org.hibernate.annotations.NamedNativeQueries</literal> have
been "
+"introduced. They add some attributes to the standard version and can be used
"
+"as a replacement:"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2455
+#, no-c-format
+msgid "flushMode: define the query flush mode (Always, Auto, Commit or
Manual)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2460
+#, no-c-format
+msgid "cacheable: whether the query should be cached or not"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2464
+#, no-c-format
+msgid "cacheRegion: cache region used if the query is cached"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2468
+#, no-c-format
+msgid "fetchSize: JDBC statement fetch size for this query"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2472
+#, no-c-format
+msgid "timeout: query time out"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2476
+#, no-c-format
+msgid ""
+"callable: for native queries only, to be set to true for stored procedures"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2481
+#, no-c-format
+msgid ""
+"comment: if comments are activated, the comment seen when the query is sent "
+"to the database."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2486
+#, no-c-format
+msgid "cacheMode: Cache interaction mode (get, ignore, normal, put or
refresh)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2491
+#, no-c-format
+msgid ""
+"readOnly: whether or not the elements retrievent from the query are in read "
+"only mode."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2496
+#, no-c-format
+msgid ""
+"Those hints can be set in a standard
<literal>(a)javax.persistence.NamedQuery</"
+"literal> annotations through the detyped
<literal>@QueryHint</literal>. "
+"Another key advantage is the ability to set those annotations at a package "
+"level."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:2503
+#, no-c-format
+msgid "Custom SQL for CRUD operations"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2505
+#, no-c-format
+msgid ""
+"Hibernate gives you the ability to override every single SQL statement "
+"generated. We have seen native SQL query usage already, but you can also "
+"override the SQL statement used to load or change the state of entities."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2510
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Table(name=\"CHAOS\")\n"
+"<emphasis role=\"bold\">@SQLInsert( sql=\"INSERT INTO
CHAOS(size, name, "
+"nickname, id) VALUES(?,upper(?),?,?)\")\n"
+"@SQLUpdate( sql=\"UPDATE CHAOS SET size = ?, name = upper(?), nickname = ?
"
+"WHERE id = ?\")\n"
+"@SQLDelete( sql=\"DELETE CHAOS WHERE id = ?\")\n"
+"@SQLDeleteAll( sql=\"DELETE CHAOS\")\n"
+"</emphasis><emphasis role=\"bold\">@Loader(namedQuery =
\"chaos\")</"
+"emphasis>\n"
+"@NamedNativeQuery(name=\"chaos\", query=\"select id, size, name,
lower"
+"( nickname ) as nickname from CHAOS where id= ?\", resultClass = Chaos."
+"class)\n"
+"public class Chaos {\n"
+" @Id\n"
+" private Long id;\n"
+" private Long size;\n"
+" private String name;\n"
+" private String nickname;"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2512
+#, no-c-format
+msgid ""
+"<literal>@SQLInsert</literal>,
<literal>@SQLUpdate</literal>, "
+"<literal>@SQLDelete</literal>,
<literal>@SQLDeleteAll</literal> respectively "
+"override the INSERT statement, UPDATE statement, DELETE statement, DELETE "
+"statement to remove all entities."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2517
+#, no-c-format
+msgid ""
+"If you expect to call a store procedure, be sure to set the "
+"<literal>callable</literal> attribute to true
(<literal>@SQLInsert"
+"(callable=true, ...)</literal>)."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2521
+#, no-c-format
+msgid ""
+"To check that the execution happens correctly, Hibernate allows you to "
+"define one of those three strategies:"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2526
+#, no-c-format
+msgid ""
+"NONE: no check is performed: the store procedure is expected to fail upon "
+"issues"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2531
+#, no-c-format
+msgid "COUNT: use of rowcount to check that the update is successful"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2536
+#, no-c-format
+msgid ""
+"PARAM: like COUNT but using an output parameter rather that the standard "
+"mechanism"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2541
+#, no-c-format
+msgid ""
+"To define the result check style, use the <literal>check</literal>
parameter "
+"(<literal>(a)SQLUpdate(check=ResultCheckStyle.COUNT,
...)</literal>)."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2545
+#, no-c-format
+msgid ""
+"You can also override the SQL load statement by a native SQL query or a HQL "
+"query. You just have to refer to a named query with the "
+"<literal><literal>@Loader</literal></literal>
annotation."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2549
+#, no-c-format
+msgid ""
+"You can use the exact same set of annotations to override the collection "
+"related statements."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2552
+#, no-c-format
+msgid ""
+"@OneToMany\n"
+"@JoinColumn(name=\"chaos_fk\")\n"
+"<emphasis role=\"bold\">@SQLInsert( sql=\"UPDATE
CASIMIR_PARTICULE SET "
+"chaos_fk = ? where id = ?\")\n"
+"@SQLDelete( sql=\"UPDATE CASIMIR_PARTICULE SET chaos_fk = null where id =
?"
+"\")</emphasis>\n"
+"private Set<CasimirParticle> particles = new HashSet<"
+"CasimirParticle>();"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2554
+#, no-c-format
+msgid ""
+"The parameters order is important and is defined by the order Hibernate "
+"handle properties. You can see the expected order by enabling debug logging "
+"for the <literal>org.hibernate.persister.entity</literal> level. With
this "
+"level enabled Hibernate will print out the static SQL that is used to "
+"create, update, delete etc. entities. (To see the expected sequence, "
+"remember to not include your custom SQL through annotations as that will "
+"override the Hibernate generated static sql.)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2563
+#, no-c-format
+msgid ""
+"Overriding SQL statements for secondary tables is also possible using "
+"<literal>(a)org.hibernate.annotations.Table</literal> and either (or all)
"
+"attributes <literal>sqlInsert</literal>,
<literal>sqlUpdate</literal>, "
+"<literal>sqlDelete</literal>:"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2568
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@SecondaryTables({\n"
+" @SecondaryTable(name = \"`Cat nbr1`\"),\n"
+" @SecondaryTable(name = \"Cat2\"})\n"
+"(a)org.hibernate.annotations.Tables( {\n"
+" @Table(appliesTo = \"Cat\", comment = \"My cat table\"
),\n"
+" @Table(appliesTo = \"Cat2\", foreignKey =
@ForeignKey(name=\"FK_CAT2_CAT"
+"\"), fetch = FetchMode.SELECT,\n"
+" <emphasis
role=\"bold\">sqlInsert=@SQLInsert(sql=\"insert into Cat2"
+"(storyPart2, id) values(upper(?), ?)\") )</emphasis>\n"
+"} )\n"
+"public class Cat implements Serializable {"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2570
+#, no-c-format
+msgid ""
+"The previous example also show that you can give a comment to a given table "
+"(promary or secondary): This comment will be used for DDL generation."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:2576
+#, no-c-format
+msgid "Tuplizer"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2578
+#, no-c-format
+msgid ""
+"<classname>org.hibernate.tuple.Tuplizer</classname>, and its
sub-interfaces, "
+"are responsible for managing a particular representation of a piece of data,
"
+"given that representation's
<literal>org.hibernate.EntityMode</literal>. If "
+"a given piece of data is thought of as a data structure, then a tuplizer is "
+"the thing which knows how to create such a data structure and how to extract
"
+"values from and inject values into such a data structure. For example, for "
+"the POJO entity mode, the correpsonding tuplizer knows how create the POJO "
+"through its constructor and how to access the POJO properties using the "
+"defined property accessors. There are two high-level types of Tuplizers, "
+"represented by the
<classname>org.hibernate.tuple.EntityTuplizer</classname> "
+"and <classname>org.hibernate.tuple.ComponentTuplizer</classname>
interfaces. "
+"EntityTuplizers are responsible for managing the above mentioned contracts "
+"in regards to entities, while <classname>ComponentTuplizers</classname>
do "
+"the same for components. Check the Hibernate reference documentation for "
+"more information."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2596
+#, no-c-format
+msgid ""
+"To define tuplixer in annotations, simply use the
<literal>@Tuplizer</"
+"literal> annotation on the according element"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2599
+#, no-c-format
+msgid ""
+"@Entity\n"
+"<emphasis role=\"bold\">@Tuplizer(impl =
DynamicEntityTuplizer.class)</"
+"emphasis>\n"
+"public interface Cuisine {\n"
+" @Id\n"
+" @GeneratedValue\n"
+" public Long getId();\n"
+" public void setId(Long id);\n"
+"\n"
+" public String getName();\n"
+" public void setName(String name);\n"
+"\n"
+" <emphasis role=\"bold\">@Tuplizer(impl =
DynamicComponentTuplizer.class)"
+"</emphasis>\n"
+" public Country getCountry();\n"
+" public void setCountry(Country country);\n"
+"\n"
+"\n"
+"}"
+msgstr ""
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/ja-JP/setup.po
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/ja-JP/setup.po
(rev 0)
+++ annotations/branches/v3_4_0_GA_CP/src/main/docbook/ja-JP/setup.po 2009-12-22 06:50:19
UTC (rev 18313)
@@ -0,0 +1,319 @@
+#. Tag: title
+#: setup.xml:28
+#, no-c-format
+msgid "Setting up an annotations project"
+msgstr ""
+
+#. Tag: title
+#: setup.xml:31
+#, no-c-format
+msgid "Requirements"
+msgstr ""
+
+#. Tag: para
+#: setup.xml:35
+#, no-c-format
+msgid ""
+"<ulink
url=\"http://www.hibernate.org/6.html\">Download</ulink> and unpack
"
+"the Hibernate Annotations distribution from the Hibernate website."
+msgstr ""
+
+#. Tag: emphasis
+#: setup.xml:41
+#, no-c-format
+msgid "This release requires Hibernate Core 3.3 and above."
+msgstr ""
+
+#. Tag: para
+#: setup.xml:46
+#, no-c-format
+msgid "This release is known to work on Hibernate Core 3.3.0.SP1"
+msgstr ""
+
+#. Tag: para
+#: setup.xml:50
+#, no-c-format
+msgid ""
+"Make sure you have JDK 5.0 installed or above. You can of course continue "
+"using XDoclet and get some of the benefits of annotation-based metadata with
"
+"older JDK versions. Note that this document only describes JDK 5.0 "
+"annotations and you have to refer to the XDoclet documentation for more "
+"information."
+msgstr ""
+
+#. Tag: title
+#: setup.xml:60
+#, no-c-format
+msgid "Configuration"
+msgstr ""
+
+#. Tag: para
+#: setup.xml:62
+#, no-c-format
+msgid ""
+"First, set up your classpath (after you have created a new project in your "
+"favorite IDE):"
+msgstr ""
+
+#. Tag: para
+#: setup.xml:65
+#, no-c-format
+msgid ""
+"Copy all Hibernate3 core and required 3rd party library files (see lib/"
+"README.txt in Hibernate)."
+msgstr ""
+
+#. Tag: para
+#: setup.xml:70
+#, no-c-format
+msgid ""
+"Copy <filename>hibernate-annotations.jar</filename>,
<filename>lib/hibernate-"
+"comons-annotations.jar</filename> and
<filename>lib/ejb3-persistence.jar</"
+"filename> from the Hibernate Annotations distribution to your classpath as
"
+"well."
+msgstr ""
+
+#. Tag: para
+#: setup.xml:77
+#, no-c-format
+msgid ""
+"If you wish to use <ulink
url=\"http://validator.hibernate.org\">Hibernate "
+"Validator</ulink>, download it from the Hibernate website and add "
+"<filename>hibernate-validator.jar</filename> in your classpath."
+msgstr ""
+
+#. Tag: para
+#: setup.xml:82
+#, no-c-format
+msgid ""
+"If you wish to use <ulink
url=\"http://search.hibernate.org\">Hibernate "
+"Search</ulink>, download it from the Hibernate website and add "
+"<filename>hibernate-search.jar</filename> and
<filename>lucene-core-x.y.z."
+"jar</filename> in your classpath."
+msgstr ""
+
+#. Tag: para
+#: setup.xml:88
+#, no-c-format
+msgid ""
+"We also recommend a small wrapper class to startup Hibernate in a static "
+"initializer block, known as <classname>HibernateUtil</classname>. You
might "
+"have seen this class in various forms in other areas of the Hibernate "
+"documentation. For Annotation support you have to enhance this helper class "
+"as follows:"
+msgstr ""
+
+#. Tag: programlisting
+#: setup.xml:92
+#, no-c-format
+msgid ""
+"package hello;\n"
+"\n"
+"import org.hibernate.*;\n"
+"import org.hibernate.cfg.*;\n"
+"import test.*;\n"
+"import test.animals.Dog;\n"
+"\n"
+"public class HibernateUtil {\n"
+"\n"
+"private static final SessionFactory sessionFactory;\n"
+"\n"
+" static {\n"
+" try {\n"
+"\n"
+" sessionFactory = new <emphasis role=\"bold"
+"\">AnnotationConfiguration()</emphasis>\n"
+" configure().buildSessionFactory();\n"
+" } catch (Throwable ex) {\n"
+" // Log exception!\n"
+" throw new ExceptionInInitializerError(ex);\n"
+" }\n"
+" }\n"
+"\n"
+" public static Session getSession()\n"
+" throws HibernateException {\n"
+" return sessionFactory.openSession();\n"
+" }\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: setup.xml:94
+#, no-c-format
+msgid ""
+"Interesting here is the use of <classname>AnnotationConfiguration</"
+"classname>. The packages and annotated classes are declared in your regular
"
+"XML configuration file (usually
<filename>hibernate.cfg.xml</filename>). "
+"Here is the equivalent of the above declaration:"
+msgstr ""
+
+#. Tag: programlisting
+#: setup.xml:100
+#, no-c-format
+msgid ""
+"<!DOCTYPE hibernate-configuration PUBLIC\n"
+" \"-//Hibernate/Hibernate Configuration DTD 3.0//EN\"\n"
+" \"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"
+"\">\n"
+"\n"
+" <hibernate-configuration>\n"
+" <session-factory>\n"
+" <emphasis role=\"bold\"><mapping
package=\"test.animals\"/"
+">\n"
+" <mapping class=\"test.Flight\"/>\n"
+" <mapping class=\"test.Sky\"/>\n"
+" <mapping class=\"test.Person\"/>\n"
+" <mapping
class=\"test.animals.Dog\"/></emphasis>\n"
+"<emphasis role=\"bold\"> <mapping
resource=\"test/animals/orm."
+"xml\"/></emphasis>\n"
+" </session-factory>\n"
+" </hibernate-configuration>"
+msgstr ""
+
+#. Tag: para
+#: setup.xml:102
+#, no-c-format
+msgid ""
+"Note that you can mix the hbm.xml use and the new annotation one. The "
+"resource element can be either an hbm file or an EJB3 XML deployment "
+"descriptor. The distinction is transparent for your configuration process."
+msgstr ""
+
+#. Tag: para
+#: setup.xml:107
+#, no-c-format
+msgid ""
+"Alternatively, you can define the annotated classes and packages using the "
+"programmatic API"
+msgstr ""
+
+#. Tag: programlisting
+#: setup.xml:110
+#, no-c-format
+msgid ""
+"sessionFactory = new <emphasis
role=\"bold\">AnnotationConfiguration()\n"
+" .addPackage(\"test.animals\") //the fully qualified package
name\n"
+" .addAnnotatedClass(Flight.class)\n"
+" .addAnnotatedClass(Sky.class)\n"
+" .addAnnotatedClass(Person.class)\n"
+" .addAnnotatedClass(Dog.class)</emphasis>\n"
+"<emphasis
role=\"bold\">.addResource(\"test/animals/orm.xml\")</emphasis>\n"
+" configure()..buildSessionFactory();"
+msgstr ""
+
+#. Tag: para
+#: setup.xml:112
+#, no-c-format
+msgid ""
+"You can also use the Hibernate EntityManager which has its own configuration
"
+"mechanism. Please refer to this project documentation for more details."
+msgstr ""
+
+#. Tag: para
+#: setup.xml:116
+#, no-c-format
+msgid ""
+"There is no other difference in the way you use Hibernate APIs with "
+"annotations, except for this startup routine change or in the configuration "
+"file. You can use your favorite configuration method for other properties "
+"( <filename>hibernate.properties</filename>,
<filename>hibernate.cfg.xml</"
+"filename>, programmatic APIs, etc). You can even mix annotated persistent
"
+"classes and classic <filename>hbm.cfg.xml</filename> declarations with
the "
+"same <classname>SessionFactory</classname>. You can however not declare
a "
+"class several times (whether annotated or through hbm.xml). You cannot mix "
+"configuration strategies (hbm vs annotations) in a mapped entity hierarchy "
+"either."
+msgstr ""
+
+#. Tag: para
+#: setup.xml:128
+#, no-c-format
+msgid ""
+"To ease the migration process from hbm files to annotations, the "
+"configuration mechanism detects the mapping duplication between annotations "
+"and hbm files. HBM files are then prioritized over annotated metadata on a "
+"class to class basis. You can change the priority using
<literal>hibernate."
+"mapping.precedence</literal> property. The default is <literal>hbm,
class</"
+"literal>, changing it to <literal>class, hbm</literal> will
prioritize the "
+"annotated classes over hbm files when a conflict occurs."
+msgstr ""
+
+#. Tag: title
+#: setup.xml:139
+#, no-c-format
+msgid "Properties"
+msgstr ""
+
+#. Tag: para
+#: setup.xml:141
+#, no-c-format
+msgid ""
+"Asides from the Hibernate core properties, Hibernate Annotations reacts to "
+"the following one"
+msgstr ""
+
+#. Tag: title
+#: setup.xml:146
+#, no-c-format
+msgid "Logging"
+msgstr ""
+
+#. Tag: para
+#: setup.xml:148
+#, no-c-format
+msgid ""
+"Hibernate Annotations utilizes <ulink
url=\"http://www.slf4j.org/\">Simple "
+"Logging Facade for Java</ulink> (SLF4J) in order to log various system
"
+"events. SLF4J can direct your logging output to several logging frameworks "
+"(NOP, Simple, log4j version 1.2, JDK 1.4 logging, JCL or logback) depending "
+"on your chosen binding. In order to setup logging properly you will need "
+"<filename>slf4j-api.jar</filename> in your classpath together with the
jar "
+"file for your preferred binding -
<filename>slf4j-log4j12.jar</filename> in "
+"the case of Log4J. See the SLF4J <ulink type=\"\"
url=\"http://www.slf4j.org/"
+"manual.html\">documentation</ulink> for more detail."
+msgstr ""
+
+#. Tag: para
+#: setup.xml:160
+#, no-c-format
+msgid "The logging categories interesting for Hibernate Annotations are:"
+msgstr ""
+
+#. Tag: title
+#: setup.xml:164
+#, no-c-format
+msgid "Hibernate Annotations Log Categories"
+msgstr ""
+
+#. Tag: entry
+#: setup.xml:169
+#, no-c-format
+msgid "Category"
+msgstr ""
+
+#. Tag: entry
+#: setup.xml:171
+#, no-c-format
+msgid "Function"
+msgstr ""
+
+#. Tag: emphasis
+#: setup.xml:177
+#, no-c-format
+msgid "org.hibernate.cfg"
+msgstr ""
+
+#. Tag: entry
+#: setup.xml:179
+#, no-c-format
+msgid "Log all configuration related events (not only annotations)."
+msgstr ""
+
+#. Tag: para
+#: setup.xml:186
+#, no-c-format
+msgid ""
+"For further category configuration refer to the <ulink
url=\"http://www."
+"hibernate.org/hib_docs/v3/reference/en/html_single/#configuration-logging"
+"\">Logging</ulink> in the Hibernate Core documentation."
+msgstr ""
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/ja-JP/xml-overriding.po
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/ja-JP/xml-overriding.po
(rev 0)
+++ annotations/branches/v3_4_0_GA_CP/src/main/docbook/ja-JP/xml-overriding.po 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,415 @@
+#. Tag: title
+#: xml-overriding.xml:28
+#, no-c-format
+msgid "Overriding metadata through XML"
+msgstr ""
+
+#. Tag: para
+#: xml-overriding.xml:30
+#, no-c-format
+msgid ""
+"The primary target for metadata in EJB3 is annotations, but the EJB3 "
+"specification provides a way to override or replace the annotation defined "
+"metadata through an XML deployment descriptor. In the current release only "
+"pure EJB3 annotations overriding are supported. If you wish to use Hibernate
"
+"specific features in some entities, you'll have to either use annotations or
"
+"fallback to hbm files. You can of course mix and match annotated entities "
+"and entities describes in hbm files."
+msgstr ""
+
+#. Tag: para
+#: xml-overriding.xml:38
+#, no-c-format
+msgid "The unit test suite shows some additional XML file samples."
+msgstr ""
+
+#. Tag: title
+#: xml-overriding.xml:41
+#, no-c-format
+msgid "Principles"
+msgstr ""
+
+#. Tag: para
+#: xml-overriding.xml:43
+#, no-c-format
+msgid ""
+"The XML deployment descriptor structure has been designed to reflect the "
+"annotations one. So if you know the annotations structure, using the XML "
+"schema will be straightforward for you."
+msgstr ""
+
+#. Tag: para
+#: xml-overriding.xml:47
+#, no-c-format
+msgid ""
+"You can define one ot more XML files describing your metadata, these files "
+"will be merged by the overriding engine."
+msgstr ""
+
+#. Tag: title
+#: xml-overriding.xml:51
+#, no-c-format
+msgid "Global level metadata"
+msgstr ""
+
+#. Tag: para
+#: xml-overriding.xml:53
+#, no-c-format
+msgid ""
+"You can define global level metadata available for all XML files. You must "
+"not define these metadata more than once per deployment."
+msgstr ""
+
+#. Tag: programlisting
+#: xml-overriding.xml:56
+#, no-c-format
+msgid ""
+"<?xml version=\"1.0\"
encoding=\"UTF-8\"?>\n"
+"\n"
+"<entity-mappings \n"
+"
xmlns=\"http://java.sun.com/xml/ns/persistence/orm\"\n"
+"
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
+"
xsi:schemaLocation=\"http://java.sun.com/xml/ns/persistence/orm
orm_1_0.xsd"
+"\"\n"
+" version=\"1.0\">\n"
+"\n"
+" <persistence-unit-metadata>\n"
+" <xml-mapping-metadata-complete/>\n"
+" <persistence-unit-defaults>\n"
+" <schema>myschema</schema>\n"
+" <catalog>mycatalog</catalog>\n"
+" <cascade-persist/>\n"
+" </persistence-unit-defaults>\n"
+" </persistence-unit-metadata>"
+msgstr ""
+
+#. Tag: para
+#: xml-overriding.xml:58
+#, no-c-format
+msgid ""
+"<literal>xml-mapping-metadata-complete</literal> means that all entity,
"
+"mapped-superclasses and embeddable metadata should be picked up from XML (ie
"
+"ignore annotations)."
+msgstr ""
+
+#. Tag: para
+#: xml-overriding.xml:62
+#, no-c-format
+msgid ""
+"<literal>schema / catalog</literal> will override all default
definitions of "
+"schema and catalog in the metadata (both XML and annotations)."
+msgstr ""
+
+#. Tag: para
+#: xml-overriding.xml:66
+#, no-c-format
+msgid ""
+"<literal>cascade-persist</literal> means that all associations have
PERSIST "
+"as a cascade type. We recommend you to not use this feature."
+msgstr ""
+
+#. Tag: title
+#: xml-overriding.xml:72
+#, no-c-format
+msgid "Entity level metadata"
+msgstr ""
+
+#. Tag: para
+#: xml-overriding.xml:74
+#, no-c-format
+msgid ""
+"You can either define or override metadata informations on a given entity."
+msgstr ""
+
+#. Tag: section
+#: xml-overriding.xml:75
+#, no-c-format
+msgid ""
+"<programlistingco> <areaspec> <area coords=\"3 85\"
id=\"aa1\"/> <area "
+"coords=\"9 85\" id=\"aa2\"/> <area coords=\"10
85\" id=\"aa3\"/> <area "
+"coords=\"11 85\" id=\"aa4\"/> <area coords=\"17
85\" id=\"aa5\"/> <area "
+"coords=\"23 85\" id=\"aa6\"/> <area coords=\"24
85\" id=\"aa7\"/> <area "
+"coords=\"25 85\" id=\"aa8\"/> <area coords=\"26
85\" id=\"aa9\"/> <area "
+"coords=\"31 85\" id=\"aa10\"/> </areaspec>
<programlisting><?xml version="
+"\"1.0\" encoding=\"UTF-8\"?>\n"
+"\n"
+"<entity-mappings \n"
+"
xmlns=\"http://java.sun.com/xml/ns/persistence/orm\"\n"
+"
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
+"
xsi:schemaLocation=\"http://java.sun.com/xml/ns/persistence/orm
orm_1_0.xsd"
+"\"\n"
+" version=\"1.0\">\n"
+"\n"
+"
<package>org.hibernate.test.annotations.reflection</"
+"package>\n"
+" <entity class=\"Administration\" access=\"PROPERTY\"
metadata-"
+"complete=\"true\">\n"
+" <table name=\"tbl_admin\">\n"
+" <unique-constraint>\n"
+"
<column-name>firstname</column-name>\n"
+"
<column-name>lastname</column-name>\n"
+" </unique-constraint>\n"
+" </table>\n"
+" <secondary-table name=\"admin2\">\n"
+" <primary-key-join-column name=\"admin_id\"
referenced-column-"
+"name=\"id\"/>\n"
+" <unique-constraint>\n"
+"
<column-name>address</column-name>\n"
+" </unique-constraint>\n"
+" </secondary-table>\n"
+" <id-class class=\"SocialSecurityNumber\"/>\n"
+" <inheritance strategy=\"JOINED\"/>\n"
+" <sequence-generator name=\"seqhilo\"
sequence-name=\"seqhilo\"/"
+">\n"
+" <table-generator name=\"table\"
table=\"tablehilo\"/>\n"
+" ...\n"
+" </entity>\n"
+"\n"
+" <entity class=\"PostalAdministration\">\n"
+" <primary-key-join-column name=\"id\"/>\n"
+" ...\n"
+" </entity>\n"
+"</entity-mappings></programlisting> <calloutlist>
<callout arearefs="
+"\"aa1\"> <para><literal>entity-mappings</literal>:
entity-mappings is the "
+"root element for all XML files. You must declare the xml schema, the schema "
+"file is included in the hibernate-annotations.jar file, no internet access "
+"will be processed by Hibernate Annotations.</para> </callout>
<callout "
+"arearefs=\"aa2\"> <para><literal>package</literal>
(optional): default "
+"package used for all non qualified class names in the given deployment "
+"descriptor file.</para> </callout> <callout
arearefs=\"aa3\"> "
+"<para><literal>entity</literal>: desribes an entity.</para>
"
+"<para><literal>metadata-complete</literal> defines whether the
metadata "
+"description for this element is complete or not (in other words, if "
+"annotations present at the class level should be considered or not).</para>
"
+"<para>An entity has to have a <literal>class</literal> attribute
refering "
+"the java class the metadata applies on.</para> <para>You can overrides
"
+"entity name through the <literal>name</literal> attribute, if none is
"
+"defined and if an <literal>(a)Entity.name</literal> is present, then it
is "
+"used (provided that metadata complete is not set).</para> <para>For
metadata "
+"complete (see below) element, you can define an
<literal>access</literal> "
+"(either <literal>FIELD</literal> or
<literal>PROPERTY</literal> (default)). "
+"For non medatada complete element, if <literal>access</literal> is not
"
+"defined, the @Id position will lead position, if
<literal>access</literal> "
+"is defined, the value is used.</para> </callout> <callout
arearefs=\"aa4\"> "
+"<para><literal>table</literal>: you can declare table properties
(name, "
+"schema, catalog), if none is defined, the java annotation is used.</para>
"
+"<para>You can define one or several unique constraints as seen in the "
+"example</para> </callout> <callout arearefs=\"aa5\">
"
+"<para><literal>secondary-table</literal>: defines a secondary
table very "
+"much like a regular table except that you can define the primary key / "
+"foreign key column(s) through the
<literal>primary-key-join-column</literal> "
+"element. On non metadata complete, annotation secondary tables are used only
"
+"if there is no <literal>secondary-table</literal> definition,
annotations "
+"are ignored otherwise.</para> </callout> <callout
arearefs=\"aa6\"> "
+"<para><literal>id-class</literal>: defines the id class in a
similar way "
+"<literal>@IdClass</literal> does</para> </callout>
<callout arearefs=\"aa7"
+"\"> <para><literal>inheritance</literal>: defines the
inheritance strategy "
+"(<literal>JOINED</literal>,
<literal>TABLE_PER_CLASS</literal>, "
+"<literal>SINGLE_TABLE</literal>), Available only at the root entity
level</"
+"para> </callout> <callout arearefs=\"aa8\">
<para><literal>sequence-"
+"generator</literal>: defines a sequence generator</para>
</callout> <callout "
+"arearefs=\"aa9\">
<para><literal>table-generator</literal>: defines a table "
+"generator</para> </callout> <callout arearefs=\"aa10\">
"
+"<para><literal><literal>primary-key-join-column</literal></literal>:
defines "
+"the primary key join column for sub entities when JOINED inheritance "
+"strategy is used</para> </callout> </calloutlist>
</programlistingco> "
+"<programlistingco> <areaspec> <area coords=\"11 85\"
id=\"ab1\"/> <area "
+"coords=\"18 85\" id=\"ab2\"/> <area coords=\"22
85\" id=\"ab3\"/> <area "
+"coords=\"28 85\" id=\"ab4\"/> <area coords=\"34
85\" id=\"ab5\"/> </"
+"areaspec> <programlisting><?xml version=\"1.0\"
encoding=\"UTF-8\"?>\n"
+"\n"
+"<entity-mappings \n"
+"
xmlns=\"http://java.sun.com/xml/ns/persistence/orm\"\n"
+"
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
+"
xsi:schemaLocation=\"http://java.sun.com/xml/ns/persistence/orm
orm_1_0.xsd"
+"\"\n"
+" version=\"1.0\">\n"
+"\n"
+"
<package>org.hibernate.test.annotations.reflection</"
+"package>\n"
+" <entity class=\"Music\" access=\"PROPERTY\"
metadata-complete=\"true"
+"\">\n"
+"
<discriminator-value>Generic</discriminator-value>\n"
+" <discriminator-column length=\"34\"/>\n"
+" ...\n"
+" </entity>\n"
+"\n"
+" <entity class=\"PostalAdministration\">\n"
+" <primary-key-join-column name=\"id\"/>\n"
+" <named-query name=\"adminById\">\n"
+" <query>select m from Administration m where m.id =
:id</"
+"query>\n"
+" <hint name=\"org.hibernate.timeout\"
value=\"200\"/>\n"
+" </named-query>\n"
+" <named-native-query name=\"allAdmin\"
result-set-mapping=\"adminrs"
+"\">\n"
+" <query>select *, count(taxpayer_id) as taxPayerNumber
\n"
+" from Administration, TaxPayer\n"
+" where taxpayer_admin_id = admin_id group by
...</query>\n"
+" <hint name=\"org.hibernate.timeout\"
value=\"200\"/>\n"
+" </named-native-query>\n"
+" <sql-result-set-mapping name=\"adminrs\">\n"
+" <entity-result
entity-class=\"Administration\">\n"
+" <field-result name=\"name\"
column=\"fld_name\"/>\n"
+" </entity-result>\n"
+" <column-result
name=\"taxPayerNumber\"/>\n"
+" </sql-result-set-mapping>\n"
+" <attribute-override name=\"ground\">\n"
+" <column name=\"fld_ground\" unique=\"true\"
scale=\"2\"/>\n"
+" </attribute-override>\n"
+" <association-override name=\"referer\">\n"
+" <join-column name=\"referer_id\"
referenced-column-name=\"id"
+"\"/>\n"
+" </association-override>\n"
+" ...\n"
+" </entity>\n"
+"</entity-mappings></programlisting> <calloutlist>
<callout arearefs="
+"\"ab1\"> <para><literal>discriminator-value /
discriminator-column</"
+"literal>: defines the discriminator value and the column holding it when the
"
+"SINGLE_TABLE inheritance strategy is chosen</para> </callout>
<callout "
+"arearefs=\"ab2\">
<para><literal>named-query</literal>: defines named "
+"queries and possibly the hints associated to them. Those definitions are "
+"additive to the one defined in annotations, if two definitions have the same
"
+"name, the XML one has priority.</para> </callout> <callout
arearefs=\"ab3\"> "
+"<para><literal>named-native-query</literal>: defines an named
native query "
+"and its sql result set mapping. Alternatively, you can define the "
+"<literal>result-class</literal>. Those definitions are additive to the
one "
+"defined in annotations, if two definitions have the same name, the XML one "
+"has priority.</para> </callout> <callout
arearefs=\"ab4\"> "
+"<para><literal>sql-result-set-mapping</literal>: describes the
result set "
+"mapping structure. You can define both entity and column mappings. Those "
+"definitions are additive to the one defined in annotations, if two "
+"definitions have the same name, the XML one has priority</para>
</callout> "
+"<callout arearefs=\"ab5\">
<para><literal>attribute-override / association-"
+"override</literal>: defines a column or join column overriding. This "
+"overriding is additive to the one defined in annotations</para>
</callout> </"
+"calloutlist> </programlistingco>"
+msgstr ""
+
+#. Tag: para
+#: xml-overriding.xml:246
+#, no-c-format
+msgid ""
+"Same applies for <literal><embeddable></literal> and
<literal><"
+"mapped-superclass></literal>."
+msgstr ""
+
+#. Tag: title
+#: xml-overriding.xml:251
+#, no-c-format
+msgid "Property level metadata"
+msgstr ""
+
+#. Tag: para
+#: xml-overriding.xml:253
+#, no-c-format
+msgid ""
+"You can of course defines XML overriding for properties. If metadata "
+"complete is defined, then additional properties (ie at the Java level) will "
+"be ignored. Otherwise, once you start overriding a property, all annotations
"
+"on the given property are ignored. All property level metadata behave in "
+"<literal>entity/attributes</literal>,
<literal>mapped-superclass/attributes</"
+"literal> or <literal>embeddable/attributes</literal>."
+msgstr ""
+
+#. Tag: programlisting
+#: xml-overriding.xml:261
+#, no-c-format
+msgid ""
+"<attributes>\n"
+" <id name=\"id\">\n"
+" <column name=\"fld_id\"/>\n"
+" <generated-value generator=\"generator\"
strategy=\"SEQUENCE"
+"\"/>\n"
+" <temporal>DATE</temporal>\n"
+" <sequence-generator name=\"generator\"
sequence-name=\"seq\"/"
+">\n"
+" </id>\n"
+" <version name=\"version\"/>\n"
+" <embedded name=\"embeddedObject\">\n"
+" <attribute-override
name\"subproperty\">\n"
+" <column name=\"my_column\"/>\n"
+" </attribute-override>\n"
+" </embedded>\n"
+" <basic name=\"status\"
optional=\"false\">\n"
+" <enumerated>STRING</enumerated>\n"
+" </basic>\n"
+" <basic name=\"serial\"
optional=\"true\">\n"
+" <column name=\"serialbytes\"/>\n"
+" <lob/>\n"
+" </basic>\n"
+" <basic name=\"terminusTime\"
fetch=\"LAZY\">\n"
+" <temporal>TIMESTAMP</temporal>\n"
+" </basic>\n"
+" </attributes>"
+msgstr ""
+
+#. Tag: para
+#: xml-overriding.xml:263
+#, no-c-format
+msgid ""
+"You can override a property through <literal>id</literal>,
<literal>embedded-"
+"id</literal>, <literal>version</literal>,
<literal>embedded</literal> and "
+"<literal>basic</literal>. Each of these elements can have subelements
"
+"accordingly: <literal>lob</literal>,
<literal>temporal</literal>, "
+"<literal>enumerated</literal>,
<literal>column</literal>."
+msgstr ""
+
+#. Tag: title
+#: xml-overriding.xml:272
+#, no-c-format
+msgid "Association level metadata"
+msgstr ""
+
+#. Tag: para
+#: xml-overriding.xml:274
+#, no-c-format
+msgid ""
+"You can define XML overriding for associations. All association level "
+"metadata behave in <literal>entity/attributes</literal>,
<literal>mapped-"
+"superclass/attributes</literal> or
<literal>embeddable/attributes</literal>."
+msgstr ""
+
+#. Tag: programlisting
+#: xml-overriding.xml:279
+#, no-c-format
+msgid ""
+"<attributes>\n"
+" <one-to-many name=\"players\"
fetch=\"EAGER\">\n"
+" <map-key name=\"name\"/>\n"
+" <join-column name=\"driver\"/>\n"
+" <join-column name=\"number\"/>\n"
+" </one-to-many>\n"
+" <many-to-many name=\"roads\"
target-entity=\"Administration"
+"\">\n"
+" <order-by>maxSpeed</order-by>\n"
+" <join-table name=\"bus_road\">\n"
+" <join-column name=\"driver\"/>\n"
+" <join-column name=\"number\"/>\n"
+" <inverse-join-column
name=\"road_id\"/>\n"
+" <unique-constraint>\n"
+"
<column-name>driver</column-name>\n"
+"
<column-name>number</column-name>\n"
+" </unique-constraint>\n"
+" </join-table>\n"
+" </many-to-many>\n"
+" <many-to-many name=\"allTimeDrivers\"
mapped-by=\"drivenBuses"
+"\">\n"
+" </attributes>"
+msgstr ""
+
+#. Tag: para
+#: xml-overriding.xml:281
+#, no-c-format
+msgid ""
+"You can override an association through <literal>one-to-many</literal>,
"
+"<literal>one-to-one</literal>,
<literal>many-to-one</literal>, and "
+"<literal>many-to-many</literal>. Each of these elements can have
subelements "
+"accordingly: <literal>join-table</literal> (which can have
<literal>join-"
+"column</literal>s and <literal>inverse-join-column</literal>s),
"
+"<literal><literal>join-column</literal>s</literal>,
<literal>map-key</"
+"literal>, and <literal>order-by</literal>.
<literal>mapped-by</literal> and "
+"<literal>target-entity</literal> can be defined as attributes when it
makes "
+"sense. Once again the structure is reflects the annotations structure. You "
+"can find all semantic informations in the chapter describing annotations."
+msgstr ""
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/pt-BR/Author_Group.po
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/pt-BR/Author_Group.po
(rev 0)
+++ annotations/branches/v3_4_0_GA_CP/src/main/docbook/pt-BR/Author_Group.po 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,23 @@
+# translation of Author_Group.po to
+# Header entry was created by KBabel!
+#
+#. Tag: author
+#: Author_Group.xml:6
+#, no-c-format
+msgid ""
+msgstr ""
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"PO-Revision-Date: 2009-11-19 10:09+1000\n"
+"Project-Id-Version: Author_Group\n"
+"Language-Team: <en(a)li.org>\n"
+"X-Generator: KBabel 1.11.4\n"
+"MIME-Version: 1.0\n"
+"Last-Translator: \n"
+
+#. Tag: author
+#: Author_Group.xml:6
+#, no-c-format
+msgid "<firstname>Red Hat Documentation Group</firstname>
<surname></surname>"
+msgstr "<firstname>Grupo de Documentação da Red Hat</firstname>
<surname></surname>"
+
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/pt-BR/Book_Info.po
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/pt-BR/Book_Info.po
(rev 0)
+++ annotations/branches/v3_4_0_GA_CP/src/main/docbook/pt-BR/Book_Info.po 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,43 @@
+# translation of Book_Info.po to
+# Header entry was created by KBabel!
+#
+#. Tag: title
+#: Book_Info.xml:6
+#, no-c-format
+msgid ""
+msgstr ""
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"PO-Revision-Date: 2009-11-19 10:10+1000\n"
+"Project-Id-Version: Book_Info\n"
+"Language-Team: <en(a)li.org>\n"
+"X-Generator: KBabel 1.11.4\n"
+"MIME-Version: 1.0\n"
+"Last-Translator: \n"
+
+#. Tag: title
+#: Book_Info.xml:6
+#, no-c-format
+msgid "Hibernate Annotations Reference Guide"
+msgstr "Guia de Referência de Anotações Hibernate"
+
+#. Tag: subtitle
+#: Book_Info.xml:7
+#, no-c-format
+msgid "for Use with JBoss Enterprise Application Platform 5.0"
+msgstr "para Uso com a Plataforma do Aplicativo JBoss Enterprise 5.0"
+
+#. Tag: para
+#: Book_Info.xml:14
+#, no-c-format
+msgid ""
+"The JBoss Enterprise Application Platform Edition of the Hibernate "
+"Annotations Reference Guide"
+msgstr "A Edição da Plataforma do Aplicativo do JBoss Enterprise do Guia de
Referência das Anotações Hibernate"
+
+#. Tag: holder
+#: Book_Info.xml:25
+#, no-c-format
+msgid "&HOLDER;"
+msgstr "&HOLDER;"
+
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/pt-BR/Feedback.po
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/pt-BR/Feedback.po
(rev 0)
+++ annotations/branches/v3_4_0_GA_CP/src/main/docbook/pt-BR/Feedback.po 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,37 @@
+# translation of Feedback.po to
+# Header entry was created by KBabel!
+#
+#. Tag: title
+#: Feedback.xml:6
+#, no-c-format
+msgid ""
+msgstr ""
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"PO-Revision-Date: 2009-11-19 10:24+1000\n"
+"Project-Id-Version: Feedback\n"
+"Language-Team: <en(a)li.org>\n"
+"X-Generator: KBabel 1.11.4\n"
+"MIME-Version: 1.0\n"
+"Last-Translator: \n"
+
+#. Tag: title
+#: Feedback.xml:6
+#, no-c-format
+msgid "Feedback"
+msgstr "Feedback "
+
+#. Tag: para
+#: Feedback.xml:7
+#, no-c-format
+msgid ""
+"If you spot a typo in this guide, or if you have thought of a way to make "
+"this manual better, we would love to hear from you! Submit a report in "
+"<ulink
url=\"http://jira.jboss.com/jira/browse/JBPAPP\">JIRA</ul... against
"
+"the Product: JBoss Enterprise Application Platform, Version: "
+"<replaceable><version></replaceable>, Component:
<emphasis>Doc</"
+"emphasis>. If you have a suggestion for improving the documentation, try to
"
+"be as specific as possible. If you have found an error, include the section "
+"number and some of the surrounding text so we can find it easily."
+msgstr ""
+
Added:
annotations/branches/v3_4_0_GA_CP/src/main/docbook/pt-BR/Hibernate_Annotations_Reference_Guide.po
===================================================================
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/pt-BR/Preface.po
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/pt-BR/Preface.po
(rev 0)
+++ annotations/branches/v3_4_0_GA_CP/src/main/docbook/pt-BR/Preface.po 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,63 @@
+# translation of Preface.po to
+# Header entry was created by KBabel!
+#
+#. Tag: title
+#: Preface.xml:2
+#, no-c-format
+msgid ""
+msgstr ""
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Last-Translator: \n"
+"PO-Revision-Date: 2009-11-19 10:25+1000\n"
+"Project-Id-Version: Preface\n"
+"Language-Team: <en(a)li.org>\n"
+"X-Generator: KBabel 1.11.4\n"
+"MIME-Version: 1.0\n"
+
+#. Tag: title
+#: Preface.xml:2
+#, no-c-format
+msgid "Preface"
+msgstr "Prefácio "
+
+#. Tag: para
+#: Preface.xml:4
+#, no-c-format
+msgid ""
+"Hibernate, like all other object/relational mapping tools, requires metadata
"
+"that governs the transformation of data from one representation to the "
+"other. In Hibernate 2.x mapping metadata is most of the time declared in XML
"
+"text files. Alternatively XDoclet can be used utilizing Javadoc source code "
+"annotations together with a compile time preprocessor."
+msgstr "Hibernate"
+
+#. Tag: para
+#: Preface.xml:11
+#, no-c-format
+msgid ""
+"The same kind of annotation support is now available in the standard JDK, "
+"although more powerful and with better tools support. IntelliJ IDEA and "
+"Eclipse for example, support auto-completion and syntax highlighting of JDK "
+"5.0 annotations which are compiled into the bytecode and read at runtime "
+"using reflection. No external XML files are needed."
+msgstr ""
+
+#. Tag: para
+#: Preface.xml:17
+#, no-c-format
+msgid ""
+"The EJB3 specification recognizes the interest and the success of the "
+"transparent object/relational mapping paradigm. It standardizes the basic "
+"APIs and the metadata needed for any object/relational persistence "
+"mechanism. <emphasis>Hibernate EntityManager</emphasis> implements the
"
+"programming interfaces and lifecycle rules as defined by the EJB3 "
+"persistence specification and together with <emphasis>Hibernate
Annotations</"
+"emphasis> offers a complete (and standalone) EJB3 persistence solution on
"
+"top of the mature Hibernate core. You may use a combination of all three "
+"together, annotations without EJB3 programming interfaces and lifecycle, or "
+"even pure native Hibernate, depending on the business and technical needs of
"
+"your project. At all times you cann fall back to Hibernate native APIs, or "
+"if required, even to native JDBC and SQL."
+msgstr ""
+
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/pt-BR/Revision_History.po
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/pt-BR/Revision_History.po
(rev 0)
+++
annotations/branches/v3_4_0_GA_CP/src/main/docbook/pt-BR/Revision_History.po 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,37 @@
+# translation of Revision_History.po to
+# Header entry was created by KBabel!
+#
+#. Tag: title
+#: Revision_History.xml:6
+#, no-c-format
+msgid ""
+msgstr ""
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Last-Translator: \n"
+"PO-Revision-Date: 2009-11-19 10:25+1000\n"
+"Project-Id-Version: Revision_History\n"
+"Language-Team: <en(a)li.org>\n"
+"X-Generator: KBabel 1.11.4\n"
+"MIME-Version: 1.0\n"
+
+#. Tag: title
+#: Revision_History.xml:6
+#, no-c-format
+msgid "Revision History"
+msgstr ""
+
+#. Tag: author
+#: Revision_History.xml:12
+#, no-c-format
+msgid ""
+"<firstname>Laura</firstname> <surname>Bailey</surname>
<email>lbailey(a)redhat."
+"com</email>"
+msgstr ""
+
+#. Tag: member
+#: Revision_History.xml:19
+#, no-c-format
+msgid "Initial draft."
+msgstr ""
+
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/pt-BR/additionalmodules.po
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/pt-BR/additionalmodules.po
(rev 0)
+++
annotations/branches/v3_4_0_GA_CP/src/main/docbook/pt-BR/additionalmodules.po 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,202 @@
+# translation of additionalmodules.po to
+# Header entry was created by KBabel!
+#
+#. Tag: title
+#: additionalmodules.xml:28
+#, no-c-format
+msgid ""
+msgstr ""
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"PO-Revision-Date: 2009-11-19 10:08+1000\n"
+"Project-Id-Version: additionalmodules\n"
+"Language-Team: <en(a)li.org>\n"
+"X-Generator: KBabel 1.11.4\n"
+"MIME-Version: 1.0\n"
+"Last-Translator: \n"
+
+#. Tag: title
+#: additionalmodules.xml:28
+#, no-c-format
+msgid "Additional modules"
+msgstr "Módulos Adicionais"
+
+#. Tag: para
+#: additionalmodules.xml:30
+#, no-c-format
+msgid ""
+"Hibernate Annotations mainly focus on persistence metadata. The project also
"
+"have a nice integration with two Hibernate modules."
+msgstr "As Anotações baseiam-se basicamente nos metadados de persistência. O projeto
pode possuir uma boa integração com os dois módulos do Hibernate."
+
+#. Tag: title
+#: additionalmodules.xml:34
+#, no-c-format
+msgid "Hibernate Validator"
+msgstr "Validador Hibernate"
+
+#. Tag: title
+#: additionalmodules.xml:37 additionalmodules.xml:117
+#, no-c-format
+msgid "Description"
+msgstr "Descrição"
+
+#. Tag: para
+#: additionalmodules.xml:39
+#, no-c-format
+msgid ""
+"Annotations are a very convenient and elegant way to specify invariant "
+"constraints for a domain model. You can, for example, express that a "
+"property should never be null, that the account balance should be strictly "
+"positive, etc. These domain model constraints are declared in the bean "
+"itself by annotating its properties. A validator can then read them and "
+"check for constraint violations. The validation mechanism can be executed in
"
+"different layers in your application without having to duplicate any of "
+"these rules (presentation layer, data access layer). Following the DRY "
+"principle, Hibernate Validator has been designed for that purpose."
+msgstr "As anotações são uma maneira bastante conveniente e elegante para
especificar as restrições invariantes para um modelo de domÃnio. Você pode, por exemplo,
expressar que uma propriedade não deve ser nula, que uma conta deve ser estritamente
positiva, etc. Estas restrições de modelo de domÃnio são declaradas no bean por conta
própria pela anotação e suas propriedades. Um validador pode lê-las e checar por violações
da restrição. O mecanismo da validação pode ser executado nas camadas diferentes no seu
aplicativo sem necessitar duplicar quaisquer destas regras (camada de apresentação, camada
de acesso de dados). Seguindo o princÃpio DRY, o Validador Hibernate foi desenvolvido para
este propósito."
+
+#. Tag: para
+#: additionalmodules.xml:50
+#, no-c-format
+msgid ""
+"Hibernate Validator works at two levels. First, it is able to check in-"
+"memory instances of a class for constraint violations. Second, it can apply "
+"the constraints to the Hibernate metamodel and incorporate them into the "
+"generated database schema."
+msgstr "O Validador Hibernate funciona em dois nÃveis. Primeiro, ele está apto a
checar as instâncias em memória de uma classe de violações de restrição. O segundo, ele
pode aplicar as restrições ao metamodelo Hibernate e incorporá-los no esquema de banco de
dados gerado."
+
+#. Tag: para
+#: additionalmodules.xml:55
+#, no-c-format
+msgid ""
+"Each constraint annotation is associated to a validator implementation "
+"responsible for checking the constraint on the entity instance. A validator "
+"can also (optionally) apply the constraint to the Hibernate metamodel, "
+"allowing Hibernate to generate DDL that expresses the constraint. With the "
+"appropriate event listener, you can execute the checking operation on "
+"inserts and updates done by Hibernate. Hibernate Validator is not limited to
"
+"use with Hibernate. You can easily use it anywhere in your application."
+msgstr "Cada anotação de restrição é associada a uma implementação de validador
responsável por checar a restrição na instância da entidade. Um Validador pode também
(opcionalmente) aplicar a restrição ao metamodelo do Hibernate, permitindo o Hibernate
gerar DDL que expressa a restrição. Você pode executar a operação de checagem nas
inserções e atualizações realizadas pelo Hibernate, com o apropriado ouvinte do evento. O
Validador Hibernate não é limitado ao uso com Hibernate. Você pode facilmente usá-lo em
qualquer outro lugar do aplicativo."
+
+#. Tag: para
+#: additionalmodules.xml:64
+#, no-c-format
+msgid ""
+"When checking instances at runtime, Hibernate Validator returns information "
+"about constraint violations in an array of
<classname>InvalidValue</"
+"classname> s. Among other information, the
<classname>InvalidValue</"
+"classname> contains an error description message that can embed the "
+"parameter values bundle with the annotation (eg. length limit), and message "
+"strings that may be externalized to a
<classname>ResourceBundle</classname> ."
+msgstr ""
+"Quando checando instâncias no perÃodo de execução, o Validador Hibernate retorna a
informação sobre as violações de restrição em um array do
<classname>InvalidValue</"
+"classname>s. Entre outras informações, o
<classname>InvalidValue</"
+"classname> contém uma mensagem de descrição de erro que pode incorporar os
valores de parâmetro vinculados com a anotação (ex.:limite de tempo) e restrições de
mensagem que podem ser externalizadas a um
<classname>ResourceBundle</classname>."
+
+#. Tag: title
+#: additionalmodules.xml:74 additionalmodules.xml:132
+#, no-c-format
+msgid "Integration with Hibernate Annotations"
+msgstr "Integração com as Anotações Hibernate"
+
+#. Tag: para
+#: additionalmodules.xml:76
+#, no-c-format
+msgid ""
+"If Hibernate Validator (<filename>hibernate-validator.jar</filename>)
is "
+"available in the classpath, Hibernate Annotations will integrate in two
ways:"
+msgstr "Caso o Validador Hibernate
(<filename>hibernate-validator.jar</filename>) esteja disponÃvel no classpath,
as anotações Hibernate serão integradas em duas maneiras:"
+
+#. Tag: para
+#: additionalmodules.xml:82
+#, no-c-format
+msgid ""
+"Constraints will be applied to the Data Definition Language. In other words,
"
+"the database schema will reflect the constraints (provided that you use the "
+"hbm2ddl tool)."
+msgstr "As restrições serão aplicadas à Linguagem de Definição de Dados. em outras
palavras, o esquema de banco de dados refletirá as restrições (contanto que você use a
ferramenta hbm2ddl)."
+
+#. Tag: para
+#: additionalmodules.xml:88
+#, no-c-format
+msgid ""
+"Before an entity change is applied to the database (insert or update), the "
+"entity is validated. Validation errors, if any, will be carried over through
"
+"an <classname>InvalidStateException</classname>."
+msgstr "Antes de uma alteração de entidade ser aplicada ao banco de dados (inserir
ou atualizar), a entidade será validada. Os erros de validação, caso algum, serão
analisados por um <classname>InvalidStateException</classname>."
+
+#. Tag: para
+#: additionalmodules.xml:95
+#, no-c-format
+msgid "For entities free of validation rules, the runtime performance cost is
null."
+msgstr "Para entidades livres de regras de validação, o custo do desempenho do
perÃodo de execução é nulo."
+
+#. Tag: para
+#: additionalmodules.xml:98
+#, no-c-format
+msgid ""
+"To disable constraint propagation to DDL, set up <literal>hibernate."
+"validator.apply_to_ddl</literal> to false in the configuration file. Such a
"
+"need is very uncommon and not recommended."
+msgstr ""
+"Para desativar uma propagação de restrição ao DDL, ajuste o
<literal>hibernate."
+"validator.apply_to_ddl</literal> para falso no arquivo de configuração. Tal
necessidade é bastante comum e não é recomendada."
+
+#. Tag: para
+#: additionalmodules.xml:103
+#, no-c-format
+msgid ""
+"To disable pre-entity change validation, set up
<literal>hibernate.validator."
+"autoregister_listeners</literal> to false in the configuration file. Such a
"
+"need is very uncommon and not recommended."
+msgstr ""
+"Para desativar a validação de alteração de pré-entidade, ajuste o
<literal>hibernate.validator."
+"autoregister_listeners</literal> para falso no arquivo de configuração. Tal
necessidade é bastante comum e não é recomendada."
+
+#. Tag: para
+#: additionalmodules.xml:108
+#, no-c-format
+msgid "Check the Hibernate Validator reference documentation for more
information."
+msgstr "Cheque a documentação de referência do Validador Hibernate para maiores
informações."
+
+#. Tag: title
+#: additionalmodules.xml:114
+#, no-c-format
+msgid "Hibernate Search"
+msgstr "Busca Hibernate"
+
+#. Tag: para
+#: additionalmodules.xml:119
+#, no-c-format
+msgid ""
+"Full text search engines like <productname>Apache Lucene</productname>
are a "
+"very powerful technology to bring free text/efficient queries to "
+"applications. If suffers several mismatches when dealing with a object "
+"domain model (keeping the index up to date, mismatch between the index "
+"structure and the domain model, querying mismatch...) Hibernate Search "
+"indexes your domain model thanks to a few annotations, takes care of the "
+"database / index synchronization and brings you back regular managed objects
"
+"from free text queries. Hibernate Search is using <ulink
url=\"http://lucene."
+"apache.org\">Apache Lucene</ulink> under the cover."
+msgstr ""
+"Os mecanismos de busca do texto como <productname>Apache
Lucene</productname> são uma tecnologia bem potente para trazer consultas
texto/eficiente livre para aplicativos. Caso sofra muita falta de combinação quando
operando com um modelo de domÃnio do objeto (mantendo o indexe atualizado, a falta de
combinação entre a estrutura indexe e o modelo de domÃnio, a falta de combinação na
consulta...) a Busca do Hibernate indica o modelo de domÃnio graças à s poucas anotações,
cuida da sincronização do banco de dados/indexe e o traz de volta aos objetos regulares
gerenciados a partir de consultas de texto livres. A Busca do Hibernate está usando
<ulink url=\"http://lucene."
+"apache.org\">Apache Lucene</ulink> como cobertura."
+
+#. Tag: para
+#: additionalmodules.xml:134
+#, no-c-format
+msgid ""
+"Hibernate Search integrates with Hibernate Annotations transparently "
+"provided that hibernate-search.jar is present in the classpath. If you do "
+"not wish to automatically register Hibernate Search event listeners, you can
"
+"set <literal>hibernate.search.autoregister_listeners</literal> to
false. "
+"Such a need is very uncommon and not recommended."
+msgstr "A Busca Hibernate integra com as Anotações Hibernate claramente fornecidas
que o hibernate-search.jar está presente na classpath. Caso você não deseje registrar
automaticamente os ouvintes do evento de Busca Hibernate, você pode configurar o
<literal>hibernate.search.autoregister_listeners</literal> para falso. Tal
necessidade é bastante comum e não é recomendada."
+
+#. Tag: para
+#: additionalmodules.xml:141
+#, no-c-format
+msgid "Check the Hibernate Search reference documentation for more
information."
+msgstr "Veja a documentação de referência da Busca do Hibernate para maiores
informações."
+
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/pt-BR/entity.po
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/pt-BR/entity.po
(rev 0)
+++ annotations/branches/v3_4_0_GA_CP/src/main/docbook/pt-BR/entity.po 2009-12-22 06:50:19
UTC (rev 18313)
@@ -0,0 +1,6940 @@
+# translation of entity.po to
+# Header entry was created by KBabel!
+#
+#. Tag: title
+#: entity.xml:28
+#, no-c-format
+msgid ""
+msgstr ""
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"PO-Revision-Date: 2009-11-24 16:55+1000\n"
+"Project-Id-Version: entity\n"
+"Language-Team: <en(a)li.org>\n"
+"X-Generator: KBabel 1.11.4\n"
+"Last-Translator: \n"
+"MIME-Version: 1.0\n"
+
+#. Tag: title
+#: entity.xml:28
+#, no-c-format
+msgid "Entity Beans"
+msgstr "Beans de Entidade"
+
+#. Tag: title
+#: entity.xml:31
+#, no-c-format
+msgid "Intro"
+msgstr "Intro"
+
+#. Tag: para
+#: entity.xml:33
+#, no-c-format
+msgid ""
+"This section covers EJB 3.0 (aka Java Persistence) entity annotations and "
+"Hibernate-specific extensions."
+msgstr "Esta seção cobre as anotações de entidade EJB 3.0 (aka Java Persistence) e
as extensões especÃficas do Hibernate."
+
+#. Tag: title
+#: entity.xml:38
+#, no-c-format
+msgid "Mapping with EJB3/JPA Annotations"
+msgstr "Mapeamento com as Anotações EJB3/JPA"
+
+#. Tag: para
+#: entity.xml:40
+#, no-c-format
+msgid ""
+"EJB3 entities are plain POJOs. Actually they represent the exact same "
+"concept as the Hibernate persistent entities. Their mappings are defined "
+"through JDK 5.0 annotations (an XML descriptor syntax for overriding is "
+"defined in the EJB3 specification). Annotations can be split in two "
+"categories, the logical mapping annotations (allowing you to describe the "
+"object model, the class associations, etc.) and the physical mapping "
+"annotations (describing the physical schema, tables, columns, indexes, etc).
"
+"We will mix annotations from both categories in the following code examples."
+msgstr "As entidades são POJOs planos. Na realidade, elas representam exatamente o
mesmo conceito ao das entidades de persistência Hibernate. Os seus mapeamentos são
definidos através das anotações JDK 5.0 (uma sintaxe do descritor XML para substituição
está definida na especificação EJB3). As anotações podem ser divididas em duas categoria,
as anotações de mapeamento lógicas (permitindo que você descreva o modelo do objeto, as
associações da classe, etc.) e as anotações do mapeamento fÃsico (descrevendo o esquema do
mapeamento fÃsico, tabelas, colunas, indexes, etc). Nós misturaremos as anotações a partir
de ambas as categorias nas seguintes amostras de código."
+
+#. Tag: para
+#: entity.xml:50
+#, no-c-format
+msgid ""
+"EJB3 annotations are in the <literal>javax.persistence.*</literal>
package. "
+"Most JDK 5 compliant IDE (like Eclipse, IntelliJ IDEA and Netbeans) can "
+"autocomplete annotation interfaces and attributes for you (even without a "
+"specific \"EJB3\" module, since EJB3 annotations are plain JDK 5 "
+"annotations)."
+msgstr "As anotações estão no pacote
<literal>javax.persistence.*</literal>. A maioria do JDK 5 compliant IDE (como
Eclipse, IntelliJ IDEA e Netbeans) podem auto completar os atributos e interfaces da
anotação para você (mesmo sem um módulo \"EJB3\" especÃfico, uma vez que as
anotações EJB3 são anotações JDK 5 planas)."
+
+#. Tag: para
+#: entity.xml:56
+#, no-c-format
+msgid ""
+"For more and runnable concrete examples read the JBoss EJB 3.0 tutorial or "
+"review the Hibernate Annotations test suite. Most of the unit tests have "
+"been designed to represent a concrete example and be a inspiration source."
+msgstr "Para mais e concretas de execução leia o tutorial do JBoss EJB 3.0 ou revise
as Anotações Hibernate"
+
+#. Tag: title
+#: entity.xml:62
+#, no-c-format
+msgid "Declaring an entity bean"
+msgstr "Declarando um bean de entidade"
+
+#. Tag: para
+#: entity.xml:64
+#, no-c-format
+msgid ""
+"Every bound persistent POJO class is an entity bean and is declared using "
+"the <literal>@Entity</literal> annotation (at the class level):"
+msgstr "Cada classe POJO persistente vinculada é um bean de entidade e é declarada
usando uma anotação <literal>@Entity</literal> (no nÃvel da classe):"
+
+#. Tag: programlisting
+#: entity.xml:68
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Flight implements Serializable {\n"
+" Long id;\n"
+"\n"
+" @Id\n"
+" public Long getId() { return id; }\n"
+"\n"
+" public void setId(Long id) { this.id = id; }\n"
+"}"
+msgstr ""
+"@Entity\n"
+"public class Flight implements Serializable {\n"
+" Long id;\n"
+"\n"
+" @Id\n"
+" public Long getId() { return id; }\n"
+"\n"
+" public void setId(Long id) { this.id = id; }\n"
+"}"
+
+#. Tag: para
+#: entity.xml:70
+#, no-c-format
+msgid ""
+"<literal>@Entity</literal> declares the class as an entity bean (i.e. a
"
+"persistent POJO class), <literal>@Id</literal> declares the identifier
"
+"property of this entity bean. The other mapping declarations are implicit. "
+"This configuration by exception concept is central to the new EJB3 "
+"specification and a major improvement. The class Flight is mapped to the "
+"Flight table, using the column id as its primary key column."
+msgstr "A <literal>@Entity</literal> declara a classe como um bean de
entidade (ex.: uma classe POJO persistente), <literal>@Id</literal> declara a
propriedade identificadora deste bean de entidade. As outras declarações de mapeamento dão
implÃcita. Esta configuração pelo conceito de exceção é central à nova especificação EJB3
e uma maior melhoramento. A classe Flight está mapeada à nova tabela Flight, usando a
coluna id como sua própria coluna de chave primária."
+
+#. Tag: para
+#: entity.xml:78
+#, no-c-format
+msgid ""
+"Depending on whether you annotate fields or methods, the access type used by
"
+"Hibernate will be <literal>field</literal> or
<literal>property</literal>. "
+"The EJB3 spec requires that you declare annotations on the element type that
"
+"will be accessed, i.e. the getter method if you use
<literal>property</"
+"literal> access, the field if you use <literal>field</literal>
access. "
+"Mixing EJB3 annotations in both fields and methods should be avoided. "
+"Hibernate will guess the access type from the position of
<literal>@Id</"
+"literal> or <literal>(a)EmbeddedId</literal>."
+msgstr ""
+"Dependendo de você anotar ou não campos ou métodos, o tipo de acesso usado pelo
Hibernate irá ser <literal>field</literal> ou
<literal>property</literal>. O EJB3 spec requer que você declare anotações no
tipo de elemento que será acessado, ex.: o método getter caso você use o acesso
<literal>property</"
+"literal>, o campo caso você use o acesso <literal>field</literal>. A
mistura das anotações EJB3 em ambos os campos e métodos deve ser evitada. O Hibernate irá
adivinhar o tipo de acesso a partir da posição do <literal>@Id</"
+"literal> ou <literal>(a)EmbeddedId</literal>."
+
+#. Tag: title
+#: entity.xml:89
+#, no-c-format
+msgid "Defining the table"
+msgstr "Definindo a tabela"
+
+#. Tag: para
+#: entity.xml:91
+#, no-c-format
+msgid ""
+"<literal>@Table</literal> is set at the class level; it allows you to
define "
+"the table, catalog, and schema names for your entity bean mapping. If no "
+"<literal>@Table</literal> is defined the default values are used: the
"
+"unqualified class name of the entity."
+msgstr "A <literal>@Table</literal> é definida no nÃvel da classe; isto
permite que você defina a tabela, o catálogo e os nomes do esquema para o seu mapeamento
de bean de entidade. Caso nenhuma <literal>@Table</literal> seja definida, os
valores padrões serão usados: o nome da classe não-qualificada da entidade."
+
+#. Tag: programlisting
+#: entity.xml:96
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Table(name=\"tbl_sky\")\n"
+"public class Sky implements Serializable {\n"
+"..."
+msgstr ""
+"@Entity\n"
+"@Table(name=\"tbl_sky\")\n"
+"public class Sky implements Serializable {\n"
+"..."
+
+#. Tag: para
+#: entity.xml:98
+#, no-c-format
+msgid ""
+"The <literal>@Table</literal> element also contains a
<literal>schema</"
+"literal> and a <literal>catalog</literal> attributes, if they need
to be "
+"defined. You can also define unique constraints to the table using the "
+"<literal>@UniqueConstraint</literal> annotation in conjunction with
"
+"<literal>@Table</literal> (for a unique constraint bound to a single
column, "
+"refer to <literal>(a)Column</literal>)."
+msgstr ""
+"O elemento <literal>@Table</literal> também contém os atributos
<literal>schema</"
+"literal> e <literal>catalog</literal>, caso eles precisem ser
definidos. Você pode também definir as restrições únicas da tabela usando a anotação
<literal>@UniqueConstraint</literal> em conjunção com a
<literal>@Table</literal> (para uma restrição única vinculada a uma coluna
única, reefira-se à <literal>(a)Column</literal>)."
+
+#. Tag: programlisting
+#: entity.xml:105
+#, no-c-format
+msgid ""
+"@Table(name=\"tbl_sky\",\n"
+" <emphasis role=\"bold\">uniqueConstraints =
{@UniqueConstraint"
+"(columnNames={\"month\", \"day\"})}</emphasis>\n"
+")"
+msgstr ""
+"@Table(name=\"tbl_sky\",\n"
+" <emphasis role=\"bold\">uniqueConstraints =
{@UniqueConstraint"
+"(columnNames={\"month\", \"day\"})}</emphasis>\n"
+")"
+
+#. Tag: para
+#: entity.xml:107
+#, no-c-format
+msgid ""
+"A unique constraint is applied to the tuple month, day. Note that the "
+"<literal>columnNames</literal> array refers to the logical column
names."
+msgstr "A restrição única é aplicada ao mês, dia da tupla. Perceba que o
<literal>columnNames</literal> array refere aos nomes da coluna lógica."
+
+#. Tag: remark
+#: entity.xml:111
+#, no-c-format
+msgid ""
+"The logical column name is defined by the Hibernate NamingStrategy "
+"implementation. The default EJB3 naming strategy use the physical column "
+"name as the logical column name. Note that this may be different than the "
+"property name (if the column name is explicit). Unless you override the "
+"NamingStrategy, you shouldn't worry about that."
+msgstr "O nome da coluna lógica é definida pela implementação do Hibernate
NamingStrategy. A estratégia de nomeação EJB3 usa o nome da coluna fÃsica como nome da
coluna lógica. Perceba que isto pode ser diferente do nome da propriedade (caso o nome da
coluna seja explÃcito). A não ser que você substitua o NamingStrategy, você não deverá se
preocupar com isto."
+
+#. Tag: title
+#: entity.xml:120
+#, no-c-format
+msgid "Versioning for optimistic locking"
+msgstr "Aplicando a versão para o bloqueamento otimista"
+
+#. Tag: para
+#: entity.xml:122
+#, no-c-format
+msgid ""
+"You can add optimistic locking capability to an entity bean using the "
+"<literal>@Version</literal> annotation:"
+msgstr "Você pode adicionar a capacidade de bloqueamento otimista a um bean de
entidade usando a anotação <literal>@Version</literal>:"
+
+#. Tag: programlisting
+#: entity.xml:125
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Flight implements Serializable {\n"
+"...\n"
+" @Version\n"
+" @Column(name=\"OPTLOCK\")\n"
+" public Integer getVersion() { ... }\n"
+"}"
+msgstr ""
+"@Entity\n"
+"public class Flight implements Serializable {\n"
+"...\n"
+" @Version\n"
+" @Column(name=\"OPTLOCK\")\n"
+" public Integer getVersion() { ... }\n"
+"}"
+
+#. Tag: para
+#: entity.xml:127
+#, no-c-format
+msgid ""
+"The version property will be mapped to the <literal>OPTLOCK</literal>
"
+"column, and the entity manager will use it to detect conflicting updates "
+"(preventing lost updates you might otherwise see with the last-commit-wins "
+"strategy)."
+msgstr "A propriedade versão será mapeada à coluna
<literal>OPTLOCK</literal> e o gerenciador de entidade será usado para
detectar atualizações em conflito (prevenindo perdas de atualizações que você verá, de
qualquer forma, com a estratégia last-commit-wins)."
+
+#. Tag: para
+#: entity.xml:132
+#, no-c-format
+msgid ""
+"The version column may be a numeric (the recommended solution) or a "
+"timestamp as per the EJB3 spec. Hibernate support any kind of type provided "
+"that you define and implement the appropriate
<classname>UserVersionType</"
+"classname>."
+msgstr ""
+"A coluna versão pode ser um número (a solução recomendada) ou um timestamp como o
EJB3 spec. O Hibernate suporta qualquer variedade de tipo fornecido que você define e
implementa o <classname>UserVersionType</"
+"classname> apropriado."
+
+#. Tag: para
+#: entity.xml:137
+#, no-c-format
+msgid ""
+"The application must not alter the version number set up by Hibernate in any
"
+"way. To artificially increase the version number, check in Hibernate Entity "
+"Manager's reference documentation
<literal>LockMode.WRITE</literal>"
+msgstr "O aplicativo não deve alterar o número de versão determinado pelo Hibernate
de qualquer forma. Para aumentar artificialmente o número da versão, confira o
<literal>LockMode.WRITE</literal> da documentação de referência do Gerenciador
de Entidade. "
+
+#. Tag: title
+#: entity.xml:145
+#, no-c-format
+msgid "Mapping simple properties"
+msgstr "Mapeando propriedades simples"
+
+#. Tag: title
+#: entity.xml:148
+#, no-c-format
+msgid "Declaring basic property mappings"
+msgstr "Declarando os mapeamentos da propriedade básica"
+
+#. Tag: para
+#: entity.xml:150
+#, no-c-format
+msgid ""
+"Every non static non transient property (field or method) of an entity bean "
+"is considered persistent, unless you annotate it as
<literal>@Transient</"
+"literal>. Not having an annotation for your property is equivalent to the
"
+"appropriate <literal>@Basic</literal> annotation. The
<literal>@Basic</"
+"literal> annotation allows you to declare the fetching strategy for a "
+"property:"
+msgstr ""
+"Cada propriedade não transiente e não estática (campo ou método) de um bean de
entidade é considerada persistente, a não ser que você a anote como
<literal>@Transient</"
+"literal>. Não possuindo uma anotação para a sua propriedade é o mesmo que a
anotação <literal>@Basic</literal> apropriada. A anotação
<literal>@Basic</"
+"literal> permite que você declare a estratégia de busca para uma
propriedade:"
+
+#. Tag: programlisting
+#: entity.xml:157
+#, no-c-format
+msgid ""
+"public transient int counter; //transient property\n"
+"\n"
+"private String firstname; //persistent property\n"
+"\n"
+"@Transient\n"
+"String getLengthInMeter() { ... } //transient property\n"
+"\n"
+"String getName() {... } // persistent property\n"
+"\n"
+"@Basic\n"
+"int getLength() { ... } // persistent property\n"
+"\n"
+"@Basic(fetch = FetchType.LAZY)\n"
+"String getDetailedComment() { ... } // persistent property\n"
+"\n"
+"(a)Temporal(TemporalType.TIME)\n"
+"java.util.Date getDepartureTime() { ... } // persistent property
\n"
+"\n"
+"(a)Enumerated(EnumType.STRING)\n"
+"Starred getNote() { ... } //enum persisted as String in database"
+msgstr ""
+"public transient int counter; //transient property\n"
+"\n"
+"private String firstname; //persistent property\n"
+"\n"
+"@Transient\n"
+"String getLengthInMeter() { ... } //transient property\n"
+"\n"
+"String getName() {... } // persistent property\n"
+"\n"
+"@Basic\n"
+"int getLength() { ... } // persistent property\n"
+"\n"
+"@Basic(fetch = FetchType.LAZY)\n"
+"String getDetailedComment() { ... } // persistent property\n"
+"\n"
+"(a)Temporal(TemporalType.TIME)\n"
+"java.util.Date getDepartureTime() { ... } // persistent property
\n"
+"\n"
+"(a)Enumerated(EnumType.STRING)\n"
+"Starred getNote() { ... } //enum persisted as String in database"
+
+#. Tag: para
+#: entity.xml:159
+#, no-c-format
+msgid ""
+"<literal>counter</literal>, a transient field, and
<literal>lengthInMeter</"
+"literal>, a method annotated as <literal>@Transient</literal>, and
will be "
+"ignored by the entity manager. <literal>name</literal>,
<literal>length</"
+"literal>, and <literal>firstname</literal> properties are mapped
persistent "
+"and eagerly fetched (the default for simple properties). The "
+"<literal>detailedComment</literal> property value will be lazily
fetched "
+"from the database once a lazy property of the entity is accessed for the "
+"first time. Usually you don't need to lazy simple properties (not to be "
+"confused with lazy association fetching)."
+msgstr ""
+"<literal>counter</literal>, um campo transiente, e
<literal>lengthInMeter</"
+"literal>, um método anotado como <literal>@Transient</literal>, e
será ignorado pelo gerenciador de entidade. As propriedades
<literal>name</literal>, <literal>length</"
+"literal> e <literal>firstname</literal> são mapeadas
persistentemente e procuradas avidamente (o padrão para propriedades simples). O valor da
propriedade <literal>detailedComment</literal> será procurado lentamentamente
no banco de dados uma vez que a propriedade lazy (lenta) da entidade é acessada pela
primeira vez."
+
+#. Tag: para
+#: entity.xml:171
+#, no-c-format
+msgid ""
+"To enable property level lazy fetching, your classes have to be "
+"instrumented: bytecode is added to the original one to enable such feature, "
+"please refer to the Hibernate reference documentation. If your classes are "
+"not instrumented, property level lazy loading is silently ignored."
+msgstr "Para ativar a busca lenta no nÃvel da propriedade, suas classes precisam ser
instrumentadas: o bytecode é adicionado ao original para ativar tal recurso, por favor
refira-se à documentação de referência Hibernate. Caso a sua classe não seja
instrumentada, o carregamento lento no nÃvel de propriedade será silenciosamente
ignorado."
+
+#. Tag: para
+#: entity.xml:178
+#, no-c-format
+msgid ""
+"The recommended alternative is to use the projection capability of EJB-QL or
"
+"Criteria queries."
+msgstr "A alternativa recomendada é usar a capacidade de projeção das consultas
Criteria ou EJB-QL."
+
+#. Tag: para
+#: entity.xml:181
+#, no-c-format
+msgid ""
+"EJB3 support property mapping of all basic types supported by Hibernate (all
"
+"basic Java types , their respective wrappers and serializable classes). "
+"Hibernate Annotations support out of the box Enum type mapping either into a
"
+"ordinal column (saving the enum ordinal) or a string based column (saving "
+"the enum string representation): the persistence representation, defaulted "
+"to ordinal, can be overriden through the <literal>@Enumerated</literal>
"
+"annotation as shown in the <literal>note</literal> property
example."
+msgstr "O EJB3 suporta o mapeamento de todos os tipos básicos suportados pelo
Hibernate (todos os tipos java básicos, os suas respectivas classes serializadas e
empacotadores). As Anotações Hibernate suportam o mapeamento Enum fora da caixa tanto numa
coluna de número ordinal (salvando o enum ordinal) ou numa coluna de seqüência baseada
(salvando a representação da seqüência enum): a representação da persistência, padronizada
para ordinal, pode ser substituÃda através da anotação
<literal>@Enumerated</literal> conforme apresentado na amostra da propriedade
<literal>note</literal>."
+
+#. Tag: para
+#: entity.xml:190
+#, no-c-format
+msgid ""
+"In core Java APIs, the temporal precision is not defined. When dealing with "
+"temporal data you might want to describe the expected precision in database.
"
+"Temporal data can have <literal>DATE</literal>,
<literal>TIME</literal>, or "
+"<literal>TIMESTAMP</literal> precision (ie the actual date, only the
time, "
+"or both). Use the <literal>@Temporal</literal> annotation to fine tune
that."
+msgstr ""
+"No core Java APIs, a precisão temporal não está definida. Quando trabalhando com os
dados temporais, você provavelmente desejará descrever a precisão esperada no banco de
dados. Os dados temporais podem possuir a precisão <literal>DATE</literal>,
<literal>TIME</literal> ou "
+"<literal>TIMESTAMP</literal> (ex.: data atual, apenas o tempo ou
ambos). Use a anotação <literal>@Temporal</literal> para o ajuste fino."
+
+#. Tag: para
+#: entity.xml:197
+#, no-c-format
+msgid ""
+"<literal>@Lob</literal> indicates that the property should be persisted
in a "
+"Blob or a Clob depending on the property type:
<classname>java.sql.Clob</"
+"classname>, <classname>Character[]</classname>,
<classname>char[]</"
+"classname> and java.lang.<classname>String</classname> will be
persisted in "
+"a Clob. <classname>java.sql.Blob</classname>,
<classname>Byte[]</classname>, "
+"<classname>byte[] </classname>and serializable type will be persisted
in a "
+"Blob."
+msgstr ""
+"O <literal>@Lob</literal> indica que a propriedade deve ser persistida
num Blob ou Clob dependendo do tipo da propriedade:
<classname>java.sql.Clob</"
+"classname>, <classname>Character[]</classname>,
<classname>char[]</"
+"classname> e java.lang.<classname>String</classname> serão
persistidos num Clob. O <classname>java.sql.Blob</classname>,
<classname>Byte[]</classname>, "
+"<classname>byte[] </classname> e tipo serializado serão persistidos num
Blob."
+
+#. Tag: programlisting
+#: entity.xml:206
+#, no-c-format
+msgid ""
+"@Lob\n"
+"public String getFullText() {\n"
+" return fullText;\n"
+"}\n"
+"\n"
+"@Lob \n"
+"public byte[] getFullCode() {\n"
+" return fullCode;\n"
+"}"
+msgstr ""
+"@Lob\n"
+"public String getFullText() {\n"
+" return fullText;\n"
+"}\n"
+"\n"
+"@Lob \n"
+"public byte[] getFullCode() {\n"
+" return fullCode;\n"
+"}"
+
+#. Tag: para
+#: entity.xml:208
+#, no-c-format
+msgid ""
+"If the property type implements
<classname>java.io.Serializable</classname> "
+"and is not a basic type, and if the property is not annotated with "
+"<literal>@Lob</literal>, then the Hibernate
<literal>serializable</literal> "
+"type is used."
+msgstr "Caso o tipo de propriedade implementar o
<classname>java.io.Serializable</classname> e não for um tipo básico, e se a
propriedade não for anotada com <literal>@Lob</literal>, então o tipo
Hibernate <literal>serializable</literal> será usado."
+
+#. Tag: title
+#: entity.xml:216
+#, no-c-format
+msgid "Declaring column attributes"
+msgstr "Declarando os atributos da coluna"
+
+#. Tag: para
+#: entity.xml:218
+#, no-c-format
+msgid ""
+"The column(s) used for a property mapping can be defined using the "
+"<literal>@Column</literal> annotation. Use it to override default
values "
+"(see the EJB3 specification for more information on the defaults). You can "
+"use this annotation at the property level for properties that are:"
+msgstr "A(s) coluna(s) usadas para um mapeamento de propriedade pode ser definida
usando a anotação <literal>@Column</literal>. Use-a para substituir os valores
padrões (consulte a especificação EJB3 para maiores informações nos padrões). Você pode
usar esta anotação no nÃvel da propriedade para propriedades que são:"
+
+#. Tag: para
+#: entity.xml:226
+#, no-c-format
+msgid "not annotated at all"
+msgstr "não são anotadas"
+
+#. Tag: para
+#: entity.xml:230
+#, no-c-format
+msgid "annotated with <literal>@Basic</literal>"
+msgstr "anotadas com <literal>@Basic</literal>"
+
+#. Tag: para
+#: entity.xml:234
+#, no-c-format
+msgid "annotated with <literal>@Version</literal>"
+msgstr "anotadas com <literal>@Version</literal>"
+
+#. Tag: para
+#: entity.xml:238
+#, no-c-format
+msgid "annotated with <literal>@Lob</literal>"
+msgstr "anotadas com <literal>@Lob</literal>"
+
+#. Tag: para
+#: entity.xml:242
+#, no-c-format
+msgid "annotated with <literal>@Temporal</literal>"
+msgstr "anotadas com <literal>@Temporal</literal>"
+
+#. Tag: para
+#: entity.xml:246
+#, no-c-format
+msgid ""
+"annotated with
<literal>(a)org.hibernate.annotations.CollectionOfElements</"
+"literal> (for Hibernate only)"
+msgstr ""
+"anotadas com
<literal>(a)org.hibernate.annotations.CollectionOfElements</"
+"literal> (para Hibernate apenas)"
+
+#. Tag: programlisting
+#: entity.xml:252
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Flight implements Serializable {\n"
+"...\n"
+"@Column(updatable = false, name = \"flight_name\", nullable = false,
"
+"length=50)\n"
+"public String getName() { ... }"
+msgstr ""
+"@Entity\n"
+"public class Flight implements Serializable {\n"
+"...\n"
+"@Column(updatable = false, name = \"flight_name\", nullable = false,
"
+"length=50)\n"
+"public String getName() { ... }"
+
+#. Tag: para
+#: entity.xml:254
+#, no-c-format
+msgid ""
+"The <literal>name</literal> property is mapped to the
<literal>flight_name</"
+"literal> column, which is not nullable, has a length of 50 and is not "
+"updatable (making the property immutable)."
+msgstr ""
+"A propriedade <literal>name</literal> é mapeada para a coluna
<literal>flight_name</"
+"literal>, da qual não é nula, possui o comprimento de 50 e não é atualizada
(fazendo a propriedade imutável)."
+
+#. Tag: para
+#: entity.xml:259
+#, no-c-format
+msgid ""
+"This annotation can be applied to regular properties as well as "
+"<literal>@Id</literal> or <literal>@Version</literal>
properties."
+msgstr "Esta anotação pode ser aplicada a propriedades regulares assim como as
propriedades <literal>@Id</literal> ou
<literal>(a)Version</literal>."
+
+#. Tag: programlisting
+#: entity.xml:286
+#, no-c-format
+msgid ""
+"@Column(\n"
+" name=\"columnName\";\n"
+" boolean unique() default false;\n"
+" boolean nullable() default true;\n"
+" boolean insertable() default true;\n"
+" boolean updatable() default true;\n"
+" String columnDefinition() default \"\";\n"
+" String table() default \"\";\n"
+" int length() default 255;\n"
+" int precision() default 0; // decimal precision\n"
+" int scale() default 0; // decimal scale"
+msgstr ""
+"@Column(\n"
+" name=\"columnName\";\n"
+" boolean unique() default false;\n"
+" boolean nullable() default true;\n"
+" boolean insertable() default true;\n"
+" boolean updatable() default true;\n"
+" String columnDefinition() default \"\";\n"
+" String table() default \"\";\n"
+" int length() default 255;\n"
+" int precision() default 0; // decimal precision\n"
+" int scale() default 0; // decimal scale"
+
+#. Tag: para
+#: entity.xml:290
+#, no-c-format
+msgid ""
+"<literal>name</literal> (optional): the column name (default to the
property "
+"name)"
+msgstr "<literal>name</literal> (opcional): o nome da coluna (padrão
para o nome da propriedade)"
+
+#. Tag: para
+#: entity.xml:295
+#, no-c-format
+msgid ""
+"<literal>unique</literal> (optional): set a unique constraint on this
column "
+"or not (default false)"
+msgstr "<literal>unique</literal> (opcional): determina ou não uma
restrição única nesta coluna (padrão falso)"
+
+#. Tag: para
+#: entity.xml:300
+#, no-c-format
+msgid ""
+"<literal>nullable</literal> (optional): set the column as nullable
(default "
+"true)."
+msgstr "<literal>nullable</literal> (opcional): determina a coluna como
nula (padrão verdadeiro). "
+
+#. Tag: para
+#: entity.xml:305
+#, no-c-format
+msgid ""
+"<literal>insertable</literal> (optional): whether or not the column
will be "
+"part of the insert statement (default true)"
+msgstr "<literal>insertable</literal> (opcional): determina se é que ou
não a coluna fará parte da declaração inserir (padrão verdadeiro)"
+
+#. Tag: para
+#: entity.xml:311
+#, no-c-format
+msgid ""
+"<literal>updatable</literal> (optional): whether or not the column will
be "
+"part of the update statement (default true)"
+msgstr "<literal>updatable</literal> (opcional): determina se é que ou
não a coluna fará parte da declaração de atualização (padrão verdadeiro)"
+
+#. Tag: para
+#: entity.xml:317
+#, no-c-format
+msgid ""
+"<literal>columnDefinition</literal> (optional): override the sql DDL
"
+"fragment for this particular column (non portable)"
+msgstr "<literal>columnDefinition</literal> (opcional): substitui o
fragmento sql DDL para esta coluna particulae (não portátil)"
+
+#. Tag: para
+#: entity.xml:323
+#, no-c-format
+msgid ""
+"<literal>table</literal> (optional): define the targeted table (default
"
+"primary table)"
+msgstr "<literal>table</literal> (opcional): define a tabela de
destinação (padrão de tabela primária)"
+
+#. Tag: para
+#: entity.xml:328
+#, no-c-format
+msgid ""
+"<literal><literal>length</literal></literal> (optional):
column length "
+"(default 255)"
+msgstr "<literal><literal>length</literal></literal>
(opcional): comprimento de coluna (padrão 255)"
+
+#. Tag: para
+#: entity.xml:333
+#, no-c-format
+msgid ""
+"<literal><literal>precision</literal></literal> (optional):
column decimal "
+"precision (default 0)"
+msgstr "<literal><literal>precision</literal></literal>
(opcional): precisão decimal da coluna (padrão 0)"
+
+#. Tag: para
+#: entity.xml:338
+#, no-c-format
+msgid ""
+"<literal><literal>scale</literal></literal> (optional):
column decimal scale "
+"if useful (default 0)"
+msgstr "<literal><literal>scale</literal></literal>
(opcional): escala decimal da coluna caso seja útil (padrão 0)"
+
+#. Tag: title
+#: entity.xml:346
+#, no-c-format
+msgid "Embedded objects (aka components)"
+msgstr "Objetos Incorporados (componentes aka)"
+
+#. Tag: para
+#: entity.xml:348
+#, no-c-format
+msgid ""
+"It is possible to declare an embedded component inside an entity and even "
+"override its column mapping. Component classes have to be annotated at the "
+"class level with the <literal>@Embeddable</literal> annotation. It is
"
+"possible to override the column mapping of an embedded object for a "
+"particular entity using the <literal>@Embedded</literal> and "
+"<literal>@AttributeOverride</literal> annotation in the associated
property:"
+msgstr ""
+"É possÃvel declarar um componente incorporado dentro de uma entidade e ainda
substituir seu mapeamento de coluna. as classes de componente precisam ser anotadas no
nÃvel da classe com a anotação <literal>@Embeddable</literal>. É possÃvel
substituir o mapeamento da coluna de um objeto incorporado para uma entidade particular
usando a anotação <literal>@Embedded</literal> e "
+"<literal>@AttributeOverride</literal> na propriedade associada:"
+
+#. Tag: programlisting
+#: entity.xml:356
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Person implements Serializable {\n"
+"\n"
+" // Persistent component using defaults\n"
+" Address homeAddress;\n"
+"\n"
+" @Embedded\n"
+" @AttributeOverrides( {\n"
+" @AttributeOverride(name=\"iso2\", column =
@Column(name="
+"\"bornIso2\") ),\n"
+" @AttributeOverride(name=\"name\", column =
@Column(name="
+"\"bornCountryName\") )\n"
+" } )\n"
+" Country bornIn;\n"
+" ...\n"
+"}"
+msgstr ""
+"@Entity\n"
+"public class Person implements Serializable {\n"
+"\n"
+" // Persistent component using defaults\n"
+" Address homeAddress;\n"
+"\n"
+" @Embedded\n"
+" @AttributeOverrides( {\n"
+" @AttributeOverride(name=\"iso2\", column =
@Column(name="
+"\"bornIso2\") ),\n"
+" @AttributeOverride(name=\"name\", column =
@Column(name="
+"\"bornCountryName\") )\n"
+" } )\n"
+" Country bornIn;\n"
+" ...\n"
+"}"
+
+#. Tag: programlisting
+#: entity.xml:358
+#, no-c-format
+msgid ""
+"@Embeddable\n"
+"public class Address implements Serializable {\n"
+" String city;\n"
+" Country nationality; //no overriding here\n"
+"}"
+msgstr ""
+"@Embeddable\n"
+"public class Address implements Serializable {\n"
+" String city;\n"
+" Country nationality; //no overriding here\n"
+"}"
+
+#. Tag: programlisting
+#: entity.xml:360
+#, no-c-format
+msgid ""
+"@Embeddable\n"
+"public class Country implements Serializable {\n"
+" private String iso2;\n"
+" @Column(name=\"countryName\") private String name;\n"
+"\n"
+" public String getIso2() { return iso2; }\n"
+" public void setIso2(String iso2) { this.iso2 = iso2; }\n"
+"\n"
+" \n"
+" public String getName() { return name; }\n"
+" public void setName(String name) { this.name = name; }\n"
+" ...\n"
+"}"
+msgstr ""
+"@Embeddable\n"
+"public class Country implements Serializable {\n"
+" private String iso2;\n"
+" @Column(name=\"countryName\") private String name;\n"
+"\n"
+" public String getIso2() { return iso2; }\n"
+" public void setIso2(String iso2) { this.iso2 = iso2; }\n"
+"\n"
+" \n"
+" public String getName() { return name; }\n"
+" public void setName(String name) { this.name = name; }\n"
+" ...\n"
+"}"
+
+#. Tag: para
+#: entity.xml:362
+#, no-c-format
+msgid ""
+"A embeddable object inherit the access type of its owning entity (note that "
+"you can override that using the Hibernate specific
<literal>@AccessType</"
+"literal> annotations (see <xref
linkend=\"entity-hibspec\"/>)."
+msgstr ""
+"O objeto incorporado herda o tipo de acesso da própria entidade obtida (perceba que
você pode substituir isto usando as anotações <literal>@AccessType</"
+"literal> especÃficas do Hibernate (consulte <xref
linkend=\"entity-hibspec\"/>)."
+
+#. Tag: para
+#: entity.xml:367
+#, no-c-format
+msgid ""
+"The <literal>Person</literal> entity bean has two component properties,
"
+"<literal>homeAddress</literal> and
<literal>bornIn</literal>. "
+"<literal>homeAddress</literal> property has not been annotated, but
"
+"Hibernate will guess that it is a persistent component by looking for the "
+"<literal>@Embeddable</literal> annotation in the Address class. We also
"
+"override the mapping of a column name (to
<literal>bornCountryName</"
+"literal>) with the <literal>@Embedded</literal> and "
+"<literal>@AttributeOverride </literal>annotations for each mapped
attribute "
+"of <literal>Country</literal>. As you can see, <literal>Country
</literal>is "
+"also a nested component of <literal>Address</literal>, again using
auto-"
+"detection by Hibernate and EJB3 defaults. Overriding columns of embedded "
+"objects of embedded objects is currently not supported in the EJB3 spec, "
+"however, Hibernate Annotations supports it through dotted expressions."
+msgstr ""
+"O bean de entidade <literal>Person</literal> possui duas propriedades
de componente, <literal>homeAddress</literal> e
<literal>bornIn</literal>. A propriedade
<literal>homeAddress</literal> não foi anotada, mas o Hibernate tentará
adivinhar se ela é um componente persistente observando pela anotação
<literal>@Embeddable</literal> na classe Address. Nós também substituÃmos o
mapeamento de um nome de coluna (para literal>bornCountryName</"
+"literal>) com as anotações <literal>@Embedded</literal> e "
+"<literal>@AttributeOverride </literal> para cada atributo mapeado do
<literal>Country</literal>. Como você pode observar, <literal>Country
</literal> é também um componente aninhado do
<literal>Address</literal>, usando novamente auto-detecção pelos padrões EJB3
e Hibernate. As colunas substituÃdas dos objetos incorporados não está no momento
suportada no EJB3 spec. Entretanto, as Anotações Hibernate suportam isto através das
expressões com ponto."
+
+#. Tag: programlisting
+#: entity.xml:383
+#, no-c-format
+msgid ""
+"@Embedded\n"
+" @AttributeOverrides( {\n"
+" @AttributeOverride(name=\"city\", column =
@Column(name="
+"\"fld_city\") ),\n"
+" @AttributeOverride(name=\"<emphasis
role=\"bold\">nationality."
+"iso2</emphasis>\", column = @Column(name=\"nat_Iso2\")
),\n"
+" @AttributeOverride(name=\"<emphasis
role=\"bold\">nationality."
+"name</emphasis>\", column = @Column(name=\"nat_CountryName\")
)\n"
+" //nationality columns in homeAddress are overridden\n"
+" } )\n"
+" Address homeAddress;"
+msgstr ""
+"@Embedded\n"
+" @AttributeOverrides( {\n"
+" @AttributeOverride(name=\"city\", column =
@Column(name="
+"\"fld_city\") ),\n"
+" @AttributeOverride(name=\"<emphasis
role=\"bold\">nationality."
+"iso2</emphasis>\", column = @Column(name=\"nat_Iso2\")
),\n"
+" @AttributeOverride(name=\"<emphasis
role=\"bold\">nationality."
+"name</emphasis>\", column = @Column(name=\"nat_CountryName\")
)\n"
+" //nationality columns in homeAddress are overridden\n"
+" } )\n"
+" Address homeAddress;"
+
+#. Tag: para
+#: entity.xml:383
+#, no-c-format
+msgid ""
+"Hibernate Annotations supports one more feature that is not explicitly "
+"supported by the EJB3 specification. You can annotate a embedded object with
"
+"the <literal>@MappedSuperclass</literal> annotation to make the
superclass "
+"properties persistent (see <literal>@MappedSuperclass</literal> for
more "
+"informations)."
+msgstr "As Anotações Hibernate suportam um recurso a mais que não é explicitamente
suportado pela especificação EJB3. Você pode anotar um objeto incorporado com a anotação
<literal>@MappedSuperclass</literal> para fazer persistente as propriedades
superclasse (consulte <literal>@MappedSuperclass</literal> para maiores
informações)."
+
+#. Tag: para
+#: entity.xml:390
+#, no-c-format
+msgid ""
+"While not supported by the EJB3 specification, Hibernate Annotations allows "
+"you to use association annotations in an embeddable object (ie "
+"<literal>@*ToOne</literal> nor
<literal>@*ToMany</literal>). To override the "
+"association columns you can use
<literal>(a)AssociationOverride</literal>."
+msgstr "Enquanto não suportado pela especificação EJB3, as Anotações Hibernate
permitem o uso das anotações da associação em um objeto incorporado (ex.:
<literal>@*ToOne</literal> ou <literal>@*ToMany</literal>). Para
substituir as colunas de associação, você pode usar
<literal>(a)AssociationOverride</literal>."
+
+#. Tag: para
+#: entity.xml:396
+#, no-c-format
+msgid ""
+"If you want to have the same embeddable object type twice in the same "
+"entity, the column name defaulting will not work: at least one of the "
+"columns will have to be explicit. Hibernate goes beyond the EJB3 spec and "
+"allows you to enhance the defaulting mechanism through the "
+"<classname>NamingStrategy</classname>. "
+"<classname>DefaultComponentSafeNamingStrategy</classname> is a small
"
+"improvement over the default EJB3NamingStrategy that allows embedded objects
"
+"to be defaulted even if used twice in the same entity."
+msgstr "Caso você deseje possuir o mesmo objeto incorporado duplamente na mesma
entidade, o nome da coluna padronizada não funcionará: pelo menos uma das colunas terá que
ser explÃcita. O Hibernate vai além do EJB3 spec e permite que você aperfeiçoe o mecanismo
padronizado através do <classname>NamingStrategy</classname>. O
<classname>DefaultComponentSafeNamingStrategy</classname> é um pequeno
melhoramento sobre o EJB3NamingStrategy padrão que permite os objetos incorporados a serem
ainda mais padronizados, caso usados duplamente na mesma entidade."
+
+#. Tag: title
+#: entity.xml:407
+#, no-c-format
+msgid "Non-annotated property defaults"
+msgstr "Padrões de propriedades não anotadas"
+
+#. Tag: para
+#: entity.xml:409
+#, no-c-format
+msgid "If a property is not annotated, the following rules apply:"
+msgstr "Caso a propriedade não seja anotada, a seguinte regra será aplicada:"
+
+#. Tag: para
+#: entity.xml:414
+#, no-c-format
+msgid "If the property is of a single type, it is mapped as @Basic"
+msgstr "Caso a propriedade seja um tipo único, ela é mapeada como @Basic"
+
+#. Tag: para
+#: entity.xml:420
+#, no-c-format
+msgid ""
+"Otherwise, if the type of the property is annotated as @Embeddable, it is "
+"mapped as @Embedded"
+msgstr "Do contrário, caso o tipo de propriedade seja anotada como @Embeddable, ela
é mapeada como @Embedded"
+
+#. Tag: para
+#: entity.xml:426
+#, no-c-format
+msgid ""
+"Otherwise, if the type of the property is Serializable, it is mapped as "
+"@Basic in a column holding the object in its serialized version"
+msgstr "Por outro lado, caso o tipo de propriedade seja Serializada, ela será
mapeada como @Basic numa coluna mantendo o objeto em sua versão serializada"
+
+#. Tag: para
+#: entity.xml:432
+#, no-c-format
+msgid ""
+"Otherwise, if the type of the property is java.sql.Clob or java.sql.Blob, it
"
+"is mapped as @Lob with the appropriate LobType"
+msgstr "Do contrário, caso o tipo de propriedade for java.sql.Clob or java.sql.Blob,
ela será mapeada como @Lob com o LobType apropriado"
+
+#. Tag: title
+#: entity.xml:441
+#, no-c-format
+msgid "Mapping identifier properties"
+msgstr "Mapeamento de propriedades de identificadores"
+
+#. Tag: para
+#: entity.xml:443
+#, no-c-format
+msgid ""
+"The <literal>@Id</literal> annotation lets you define which property is
the "
+"identifier of your entity bean. This property can be set by the application "
+"itself or be generated by Hibernate (preferred). You can define the "
+"identifier generation strategy thanks to the
<literal>@GeneratedValue</"
+"literal> annotation:"
+msgstr ""
+"A anotação <literal>@Id</literal> nos permite definir qual propriedade
é o identificador de sua entidade bean. Esta propriedade pode ser definida pelo próprio
aplicativo ou ser gerado pelo Hibernate (preferencialmente). Você pode definir a
estratégia de geração do identificador graças à anotação
<literal>@GeneratedValue</"
+"literal>:"
+
+#. Tag: para
+#: entity.xml:451
+#, no-c-format
+msgid ""
+"AUTO - either identity column, sequence or table depending on the underlying
"
+"DB"
+msgstr "AUTO - tanto a coluna da identidade, seqüência ou tabela dependendo no DB
adjacente"
+
+#. Tag: para
+#: entity.xml:457
+#, no-c-format
+msgid "TABLE - table holding the id"
+msgstr "TABLE - tabela mantendo a id"
+
+#. Tag: para
+#: entity.xml:463
+#, no-c-format
+msgid "IDENTITY - identity column"
+msgstr "IDENTITY - coluna de identidade"
+
+#. Tag: para
+#: entity.xml:469
+#, no-c-format
+msgid "SEQUENCE - sequence"
+msgstr "SEQUENCE - seqüência "
+
+#. Tag: para
+#: entity.xml:475
+#, no-c-format
+msgid ""
+"Hibernate provides more id generators than the basic EJB3 ones. Check <xref
"
+"linkend=\"entity-hibspec\"/> for more informations."
+msgstr ""
+"O Hibernate fornece mais geradores de id do que os EJB3 básicos. Confira <xref
"
+"linkend=\"entity-hibspec\"/> para maiores informações."
+
+#. Tag: para
+#: entity.xml:478
+#, no-c-format
+msgid ""
+"The following example shows a sequence generator using the SEQ_STORE "
+"configuration (see below)"
+msgstr "A seguinte amostra apresenta o gerador da seqüência usando a configuração
SEQ_STORE (consulte abaixo)"
+
+#. Tag: programlisting
+#: entity.xml:481
+#, no-c-format
+msgid ""
+"@Id @GeneratedValue(strategy=GenerationType.SEQUENCE,
generator=\"SEQ_STORE"
+"\")\n"
+"public Integer getId() { ... }"
+msgstr ""
+"@Id @GeneratedValue(strategy=GenerationType.SEQUENCE,
generator=\"SEQ_STORE"
+"\")\n"
+"public Integer getId() { ... }"
+
+#. Tag: para
+#: entity.xml:483
+#, no-c-format
+msgid "The next example uses the identity generator:"
+msgstr "A próxima amostra usa o gerador de identidade:"
+
+#. Tag: programlisting
+#: entity.xml:485
+#, no-c-format
+msgid ""
+"@Id @GeneratedValue(strategy=GenerationType.IDENTITY)\n"
+"public Long getId() { ... }"
+msgstr ""
+"@Id @GeneratedValue(strategy=GenerationType.IDENTITY)\n"
+"public Long getId() { ... }"
+
+#. Tag: para
+#: entity.xml:487
+#, no-c-format
+msgid ""
+"The <literal>AUTO</literal> generator is the preferred type for
portable "
+"applications (across several DB vendors). The identifier generation "
+"configuration can be shared for several <literal>@Id</literal> mappings
with "
+"the generator attribute. There are several configurations available through "
+"<literal>@SequenceGenerator</literal> and
<literal>@TableGenerator</"
+"literal>. The scope of a generator can be the application or the class. "
+"Class-defined generators are not visible outside the class and can override "
+"application level generators. Application level generators are defined at "
+"XML level (see <xref linkend=\"xml-overriding\"/>):"
+msgstr ""
+"O gerador <literal>AUTO</literal> é o tipo preferido para os
aplicativos portáteis (através de diversos fornecedores DB). A configuração do gerador
identificador pode ser compartilhada por diversos mapeamentos
<literal>@Id</literal> com o atributo gerador. Existem diversas configurações
disponÃveis através do <literal>@SequenceGenerator</literal> e
<literal>@TableGenerator</"
+"literal>. O escopo de um gerador pode ser um aplicativo ou uma classe. Os
geradores de classe definida não são visÃveis fora da classe e podem ser substituÃdos
pelos geradores ao nÃvel do aplicativo. Os geradores do nÃvel do aplicativo são definidos
no nÃvel XML (consulte <xref linkend=\"xml-overriding\"/>):"
+
+#. Tag: programlisting
+#: entity.xml:499
+#, no-c-format
+msgid ""
+"<table-generator name=\"EMP_GEN\"\n"
+" table=\"GENERATOR_TABLE\"\n"
+" pk-column-name=\"key\"\n"
+" value-column-name=\"hi\"\n"
+" pk-column-value=\"EMP\"\n"
+" allocation-size=\"20\"/>\n"
+"\n"
+"//and the annotation equivalent\n"
+"\n"
+"(a)javax.persistence.TableGenerator(\n"
+" name=\"EMP_GEN\",\n"
+" table=\"GENERATOR_TABLE\",\n"
+" pkColumnName = \"key\",\n"
+" valueColumnName = \"hi\"\n"
+" pkColumnValue=\"EMP\",\n"
+" allocationSize=20\n"
+")\n"
+"\n"
+"<sequence-generator name=\"SEQ_GEN\" \n"
+" sequence-name=\"my_sequence\"\n"
+" allocation-size=\"20\"/>\n"
+"\n"
+"//and the annotation equivalent\n"
+"\n"
+"(a)javax.persistence.SequenceGenerator(\n"
+" name=\"SEQ_GEN\",\n"
+" sequenceName=\"my_sequence\",\n"
+" allocationSize=20\n"
+")"
+msgstr ""
+"<table-generator name=\"EMP_GEN\"\n"
+" table=\"GENERATOR_TABLE\"\n"
+" pk-column-name=\"key\"\n"
+" value-column-name=\"hi\"\n"
+" pk-column-value=\"EMP\"\n"
+" allocation-size=\"20\"/>\n"
+"\n"
+"//and the annotation equivalent\n"
+"\n"
+"(a)javax.persistence.TableGenerator(\n"
+" name=\"EMP_GEN\",\n"
+" table=\"GENERATOR_TABLE\",\n"
+" pkColumnName = \"key\",\n"
+" valueColumnName = \"hi\"\n"
+" pkColumnValue=\"EMP\",\n"
+" allocationSize=20\n"
+")\n"
+"\n"
+"<sequence-generator name=\"SEQ_GEN\" \n"
+" sequence-name=\"my_sequence\"\n"
+" allocation-size=\"20\"/>\n"
+"\n"
+"//and the annotation equivalent\n"
+"\n"
+"(a)javax.persistence.SequenceGenerator(\n"
+" name=\"SEQ_GEN\",\n"
+" sequenceName=\"my_sequence\",\n"
+" allocationSize=20\n"
+")"
+
+#. Tag: para
+#: entity.xml:501
+#, no-c-format
+msgid ""
+"If JPA XML (like <filename>META-INF/orm.xml</filename>) is used to
define "
+"thegenerators, <literal>EMP_GEN</literal> and
<literal>SEQ_GEN</literal> are "
+"application level generators. <literal>EMP_GEN</literal> defines a
table "
+"based id generator using the hilo algorithm with a
<literal>max_lo</literal> "
+"of 20. The hi value is kept in a <literal>table</literal> "
+"\"<literal>GENERATOR_TABLE</literal>\". The information is
kept in a row "
+"where <literal>pkColumnName</literal> \"key\" is equals to
"
+"<literal>pkColumnValue</literal>
\"<literal>EMP</literal>\" and column "
+"<literal>valueColumnName</literal>
\"<literal>hi</literal>\" contains the "
+"the next high value used."
+msgstr ""
+"Caso o JPA XML (como <filename>META-INF/orm.xml</filename>) é usado
para definir os geradores <literal>EMP_GEN</literal> e
<literal>SEQ_GEN</literal> são geradores de nÃvel de aplicativo. O
<literal>EMP_GEN</literal> define o gerador de id baseado em tabela usando o
algoritimo hilo com um <literal>max_lo</literal> de 20. O valor hi é mantido
num <literal>table</literal> "
+"\"<literal>GENERATOR_TABLE</literal>\". A informação é
mantida numa fila onde a \"chave\" <literal>pkColumnName</literal> é
igual a <literal>pkColumnValue</literal>
\"<literal>EMP</literal>\" e o
<literal>valueColumnName</literal> da coluna
\"<literal>hi</literal>\" contém o próximo valor alto usado."
+
+#. Tag: para
+#: entity.xml:512
+#, no-c-format
+msgid ""
+"<literal>SEQ_GEN</literal> defines a sequence generator using a
sequence "
+"named <literal>my_sequence</literal>. The allocation size used for this
"
+"sequence based hilo algorithm is 20. Note that this version of Hibernate "
+"Annotations does not handle <literal>initialValue</literal> in the
sequence "
+"generator. The default allocation size is 50, so if you want to use a "
+"sequence and pickup the value each time, you must set the allocation size to
"
+"1."
+msgstr "O <literal>SEQ_GEN</literal> define o gerador de seqüência
usando a seqüência nomeada <literal>my_sequence</literal>. O tamanho de
alocação usado para esta seqüência baseada no algoritmo hilo é 20. Perceba que esta versão
das Anotações Hibernate não manuseia <literal>initialValue</literal> o gerador
em seqüência. O tamanho da distribuição padrão é 50, desta forma, caso você queira usar
uma seqüência e apanhar cada vez o valor, você deverá configurar o tamanho da distribuição
para 1."
+
+#. Tag: para
+#: entity.xml:521
+#, no-c-format
+msgid ""
+"Package level definition is no longer supported by the EJB 3.0 "
+"specification. However, you can use the
<literal>@GenericGenerator</literal> "
+"at the package level (see <xref
linkend=\"entity-hibspec-identifier\"/>)."
+msgstr "A definição do nÃvel do pacote não é mais suportada pela especificação EJB
3.0. No entanto, você pode usar o <literal>@GenericGenerator</literal> no
nÃvel do pacote (consulte <xref
linkend=\"entity-hibspec-identifier\"/>)."
+
+#. Tag: para
+#: entity.xml:527
+#, no-c-format
+msgid ""
+"The next example shows the definition of a sequence generator in a class "
+"scope:"
+msgstr "A próxima amostra apresenta a definição de um gerador de seqüência num
escopo de uma classe:"
+
+#. Tag: programlisting
+#: entity.xml:530
+#, no-c-format
+msgid ""
+"@Entity\n"
+"(a)javax.persistence.SequenceGenerator(\n"
+" name=\"SEQ_STORE\",\n"
+" sequenceName=\"my_sequence\"\n"
+")\n"
+"public class Store implements Serializable {\n"
+" private Long id;\n"
+"\n"
+" @Id @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="
+"\"SEQ_STORE\")\n"
+" public Long getId() { return id; }\n"
+"}"
+msgstr ""
+"@Entity\n"
+"(a)javax.persistence.SequenceGenerator(\n"
+" name=\"SEQ_STORE\",\n"
+" sequenceName=\"my_sequence\"\n"
+")\n"
+"public class Store implements Serializable {\n"
+" private Long id;\n"
+"\n"
+" @Id @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="
+"\"SEQ_STORE\")\n"
+" public Long getId() { return id; }\n"
+"}"
+
+#. Tag: para
+#: entity.xml:532
+#, no-c-format
+msgid ""
+"This class will use a sequence named my_sequence and the SEQ_STORE generator
"
+"is not visible in other classes. Note that you can check the Hibernate "
+"Annotations tests in the
<package>org.hibernate.test.annotations.id</"
+"package> package for more examples."
+msgstr ""
+"Esta classe será usada numa seqüência nomeada my_sequence e o gerador SEQ_STORE não
é visÃvel em outra classe. Perceba que você pode checar os testes das Anotações Hibernate
no pacote <package>org.hibernate.test.annotations.id</"
+"package> para maiores informações."
+
+#. Tag: para
+#: entity.xml:538
+#, no-c-format
+msgid "You can define a composite primary key through several syntaxes:"
+msgstr "Você pode definir uma chave primária composta através das diversas sintaxes:
"
+
+#. Tag: para
+#: entity.xml:543
+#, no-c-format
+msgid ""
+"annotate the component property as @Id and make the component class "
+"@Embeddable"
+msgstr "anote a propriedade do componente como @Id e realize o @Embeddable da classe
do componente "
+
+#. Tag: para
+#: entity.xml:549
+#, no-c-format
+msgid "annotate the component property as @EmbeddedId"
+msgstr "anote a propriedade do componente como @EmbeddedId"
+
+#. Tag: para
+#: entity.xml:555
+#, no-c-format
+msgid ""
+"annotate the class as @IdClass and annotate each property of the entity "
+"involved in the primary key with @Id"
+msgstr "anote a classe como @IdClass e anote cada propriedade de entidade envolvida
na chave primária com @Id"
+
+#. Tag: para
+#: entity.xml:561
+#, no-c-format
+msgid ""
+"While quite common to the EJB2 developer, <literal>@IdClass</literal>
is "
+"likely new for Hibernate users. The composite primary key class corresponds "
+"to multiple fields or properties of the entity class, and the names of "
+"primary key fields or properties in the primary key class and those of the "
+"entity class must match and their types must be the same. Let's look at an
"
+"example:"
+msgstr "Mesmo sendo bastante comum ao desenvolvedor EJB2, o
<literal>@IdClass</literal> é praticamente novo para os usuários do Hibernate.
A classe da chave primária composta corresponde aos campos múltiplos ou propriedades de
classe de entidade, e nomes de campos de chave primária ou propriedades na classe de chave
primária e aqueles da classe de entidade deverão combinar e seus tipos deverão ser o
mesmo. Vamos observar a seguinte amostra: "
+
+#. Tag: programlisting
+#: entity.xml:568
+#, no-c-format
+msgid ""
+"@Entity\n"
+"<emphasis
role=\"bold\">(a)IdClass(FootballerPk.class)</emphasis>\n"
+"public class Footballer {\n"
+" //part of the id key\n"
+" <emphasis role=\"bold\">@Id</emphasis> public String
getFirstname() {\n"
+" return firstname;\n"
+" }\n"
+"\n"
+" public void setFirstname(String firstname) {\n"
+" this.firstname = firstname;\n"
+" }\n"
+"\n"
+" //part of the id key\n"
+" <emphasis role=\"bold\">@Id</emphasis> public String
getLastname() {\n"
+" return lastname;\n"
+" }\n"
+"\n"
+" public void setLastname(String lastname) {\n"
+" this.lastname = lastname;\n"
+" }\n"
+"\n"
+" public String getClub() {\n"
+" return club;\n"
+" }\n"
+"\n"
+" public void setClub(String club) {\n"
+" this.club = club;\n"
+" }\n"
+"\n"
+" //appropriate equals() and hashCode() implementation\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"public class FootballerPk implements Serializable {\n"
+" //same name and type as in Footballer\n"
+" public String getFirstname() {\n"
+" return firstname;\n"
+" }\n"
+"\n"
+" public void setFirstname(String firstname) {\n"
+" this.firstname = firstname;\n"
+" }\n"
+"\n"
+" //same name and type as in Footballer\n"
+" public String getLastname() {\n"
+" return lastname;\n"
+" }\n"
+"\n"
+" public void setLastname(String lastname) {\n"
+" this.lastname = lastname;\n"
+" }\n"
+"\n"
+" //appropriate equals() and hashCode() implementation\n"
+"}"
+msgstr ""
+"@Entity\n"
+"<emphasis
role=\"bold\">(a)IdClass(FootballerPk.class)</emphasis>\n"
+"public class Footballer {\n"
+" //part of the id key\n"
+" <emphasis role=\"bold\">@Id</emphasis> public String
getFirstname() {\n"
+" return firstname;\n"
+" }\n"
+"\n"
+" public void setFirstname(String firstname) {\n"
+" this.firstname = firstname;\n"
+" }\n"
+"\n"
+" //part of the id key\n"
+" <emphasis role=\"bold\">@Id</emphasis> public String
getLastname() {\n"
+" return lastname;\n"
+" }\n"
+"\n"
+" public void setLastname(String lastname) {\n"
+" this.lastname = lastname;\n"
+" }\n"
+"\n"
+" public String getClub() {\n"
+" return club;\n"
+" }\n"
+"\n"
+" public void setClub(String club) {\n"
+" this.club = club;\n"
+" }\n"
+"\n"
+" //appropriate equals() and hashCode() implementation\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"public class FootballerPk implements Serializable {\n"
+" //same name and type as in Footballer\n"
+" public String getFirstname() {\n"
+" return firstname;\n"
+" }\n"
+"\n"
+" public void setFirstname(String firstname) {\n"
+" this.firstname = firstname;\n"
+" }\n"
+"\n"
+" //same name and type as in Footballer\n"
+" public String getLastname() {\n"
+" return lastname;\n"
+" }\n"
+"\n"
+" public void setLastname(String lastname) {\n"
+" this.lastname = lastname;\n"
+" }\n"
+"\n"
+" //appropriate equals() and hashCode() implementation\n"
+"}"
+
+#. Tag: para
+#: entity.xml:570
+#, no-c-format
+msgid ""
+"As you may have seen, <literal>@IdClass</literal> points to the "
+"corresponding primary key class."
+msgstr "Conforme visto, o <literal>@IdClass</literal> aponta à classe de
chave primária correspondente:"
+
+#. Tag: para
+#: entity.xml:573
+#, no-c-format
+msgid ""
+"While not supported by the EJB3 specification, Hibernate allows you to "
+"define associations inside a composite identifier. Simply use the regular "
+"annotations for that"
+msgstr "Enquanto não suportada pela especificação EJB3, o Hibernate permite que você
defina associações dentro de um identificador composto. Simplesmente use as anotações
regulares para isto"
+
+#. Tag: programlisting
+#: entity.xml:577
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@AssociationOverride( name=\"id.channel\", joinColumns =
@JoinColumn(name="
+"\"chan_id\") )\n"
+"public class TvMagazin {\n"
+" @EmbeddedId public TvMagazinPk id;\n"
+" @Temporal(TemporalType.TIME) Date time;\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"public class TvMagazinPk implements Serializable {\n"
+" @ManyToOne\n"
+" public Channel channel;\n"
+" public String name;\n"
+" @ManyToOne\n"
+" public Presenter presenter;\n"
+"}"
+msgstr ""
+"@Entity\n"
+"@AssociationOverride( name=\"id.channel\", joinColumns =
@JoinColumn(name="
+"\"chan_id\") )\n"
+"public class TvMagazin {\n"
+" @EmbeddedId public TvMagazinPk id;\n"
+" @Temporal(TemporalType.TIME) Date time;\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"public class TvMagazinPk implements Serializable {\n"
+" @ManyToOne\n"
+" public Channel channel;\n"
+" public String name;\n"
+" @ManyToOne\n"
+" public Presenter presenter;\n"
+"}"
+
+#. Tag: title
+#: entity.xml:581
+#, no-c-format
+msgid "Mapping inheritance"
+msgstr "Herança de Mapeamento"
+
+#. Tag: para
+#: entity.xml:583
+#, no-c-format
+msgid "EJB3 supports the three types of inheritance:"
+msgstr "O EJB3 suporta os três tipos de herança:"
+
+#. Tag: para
+#: entity.xml:587
+#, no-c-format
+msgid "Table per Class Strategy: the <union-class> element in
Hibernate"
+msgstr "Tabela por Estrat+egia de Classe: o elemento <union-class> no
Hibernate"
+
+#. Tag: para
+#: entity.xml:593
+#, no-c-format
+msgid ""
+"Single Table per Class Hierarchy Strategy: the <subclass> element in
"
+"Hibernate"
+msgstr "Tabela Única por Estratégia da Hierarquia da Classe: o elemento
<subclass> no Hibernate"
+
+#. Tag: para
+#: entity.xml:599
+#, no-c-format
+msgid "Joined Subclass Strategy: the <joined-subclass> element in
Hibernate"
+msgstr "Estratégia de Subclasse de União: o elemento <joined-subclass>
do Hibernate"
+
+#. Tag: para
+#: entity.xml:604
+#, no-c-format
+msgid ""
+"The chosen strategy is declared at the class level of the top level entity "
+"in the hierarchy using the <literal>@Inheritance</literal>
annotation."
+msgstr "A estratégia escolhida é declarada no nÃvel da classe da entidade do topo do
nÃvel na herança usando a anotação <literal>(a)Inheritance</literal>."
+
+#. Tag: para
+#: entity.xml:609
+#, no-c-format
+msgid "Annotating interfaces is currently not supported."
+msgstr "Interfaces de anotação não são atualmente suportadas."
+
+#. Tag: title
+#: entity.xml:613
+#, no-c-format
+msgid "Table per class"
+msgstr "Tabela por classe"
+
+#. Tag: para
+#: entity.xml:615
+#, no-c-format
+msgid ""
+"This strategy has many drawbacks (esp. with polymorphic queries and "
+"associations) explained in the EJB3 spec, the Hibernate reference "
+"documentation, Hibernate in Action, and many other places. Hibernate work "
+"around most of them implementing this strategy using <literal>SQL
UNION</"
+"literal> queries. It is commonly used for the top level of an inheritance
"
+"hierarchy:"
+msgstr "Esta estratégia possui muitas desvantagens (principalmente as questões e
associações polimórficas) descritas no EJB3 spec, na documentação de referência do
Hibernate, no Hibernate em Ação e em muitas outras localizações. O Hibernate funciona em
torno da maioria deles implementando esta estratégia usando as consultas
<literal>SQL UNION</literal>. É comumente usado para o topo do nÃvel de uma
hierarquia herdada:"
+
+#. Tag: programlisting
+#: entity.xml:622
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)\n"
+"public class Flight implements Serializable {"
+msgstr ""
+"@Entity\n"
+"@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)\n"
+"public class Flight implements Serializable {"
+
+#. Tag: para
+#: entity.xml:624
+#, no-c-format
+msgid ""
+"This strategy support one to many associations provided that they are "
+"bidirectional. This strategy does not support the
<literal>IDENTITY</"
+"literal> generator strategy: the id has to be shared across several tables.
"
+"Consequently, when using this strategy, you should not use <literal>AUTO
</"
+"literal>nor <literal>IDENTITY</literal>."
+msgstr ""
+"Este suporte de estratégia suporta uma das muitas associações que são bidirecional.
Esta estratégia não suporta a estratégia do gerador <literal>IDENTITY</"
+"literal>: a id precisa ser compartilhada através das diversas tabelas.
Conseqüentemente, quando usando esta estratégia, você não deverá usar literal>AUTO
</"
+"literal> nem mesmo <literal>IDENTITY</literal>."
+
+#. Tag: title
+#: entity.xml:633
+#, no-c-format
+msgid "Single table per class hierarchy"
+msgstr "A tabela única por hierarquia de classe"
+
+#. Tag: para
+#: entity.xml:635
+#, no-c-format
+msgid ""
+"All properties of all super- and subclasses are mapped into the same table, "
+"instances are distinguished by a special discriminator column:"
+msgstr "Todas as propriedades de todas as subclasses e super- são mapeadas na mesma
tabela. As instâncias são distinguidas por uma coluna discriminadoras especial:"
+
+#. Tag: programlisting
+#: entity.xml:639
+#, no-c-format
+msgid ""
+"@Entity\n"
+"(a)Inheritance(strategy=InheritanceType.SINGLE_TABLE)\n"
+"@DiscriminatorColumn(\n"
+" name=\"planetype\",\n"
+" discriminatorType=DiscriminatorType.STRING\n"
+")\n"
+"@DiscriminatorValue(\"Plane\")\n"
+"public class Plane { ... }\n"
+"\n"
+"@Entity\n"
+"@DiscriminatorValue(\"A320\")\n"
+"public class A320 extends Plane { ... }"
+msgstr ""
+"@Entity\n"
+"(a)Inheritance(strategy=InheritanceType.SINGLE_TABLE)\n"
+"@DiscriminatorColumn(\n"
+" name=\"planetype\",\n"
+" discriminatorType=DiscriminatorType.STRING\n"
+")\n"
+"@DiscriminatorValue(\"Plane\")\n"
+"public class Plane { ... }\n"
+"\n"
+"@Entity\n"
+"@DiscriminatorValue(\"A320\")\n"
+"public class A320 extends Plane { ... }"
+
+#. Tag: para
+#: entity.xml:641
+#, no-c-format
+msgid ""
+"<classname>Plane</classname> is the superclass, it defines the
inheritance "
+"strategy <literal>InheritanceType.SINGLE_TABLE</literal>. It also
defines "
+"the discriminator column through the
<literal>@DiscriminatorColumn</literal> "
+"annotation, a discriminator column can also define the discriminator type. "
+"Finally, the <literal>@DiscriminatorValue</literal> annotation defines
the "
+"value used to differentiate a class in the hierarchy. All of these "
+"attributes have sensible default values. The default name of the "
+"discriminator column is <literal>DTYPE</literal>. The default
discriminator "
+"value is the entity name (as defined in
<literal>(a)Entity.name</literal>) for "
+"DiscriminatorType.STRING. <classname>A320</classname> is a subclass;
you "
+"only have to define discriminator value if you don't want to use the default
"
+"value. The strategy and the discriminator type are implicit."
+msgstr "<classname>Plane</classname> é a superclasse, ela define o
<literal>InheritanceType.SINGLE_TABLE</literal> de estratégia herdada. Isto
também define a coluna discriminadora através da anotação
<literal>@DiscriminatorColumn</literal>. A coluna discriminadora também pode
definir o tipo discriminador. Finalmente, a anotação
<literal>@DiscriminatorValue</literal> define o valor usado para diferenciar a
classe na hierarquia. Todos estes atributos possuem valores padrões concretos. O nome
padrão da coluna discriminadora é <literal>DTYPE</literal>. O valor
discriminador padrão é o nome da entidade (como definido no
<literal>(a)Entity.name</literal>) para DiscriminatorType.STRING. O
<classname>A320</classname> é uma subclasse; você apenas define o valor
discriminador caso você não queira usar o valor padrão. A estratégia e o tipo do
discriminador são implÃcitos."
+
+#. Tag: para
+#: entity.xml:656
+#, no-c-format
+msgid ""
+"<literal>@Inheritance</literal> and
<literal>@DiscriminatorColumn</literal> "
+"should only be defined at the top of the entity hierarchy."
+msgstr "<literal>@Inheritance</literal> e
<literal>@DiscriminatorColumn</literal> deve apenas ser definido no topo da
hierarquia da entidade."
+
+#. Tag: title
+#: entity.xml:662
+#, no-c-format
+msgid "Joined subclasses"
+msgstr "Subclasses unidas"
+
+#. Tag: para
+#: entity.xml:664
+#, no-c-format
+msgid ""
+"The<literal> @PrimaryKeyJoinColumn</literal> and "
+"<literal>@PrimaryKeyJoinColumns</literal> annotations define the
primary key"
+"(s) of the joined subclass table:"
+msgstr ""
+"As anotações <literal> @PrimaryKeyJoinColumn</literal> e "
+"<literal>@PrimaryKeyJoinColumns</literal> definem a(s) chave(s)
primária(s) da tabela de subclasses unidas:"
+
+#. Tag: programlisting
+#: entity.xml:668
+#, no-c-format
+msgid ""
+"@Entity\n"
+"(a)Inheritance(strategy=InheritanceType.JOINED)\n"
+"public class Boat implements Serializable { ... }\n"
+"\n"
+"@Entity\n"
+"public class Ferry extends Boat { ... }\n"
+"\n"
+"@Entity\n"
+"@PrimaryKeyJoinColumn(name=\"BOAT_ID\")\n"
+"public class AmericaCupClass extends Boat { ... }"
+msgstr ""
+"@Entity\n"
+"(a)Inheritance(strategy=InheritanceType.JOINED)\n"
+"public class Boat implements Serializable { ... }\n"
+"\n"
+"@Entity\n"
+"public class Ferry extends Boat { ... }\n"
+"\n"
+"@Entity\n"
+"@PrimaryKeyJoinColumn(name=\"BOAT_ID\")\n"
+"public class AmericaCupClass extends Boat { ... }"
+
+#. Tag: para
+#: entity.xml:670
+#, no-c-format
+msgid ""
+"All of the above entities use the <literal>JOINED</literal> strategy,
the "
+"<literal>Ferry</literal> table is joined with the
<literal>Boat</literal> "
+"table using the same primary key names. The
<literal>AmericaCupClass</"
+"literal> table is joined with <literal>Boat</literal> using the join
"
+"condition <code>Boat.id = AmericaCupClass.BOAT_ID</code>."
+msgstr ""
+"Todas as entidades acima usam a estratégia <literal>JOINED</literal>, a
tabela <literal>Ferry</literal> é unida com a tabela
<literal>Boat</literal> usando os mesmos nomes de chave primária. A tabela
<literal>AmericaCupClass</"
+"literal> é unida com o <literal>Boat</literal> usando o
<code>Boat.id = AmericaCupClass.BOAT_ID</code> da condição de união."
+
+#. Tag: title
+#: entity.xml:679
+#, no-c-format
+msgid "Inherit properties from superclasses"
+msgstr "As propriedades de herdadas a partir das superclasses"
+
+#. Tag: para
+#: entity.xml:681
+#, no-c-format
+msgid ""
+"This is sometimes useful to share common properties through a technical or a
"
+"business superclass without including it as a regular mapped entity (ie no "
+"specific table for this entity). For that purpose you can map them as "
+"<literal>(a)MappedSuperclass</literal>."
+msgstr "Às vezes, é útil compartilhar propriedades comum através de uma superclasse
comercial ou uma técnica sem incluÃ-la como uma entidade regular mapeada (ex.: nenhuma
tabela especÃfica para esta entidade). Devido a este propósito, você pode mapeá-las como
<literal>(a)MappedSuperclass</literal>."
+
+#. Tag: programlisting
+#: entity.xml:686
+#, no-c-format
+msgid ""
+"@MappedSuperclass\n"
+"public class BaseEntity {\n"
+" @Basic\n"
+" @Temporal(TemporalType.TIMESTAMP)\n"
+" public Date getLastUpdate() { ... }\n"
+" public String getLastUpdater() { ... }\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity class Order extends BaseEntity {\n"
+" @Id public Integer getId() { ... }\n"
+" ...\n"
+"}"
+msgstr ""
+"@MappedSuperclass\n"
+"public class BaseEntity {\n"
+" @Basic\n"
+" @Temporal(TemporalType.TIMESTAMP)\n"
+" public Date getLastUpdate() { ... }\n"
+" public String getLastUpdater() { ... }\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity class Order extends BaseEntity {\n"
+" @Id public Integer getId() { ... }\n"
+" ...\n"
+"}"
+
+#. Tag: para
+#: entity.xml:688
+#, no-c-format
+msgid ""
+"In database, this hierarchy will be represented as an
<literal>Order</"
+"literal> table having the <literal>id</literal>,
<literal>lastUpdate</"
+"literal> and <literal>lastUpdater</literal> columns. The embedded
superclass "
+"property mappings are copied into their entity subclasses. Remember that the
"
+"embeddable superclass is not the root of the hierarchy though."
+msgstr ""
+"No banco de dados, esta hierarquia pode ser representada como uma tabela
<literal>Order</"
+"literal> possuindo as colunas <literal>id</literal>,
<literal>lastUpdate</"
+"literal> e <literal>lastUpdater</literal>. Os mapeamentos da
propriedade superclasse incorporada são copiadas nas próprias subclasses de entidade.
Lembre-se de que a superclasse incorporada não é a raiz de uma hierarquia."
+
+#. Tag: para
+#: entity.xml:696
+#, no-c-format
+msgid ""
+"Properties from superclasses not mapped as
<literal>@MappedSuperclass</"
+"literal> are ignored."
+msgstr ""
+"Propriedades a partir das superclasses não mapeadas como
<literal>@MappedSuperclass</"
+"literal> são ignoradas."
+
+#. Tag: para
+#: entity.xml:701
+#, no-c-format
+msgid ""
+"The access type (field or methods), is inherited from the root entity, "
+"unless you use the Hibernate annotation
<literal>@AccessType</literal>"
+msgstr "O tipo de acesso (campo ou métodos), é herdado a partir da entidade raiz, a
não ser que você use o <literal>@AccessType</literal> da anotação"
+
+#. Tag: para
+#: entity.xml:707
+#, no-c-format
+msgid ""
+"The same notion can be applied to <literal>@Embeddable</literal>
objects to "
+"persist properties from their superclasses. You also need to use "
+"<literal>@MappedSuperclass</literal> to do that (this should not be
"
+"considered as a standard EJB3 feature though)"
+msgstr "A mesma noção pode ser aplicada aos objetos
<literal>@Embeddable</literal> para as propriedades persistentes a partir de
suas superclasses. Você também precisa usar
<literal>@MappedSuperclass</literal> para realizar isto (isto não deve ser
considerado como um recurso EJB3 padrão)"
+
+#. Tag: para
+#: entity.xml:715
+#, no-c-format
+msgid ""
+"It is allowed to mark a class as <literal>@MappedSuperclass</literal>
in the "
+"middle of the mapped inheritance hierarchy."
+msgstr "É permitido marcar as classes como
<literal>@MappedSuperclass</literal> no meio da hierarquia de herança
mapeada."
+
+#. Tag: para
+#: entity.xml:721
+#, no-c-format
+msgid ""
+"Any class in the hierarchy non annotated with
<literal>@MappedSuperclass</"
+"literal> nor <literal>@Entity</literal> will be ignored."
+msgstr ""
+"Qualquer classe na hierarquia não anotada com
<literal>@MappedSuperclass</"
+"literal> ou com <literal>@Entity</literal> será ignorada."
+
+#. Tag: para
+#: entity.xml:726
+#, no-c-format
+msgid ""
+"You can override columns defined in entity superclasses at the root entity "
+"level using the <literal>@AttributeOverride</literal>
annotation."
+msgstr "Você pode substituir as colunas definidas das superclasses de entidade no
nÃvel da entidade raiz usando a anotação
<literal>(a)AttributeOverride</literal>."
+
+#. Tag: programlisting
+#: entity.xml:730
+#, no-c-format
+msgid ""
+"@MappedSuperclass\n"
+"public class FlyingObject implements Serializable {\n"
+"\n"
+" public int getAltitude() {\n"
+" return altitude;\n"
+" }\n"
+"\n"
+" @Transient\n"
+" public int getMetricAltitude() {\n"
+" return metricAltitude;\n"
+" }\n"
+"\n"
+" @ManyToOne\n"
+" public PropulsionType getPropulsion() {\n"
+" return metricAltitude;\n"
+" }\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"@AttributeOverride( name=\"altitude\", column =
@Column(name=\"fld_altitude"
+"\") )\n"
+"@AssociationOverride( name=\"propulsion\", joinColumns =
@JoinColumn(name="
+"\"fld_propulsion_fk\") )\n"
+"public class Plane extends FlyingObject {\n"
+" ...\n"
+"}"
+msgstr ""
+"@MappedSuperclass\n"
+"public class FlyingObject implements Serializable {\n"
+"\n"
+" public int getAltitude() {\n"
+" return altitude;\n"
+" }\n"
+"\n"
+" @Transient\n"
+" public int getMetricAltitude() {\n"
+" return metricAltitude;\n"
+" }\n"
+"\n"
+" @ManyToOne\n"
+" public PropulsionType getPropulsion() {\n"
+" return metricAltitude;\n"
+" }\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"@AttributeOverride( name=\"altitude\", column =
@Column(name=\"fld_altitude"
+"\") )\n"
+"@AssociationOverride( name=\"propulsion\", joinColumns =
@JoinColumn(name="
+"\"fld_propulsion_fk\") )\n"
+"public class Plane extends FlyingObject {\n"
+" ...\n"
+"}"
+
+#. Tag: para
+#: entity.xml:732
+#, no-c-format
+msgid ""
+"The <literal>altitude</literal> property will be persisted in an
"
+"<literal>fld_altitude</literal> column of table
<literal>Plane</literal> and "
+"the propulsion association will be materialized in a "
+"<literal>fld_propulsion_fk</literal> foreign key column."
+msgstr "A propriedade <literal>altitude</literal> será persistida numa
coluna <literal>fld_altitude</literal> do <literal>Plane</literal>
da tabela e a associação de propulsão será materializada numa coluna de chave exterior
<literal>fld_propulsion_fk</literal>."
+
+#. Tag: para
+#: entity.xml:738
+#, no-c-format
+msgid ""
+"You can define <literal>@AttributeOverride</literal>(s) and "
+"<literal>@AssociationOverride</literal>(s) on
<literal>@Entity</literal> "
+"classes, <literal>@MappedSuperclass</literal> classes and properties
"
+"pointing to an <literal>@Embeddable</literal> object."
+msgstr ""
+"Você pode definir o(s) <literal>@AttributeOverride</literal>(s) e
"
+"<literal>@AssociationOverride</literal>(s) nas classes
<literal>@Entity</literal>, classes
<literal>@MappedSuperclass</literal> e propriedades direcionando a um objeto
<literal>(a)Embeddable</literal>."
+
+#. Tag: title
+#: entity.xml:747
+#, no-c-format
+msgid "Mapping entity bean associations/relationships"
+msgstr "Mapeamento das associações/relações de bean de entidade "
+
+#. Tag: title
+#: entity.xml:750
+#, no-c-format
+msgid "One-to-one"
+msgstr "Um-para-um"
+
+#. Tag: para
+#: entity.xml:752
+#, no-c-format
+msgid ""
+"You can associate entity beans through a one-to-one relationship using "
+"<literal>@OneToOne</literal>. There are three cases for one-to-one
"
+"associations: either the associated entities share the same primary keys "
+"values, a foreign key is held by one of the entities (note that this FK "
+"column in the database should be constrained unique to simulate one-to-one "
+"multiplicity), or a association table is used to store the link between the "
+"2 entities (a unique constraint has to be defined on each fk to ensure the "
+"one to one multiplicity)"
+msgstr "Você pode associar os beans de entidade através da relação um-para-um usando
<literal>@OneToOne</literal>. Existem três casos de associações um-para-um:
ambas as entidades associadas compartilharem os mesmos valores de chave primárias, uma
chave exterior é mantida por uma das entidades (perceba que esta coluna FK no banco de
dados deve ser compelida unicamente para simular a multiplicidade um-para-um), ou a tabela
de associação é usada para armazenar o link entre as duas entidades (a compilação única
precisa ser definida em cada fk para garantir a multiplicidade um-para-um)"
+
+#. Tag: para
+#: entity.xml:761
+#, no-c-format
+msgid "First, we map a real one-to-one association using shared primary keys:"
+msgstr "Primeiro, nós mapeamos a associação um-para-um real usando as chaves
primárias compartilhadas:"
+
+#. Tag: programlisting
+#: entity.xml:764
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Body {\n"
+" @Id\n"
+" public Long getId() { return id; }\n"
+"\n"
+" @OneToOne(cascade = CascadeType.ALL)\n"
+" @PrimaryKeyJoinColumn\n"
+" public Heart getHeart() {\n"
+" return heart;\n"
+" }\n"
+" ...\n"
+"}"
+msgstr ""
+"@Entity\n"
+"public class Body {\n"
+" @Id\n"
+" public Long getId() { return id; }\n"
+"\n"
+" @OneToOne(cascade = CascadeType.ALL)\n"
+" @PrimaryKeyJoinColumn\n"
+" public Heart getHeart() {\n"
+" return heart;\n"
+" }\n"
+" ...\n"
+"}"
+
+#. Tag: programlisting
+#: entity.xml:766
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Heart {\n"
+" @Id\n"
+" public Long getId() { ...}\n"
+"}"
+msgstr ""
+"@Entity\n"
+"public class Heart {\n"
+" @Id\n"
+" public Long getId() { ...}\n"
+"}"
+
+#. Tag: para
+#: entity.xml:768
+#, no-c-format
+msgid ""
+"The one to one is marked as true by using the "
+"<literal>@PrimaryKeyJoinColumn</literal> annotation."
+msgstr "O um-para-um é marcado com verdadeiro usando a anotação
<literal>(a)PrimaryKeyJoinColumn</literal>."
+
+#. Tag: para
+#: entity.xml:771
+#, no-c-format
+msgid ""
+"In the following example, the associated entities are linked through a "
+"foreign key column:"
+msgstr "O seguinte exemplo, as entidades associadas são ligadas através de uma
coluna de chave exterior:"
+
+#. Tag: programlisting
+#: entity.xml:774
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Customer implements Serializable {\n"
+" @OneToOne(cascade = CascadeType.ALL)\n"
+" <emphasis
role=\"bold\">@JoinColumn(name=\"passport_fk\")</emphasis>\n"
+" public Passport getPassport() {\n"
+" ...\n"
+" }\n"
+"\n"
+"@Entity\n"
+"public class Passport implements Serializable {\n"
+" @OneToOne(<emphasis role=\"bold\">mappedBy =
\"passport\"</emphasis>)\n"
+" public Customer getOwner() {\n"
+" ...\n"
+"}"
+msgstr ""
+"@Entity\n"
+"public class Customer implements Serializable {\n"
+" @OneToOne(cascade = CascadeType.ALL)\n"
+" <emphasis
role=\"bold\">@JoinColumn(name=\"passport_fk\")</emphasis>\n"
+" public Passport getPassport() {\n"
+" ...\n"
+" }\n"
+"\n"
+"@Entity\n"
+"public class Passport implements Serializable {\n"
+" @OneToOne(<emphasis role=\"bold\">mappedBy =
\"passport\"</emphasis>)\n"
+" public Customer getOwner() {\n"
+" ...\n"
+"}"
+
+#. Tag: para
+#: entity.xml:776
+#, no-c-format
+msgid ""
+"A <classname>Customer</classname> is linked to a
<classname>Passport</"
+"classname>, with a foreign key column named
<literal>passport_fk</literal> "
+"in the <literal>Customer</literal> table. The join column is declared
with "
+"the <literal>@JoinColumn</literal> annotation which looks like the
"
+"<literal>@Column</literal> annotation. It has one more parameters named
"
+"<literal>referencedColumnName</literal>. This parameter declares the
column "
+"in the targeted entity that will be used to the join. Note that when using "
+"<literal><literal>referencedColumnName</literal></literal>
to a non primary "
+"key column, the associated class has to be
<classname>Serializable</"
+"classname>. Also note that the
<literal><literal>referencedColumnName</"
+"literal></literal> to a non primary key column has to be mapped to a
"
+"property having a single column (other cases might not work)."
+msgstr ""
+"Um <classname>Customer</classname> é ligado a um
<classname>Passport</"
+"classname>, com a coluna de chave exterior nomeada
<literal>passport_fk</literal> na tabela
<literal>Customer</literal>. A coluna de união é declarada com a anotação
<literal>@JoinColumn</literal> que se parece com a anotação
<literal>@Column</literal>. Isto possui mais um
<literal>referencedColumnName</literal> de nomeação de parâmetros. Este
parâmetro declara que a coluna na entidade de destinação que será usada para a união.
Perceba que quando usando o
<literal><literal>referencedColumnName</literal></literal> para
uma coluna de chave não primária, a classe associada precisa ser
classname>Serializable</"
+"classname>. Além disso, o
<literal><literal>referencedColumnName</"
+"literal></literal> a uma coluna de chave não primária precisa ser mapeado
a uma propriedade possuindo uma coluna única (outros casos talvez não funcionem)."
+
+#. Tag: para
+#: entity.xml:792
+#, no-c-format
+msgid ""
+"The association may be bidirectional. In a bidirectional relationship, one "
+"of the sides (and only one) has to be the owner: the owner is responsible "
+"for the association column(s) update. To declare a side as
<emphasis>not</"
+"emphasis> responsible for the relationship, the attribute
<literal>mappedBy</"
+"literal> is used. <literal>mappedBy</literal> refers to the property
name of "
+"the association on the owner side. In our case, this is
<literal>passport</"
+"literal>. As you can see, you don't have to (must not) declare the join
"
+"column since it has already been declared on the owners side."
+msgstr ""
+"A associação pode ser bidirecional. Numa relação bidirecional, um dos lados (e
apenas um) precisa ser o proprietário: o proprietário é responsável pela atualização da(s)
coluna(s) de associação. Para declarar um lado como <emphasis>não</emphasis>
responsável pela relação, o <literal>mappedBy</"
+"literal> de atributo é usado. O <literal>mappedBy</literal>
refere-se ao nome da propriedade da associação do lado proprietário. No nosso caso, isto é
<literal>passport</"
+"literal>. Como você pode perceber, você não precisa (não deve) declarar a coluna
de junção, uma vez que ela já foi declarada ao lado dos proprietários."
+
+#. Tag: para
+#: entity.xml:803
+#, no-c-format
+msgid ""
+"If no <literal>@JoinColumn</literal> is declared on the owner side, the
"
+"defaults apply. A join column(s) will be created in the owner table and its "
+"name will be the concatenation of the name of the relationship in the owner "
+"side, <keycap>_</keycap> (underscore), and the name of the primary key
column"
+"(s) in the owned side. In this example <literal>passport_id</literal>
"
+"because the property name is <literal>passport</literal> and the column
id "
+"of <literal>Passport </literal>is
<literal>id</literal>."
+msgstr "Caso nenhum <literal>@JoinColumn</literal> for declarado ao lado
do proprietário, os padrões serão aplicados. A(s) coluna(s) serão criadas na tabela
proprietária e seu nome será a concatenação do nome da relação ao lado do proprietário,
<keycap>_</keycap> (sublinhado), e o nome da(s) coluna(s) de chave primária ao
lado do proprietário. Neste exemplo <literal>passport_id</literal>, uma vez
que a id de coluna do <literal>Passport </literal> é
<literal>id</literal>."
+
+#. Tag: para
+#: entity.xml:812
+#, no-c-format
+msgid "The third possibility (using an association table) is very exotic."
+msgstr "A terceira possibilidade (usando uma tabela de associação) é bastante
exótica."
+
+#. Tag: programlisting
+#: entity.xml:815
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Customer implements Serializable {\n"
+" @OneToOne(cascade = CascadeType.ALL)\n"
+" <emphasis role=\"bold\">@JoinTable(name =
\"CustomerPassports\",\n"
+" joinColumns = @JoinColumn(name=\"customer_fk\"),\n"
+" inverseJoinColumns =
@JoinColumn(name=\"passport_fk\")</emphasis>\n"
+" )\n"
+" public Passport getPassport() {\n"
+" ...\n"
+" }\n"
+"\n"
+"@Entity\n"
+"public class Passport implements Serializable {\n"
+" @OneToOne(<emphasis role=\"bold\">mappedBy =
\"passport\"</emphasis>)\n"
+" public Customer getOwner() {\n"
+" ...\n"
+"}"
+msgstr ""
+"@Entity\n"
+"public class Customer implements Serializable {\n"
+" @OneToOne(cascade = CascadeType.ALL)\n"
+" <emphasis role=\"bold\">@JoinTable(name =
\"CustomerPassports\",\n"
+" joinColumns = @JoinColumn(name=\"customer_fk\"),\n"
+" inverseJoinColumns =
@JoinColumn(name=\"passport_fk\")</emphasis>\n"
+" )\n"
+" public Passport getPassport() {\n"
+" ...\n"
+" }\n"
+"\n"
+"@Entity\n"
+"public class Passport implements Serializable {\n"
+" @OneToOne(<emphasis role=\"bold\">mappedBy =
\"passport\"</emphasis>)\n"
+" public Customer getOwner() {\n"
+" ...\n"
+"}"
+
+#. Tag: para
+#: entity.xml:817
+#, no-c-format
+msgid ""
+"A <classname>Customer</classname> is linked to a
<classname>Passport</"
+"classname> through a association table named
<literal>CustomerPassports</"
+"literal> ; this association table has a foreign key column named "
+"<literal>passport_fk</literal> pointing to the
<literal>Passport</literal> "
+"table (materialized by the <literal>inverseJoinColumn</literal>, and a
"
+"foreign key column named <literal>customer_fk</literal> pointing to the
"
+"<literal>Customer</literal> table materialized by the
<literal>joinColumns</"
+"literal> attribute."
+msgstr ""
+"Um <classname>Customer</classname> é ligado a um
<classname>Passport</"
+"classname> através de <literal>CustomerPassports</"
+"literal> de nomeação de tabela de associação; esta tabela de associação possui
<literal>passport_fk</literal> de nomeação de coluna chave apontando a uma
tabela <literal>Passport</literal> (materializada pelo
<literal>inverseJoinColumn</literal> e um
<literal>customer_fk</literal> de nomeação de coluna chave exterior apontando
a uma tabela <literal>Customer</literal> materializada pelo atributo
<literal>joinColumns</"
+"literal>."
+
+#. Tag: para
+#: entity.xml:827
+#, no-c-format
+msgid ""
+"You must declare the join table name and the join columns explicitly in such
"
+"a mapping."
+msgstr "Você deve declarar o nome da tabela de união e juntar as colunas
explicitamente em tal mapeamento."
+
+#. Tag: title
+#: entity.xml:832
+#, no-c-format
+msgid "Many-to-one"
+msgstr "Muitos-para-um"
+
+#. Tag: para
+#: entity.xml:834
+#, no-c-format
+msgid ""
+"Many-to-one associations are declared at the property level with the "
+"annotation <literal>@ManyToOne</literal>:"
+msgstr "As associações muitos-para-um são declaradas no nÃvel da propriedade com o
<literal>@ManyToOne</literal> de associação:"
+
+#. Tag: programlisting
+#: entity.xml:837
+#, no-c-format
+msgid ""
+"@Entity()\n"
+"public class Flight implements Serializable {\n"
+" <emphasis role=\"bold\">@ManyToOne</emphasis>( cascade =
{CascadeType."
+"PERSIST, CascadeType.MERGE} )\n"
+" @JoinColumn(name=\"COMP_ID\")\n"
+" public Company getCompany() {\n"
+" return company;\n"
+" }\n"
+" ...\n"
+"}"
+msgstr ""
+"@Entity()\n"
+"public class Flight implements Serializable {\n"
+" <emphasis role=\"bold\">@ManyToOne</emphasis>( cascade =
{CascadeType."
+"PERSIST, CascadeType.MERGE} )\n"
+" @JoinColumn(name=\"COMP_ID\")\n"
+" public Company getCompany() {\n"
+" return company;\n"
+" }\n"
+" ...\n"
+"}"
+
+#. Tag: para
+#: entity.xml:839
+#, no-c-format
+msgid ""
+"The <literal>@JoinColumn</literal> attribute is optional, the default
value"
+"(s) is like in one to one, the concatenation of the name of the relationship
"
+"in the owner side, <keycap>_</keycap> (underscore), and the name of the
"
+"primary key column in the owned side. In this example
<literal>company_id</"
+"literal> because the property name is <literal>company</literal> and
the "
+"column id of Company is <literal>id</literal>."
+msgstr "O atributo <literal>@JoinColumn</literal> é opcional, o(s)
valore(s) padrão(ões) parece ser um-para-um, a concatenação do nome da relação ao lado do
proprietário, <keycap>_</keycap> (sublinhado),e o nome da coluna de chave
primária ao lado do proprietário. Neste exemplo <literal>company_id</literal>,
uma vez que o nome da propriedade é <literal>company</literal> e a id da
coluna do Company é <literal>id</literal>."
+
+#. Tag: para
+#: entity.xml:847
+#, no-c-format
+msgid ""
+"<literal>@ManyToOne</literal> has a parameter named
<literal>targetEntity</"
+"literal> which describes the target entity name. You usually don't need this
"
+"parameter since the default value (the type of the property that stores the "
+"association) is good in almost all cases. However this is useful when you "
+"want to use interfaces as the return type instead of the regular entity."
+msgstr ""
+"O <literal>@ManyToOne</literal> possui o
<literal>targetEntity</"
+"literal> de nomeação de parâmetro que descreve o nome da entidade de destinação.
Normalmente, você não precisa este parâmetro desde que o valor padrão (o tipo de
propriedade que armazena a associação) é bom na maioria dos casos. No entanto, isto é útil
quando você desejar usar as interfaces como um tipo de retorno ao invés de uma entidade
regular."
+
+#. Tag: programlisting
+#: entity.xml:854
+#, no-c-format
+msgid ""
+"@Entity()\n"
+"public class Flight implements Serializable {\n"
+" @ManyToOne( cascade = {CascadeType.PERSIST, CascadeType.MERGE}, "
+"<emphasis\n"
+"
role=\"bold\">targetEntity=CompanyImpl.class</emphasis> )\n"
+" @JoinColumn(name=\"COMP_ID\")\n"
+" public Company getCompany() {\n"
+" return company;\n"
+" }\n"
+" ...\n"
+"}\n"
+"\n"
+"public interface Company {\n"
+" ..."
+msgstr ""
+"@Entity()\n"
+"public class Flight implements Serializable {\n"
+" @ManyToOne( cascade = {CascadeType.PERSIST, CascadeType.MERGE}, "
+"<emphasis\n"
+"
role=\"bold\">targetEntity=CompanyImpl.class</emphasis> )\n"
+" @JoinColumn(name=\"COMP_ID\")\n"
+" public Company getCompany() {\n"
+" return company;\n"
+" }\n"
+" ...\n"
+"}\n"
+"\n"
+"public interface Company {\n"
+" ..."
+
+#. Tag: para
+#: entity.xml:856
+#, no-c-format
+msgid ""
+"You can alse map a many to one association through an association table. "
+"This association table described by the <literal>@JoinTable</literal>
"
+"annotation will contains a foreign key referencing back the entity table "
+"(through <literal>(a)JoinTable.joinColumns</literal>) and a a foreign key
"
+"referencing the target entity table (through <literal>(a)JoinTable."
+"inverseJoinColumns</literal>)."
+msgstr ""
+"Você pode mapear também uma associação muitas-para-um através da tabela de
associação. Esta tabela de associação descrita pela associação
<literal>@JoinTable</literal> conterá uma chave exterior referenciando uma
tabela de entidade (através do <literal>(a)JoinTable.joinColumns</literal>) e
uma chave exterior referenciando uma tabela de entidade de destinação (através do
<literal>(a)JoinTable."
+"inverseJoinColumns</literal>)."
+
+#. Tag: programlisting
+#: entity.xml:864
+#, no-c-format
+msgid ""
+"@Entity()\n"
+"public class Flight implements Serializable {\n"
+" @ManyToOne( cascade = {CascadeType.PERSIST, CascadeType.MERGE} )\n"
+" <emphasis
role=\"bold\">@JoinTable(name=\"Flight_Company\",\n"
+" joinColumns = @JoinColumn(name=\"FLIGHT_ID\"),\n"
+" inverseJoinColumns = @JoinColumn(name=\"COMP_ID\")\n"
+" )</emphasis>\n"
+" public Company getCompany() {\n"
+" return company;\n"
+" }\n"
+" ...\n"
+"}"
+msgstr ""
+"@Entity()\n"
+"public class Flight implements Serializable {\n"
+" @ManyToOne( cascade = {CascadeType.PERSIST, CascadeType.MERGE} )\n"
+" <emphasis
role=\"bold\">@JoinTable(name=\"Flight_Company\",\n"
+" joinColumns = @JoinColumn(name=\"FLIGHT_ID\"),\n"
+" inverseJoinColumns = @JoinColumn(name=\"COMP_ID\")\n"
+" )</emphasis>\n"
+" public Company getCompany() {\n"
+" return company;\n"
+" }\n"
+" ...\n"
+"}"
+
+#. Tag: title
+#: entity.xml:868
+#, no-c-format
+msgid "Collections"
+msgstr "Coleções"
+
+#. Tag: title
+#: entity.xml:872
+#, no-c-format
+msgid "Overview"
+msgstr "Visão Geral"
+
+#. Tag: para
+#: entity.xml:874
+#, no-c-format
+msgid ""
+"You can map <classname>Collection</classname>,
<literal>List</literal> (ie "
+"ordered lists, not indexed lists), <literal>Map</literal> and "
+"<classname>Set</classname>. The EJB3 specification describes how to map
an "
+"ordered list (ie a list ordered at load time) using <literal>(a)javax."
+"persistence.OrderBy</literal> annotation: this annotation takes into "
+"parameter a list of comma separated (target entity) properties to order the "
+"collection by (eg <code>firstname asc, age desc</code>), if the string
is "
+"empty, the collection will be ordered by id. For true indexed collections, "
+"please refer to the <xref linkend=\"entity-hibspec\"/>. EJB3 allows
you to "
+"map Maps using as a key one of the target entity property using "
+"<literal>@MapKey(name=\"myProperty\")</literal> (myProperty
is a property "
+"name in the target entity). When using <literal>@MapKey</literal>
(without "
+"property name), the target entity primary key is used. The map key uses the "
+"same column as the property pointed out: there is no additional column "
+"defined to hold the map key, and it does make sense since the map key "
+"actually represent a target property. Be aware that once loaded, the key is "
+"no longer kept in sync with the property, in other words, if you change the "
+"property value, the key will not change automatically in your Java model "
+"(for true map support please refers to <xref
linkend=\"entity-hibspec\"/>). "
+"Many people confuse <literal><map></literal> capabilities
and "
+"<literal>@MapKey</literal> ones. These are two different features.
"
+"<literal>@MapKey</literal> still has some limitations, please check the
"
+"forum or the JIRA tracking system for more informations."
+msgstr ""
+"Você pode mapear <classname>Collection</classname>,
<literal>List</literal> (ex.: listas solicitadas, listas sem a inclusão do
Ãndex), <literal>Map</literal> e "
+"<classname>Set</classname>. A especificação EJB3 descreve como mapear
uma lista solicitada (ex.: uma lista solicitada no perÃodo de carregamento) usando a
anotação literal>(a)javax."
+"persistence.OrderBy</literal>: esta anotação leva em consideração um
parâmetro de uma lista de propriedades de vÃrgula separada (entidade de destinação) para
solicitar a coleção (ex.: <code>firstname asc, age desc</code>), caso a
seqüência estiver vazia, a coleção será solicitada pela id. Para as coleções com Ãndex
verdadeiras, por favor refira-se ao <xref linkend=\"entity-hibspec\"/>. O
EJB3 permite você mapear os Mapas usando como uma chave a propriedade de entidade de
destinação usando <literal>@MapKey(name=\"myProperty\")</literal>
(myProperty é o nome da propriedade na entidade de destinação). Quando usando
<literal>@MapKey</literal> (sem o nome da propriedade), a chave primária de
entidade de destinação será usada. A chave do mapa usa a mesma coluna com a propriedade
direcionada: não há coluna adicional definida para manter a chave do mapa e isto faz
sentido, uma vez que a chave do mapa representa a propriedade de destinação. Perceba q!
ue uma vez carregada, a chave não é mais mantida no sync da propriedade, em outras
palavras, caso você altere o valor da propriedade, a chave mão alterará automaticamente no
modelo Java (para suporte do mapa verdadeiro, por favor refira-se às capacidades <xref
linkend=\"entity-hibspec\"/>). "
+"Many people confuse <literal><map></literal> e
<literal>@MapKey</literal>. Existem dois diferentes recursos. O
<literal>@MapKey</literal> continua a ter limitações, por favor cheque o fórum
ou sistema de rastreamento JIRA para maiores informações. "
+
+#. Tag: para
+#: entity.xml:902
+#, no-c-format
+msgid "Hibernate has several notions of collections."
+msgstr "O Hibernate possui diversas noções de coleções."
+
+#. Tag: title
+#: entity.xml:907
+#, no-c-format
+msgid "Collections semantics"
+msgstr "Semânticas de coleções"
+
+#. Tag: entry
+#: entity.xml:918
+#, no-c-format
+msgid "Semantic"
+msgstr "Semântica"
+
+#. Tag: entry
+#: entity.xml:920
+#, no-c-format
+msgid "java representation"
+msgstr "representação java"
+
+#. Tag: entry
+#: entity.xml:922
+#, no-c-format
+msgid "annotations"
+msgstr "anotações"
+
+#. Tag: entry
+#: entity.xml:928
+#, no-c-format
+msgid "Bag semantic"
+msgstr "semâmtica bag"
+
+#. Tag: para
+#: entity.xml:930
+#, no-c-format
+msgid "<para>java.util.List</para>"
+msgstr "<para>java.util.List</para>"
+
+#. Tag: para
+#: entity.xml:930
+#, no-c-format
+msgid "java.util.Collection"
+msgstr "java.util.Collection"
+
+#. Tag: para
+#: entity.xml:932
+#, no-c-format
+msgid "(a)org.hibernate.annotations.CollectionOfElements"
+msgstr "(a)org.hibernate.annotations.CollectionOfElements"
+
+#. Tag: para
+#: entity.xml:932
+#, no-c-format
+msgid "or @OneToMany"
+msgstr "ou @OneToMany"
+
+#. Tag: para
+#: entity.xml:932
+#, no-c-format
+msgid "or @ManyToMany"
+msgstr "ou @ManyToMany"
+
+#. Tag: entry
+#: entity.xml:936
+#, no-c-format
+msgid "Bag semantic with primary key (withtout the limitations of Bag
semantic)"
+msgstr "Semântica bag com a chave primária (sem as limitações da semântica
Bag)"
+
+#. Tag: entry
+#: entity.xml:939
+#, no-c-format
+msgid "java.util.List, java.util.Collection"
+msgstr "java.util.List, java.util.Collection"
+
+#. Tag: entry
+#: entity.xml:941
+#, no-c-format
+msgid ""
+"((a)org.hibernate.annotations.CollectionOfElements or @OneToMany or "
+"@ManyToMany) and @CollectionId"
+msgstr ""
+"((a)org.hibernate.annotations.CollectionOfElements ou @OneToMany ou "
+"@ManyToMany) e @CollectionId"
+
+#. Tag: entry
+#: entity.xml:946
+#, no-c-format
+msgid "List semantic"
+msgstr "Lista a semântica"
+
+#. Tag: entry
+#: entity.xml:948
+#, no-c-format
+msgid "<entry>java.util.List</entry>"
+msgstr "<entry>java.util.List</entry>"
+
+#. Tag: entry
+#: entity.xml:950
+#, no-c-format
+msgid ""
+"((a)org.hibernate.annotations.CollectionOfElements or @OneToMany or "
+"@ManyToMany) and @org.hibernate.annotations.IndexColumn"
+msgstr ""
+"((a)org.hibernate.annotations.CollectionOfElements ou @OneToMany ou "
+"@ManyToMany) e @org.hibernate.annotations.IndexColumn"
+
+#. Tag: entry
+#: entity.xml:956
+#, no-c-format
+msgid "Set semantic"
+msgstr "Cofigura a semântica"
+
+#. Tag: entry
+#: entity.xml:958
+#, no-c-format
+msgid "java.util.Set"
+msgstr "java.util.Set"
+
+#. Tag: entry
+#: entity.xml:960
+#, no-c-format
+msgid "(a)org.hibernate.annotations.CollectionOfElements or @OneToMany or
@ManyToMany"
+msgstr "(a)org.hibernate.annotations.CollectionOfElements ou @OneToMany ou
@ManyToMany"
+
+#. Tag: entry
+#: entity.xml:965
+#, no-c-format
+msgid "Map semantic"
+msgstr "Mapeia a semântica"
+
+#. Tag: entry
+#: entity.xml:967
+#, no-c-format
+msgid "java.util.Map"
+msgstr "java.util.Map"
+
+#. Tag: entry
+#: entity.xml:969
+#, no-c-format
+msgid ""
+"((a)org.hibernate.annotations.CollectionOfElements or @OneToMany or "
+"@ManyToMany) and (nothing or @org.hibernate.annotations.MapKey/"
+"MapKeyManyToMany for true map support, OR @javax.persistence.MapKey"
+msgstr ""
+"((a)org.hibernate.annotations.CollectionOfElements ou @OneToMany ou "
+"@ManyToMany) e (nada ou @org.hibernate.annotations.MapKey/"
+"MapKeyManyToMany para suporte de mapa verdadeiro, OU
@javax.persistence.MapKey"
+
+#. Tag: remark
+#: entity.xml:978
+#, no-c-format
+msgid ""
+"So specifically, java.util.List collections without @org.hibernate."
+"annotations.IndexColumn are going to be considered as bags."
+msgstr ""
+"Basicamente, as coleções java.util.List sem @org.hibernate."
+"annotations.IndexColumn serão consideradas como bags."
+
+#. Tag: para
+#: entity.xml:982
+#, no-c-format
+msgid ""
+"Collection of primitive, core type or embedded objects is not supported by "
+"the EJB3 specification. Hibernate Annotations allows them however (see <xref
"
+"linkend=\"entity-hibspec\"/>)."
+msgstr ""
+"A coleção de primitivo, tipo core ou objetos incorporados não são suportados pela
especificação EJB3. No entanto, as Anotações Hibernate os permite. (consulte <xref
"
+"linkend=\"entity-hibspec\"/>)."
+
+#. Tag: programlisting
+#: entity.xml:986
+#, no-c-format
+msgid ""
+"@Entity public class City {\n"
+" @OneToMany(mappedBy=\"city\")\n"
+" <emphasis
role=\"bold\">@OrderBy(\"streetName\")</emphasis>\n"
+" public List<Street> getStreets() {\n"
+" return streets;\n"
+" }\n"
+"...\n"
+"}\n"
+"\n"
+"@Entity public class Street {\n"
+" <emphasis role=\"bold\">public String
getStreetName()</emphasis> {\n"
+" return streetName;\n"
+" }\n"
+"\n"
+" @ManyToOne\n"
+" public City getCity() {\n"
+" return city;\n"
+" }\n"
+" ...\n"
+"}\n"
+"\n"
+"\n"
+"@Entity\n"
+"public class Software {\n"
+" @OneToMany(mappedBy=\"software\")\n"
+" <emphasis
role=\"bold\">@MapKey(name=\"codeName\")</emphasis>\n"
+" public Map<String, Version> getVersions() {\n"
+" return versions;\n"
+" }\n"
+"...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"@Table(name=\"tbl_version\")\n"
+"public class Version {\n"
+" <emphasis role=\"bold\">public String
getCodeName()</emphasis> {...}\n"
+"\n"
+" @ManyToOne\n"
+" public Software getSoftware() { ... }\n"
+"...\n"
+"}"
+msgstr ""
+"@Entity public class City {\n"
+" @OneToMany(mappedBy=\"city\")\n"
+" <emphasis
role=\"bold\">@OrderBy(\"streetName\")</emphasis>\n"
+" public List<Street> getStreets() {\n"
+" return streets;\n"
+" }\n"
+"...\n"
+"}\n"
+"\n"
+"@Entity public class Street {\n"
+" <emphasis role=\"bold\">public String
getStreetName()</emphasis> {\n"
+" return streetName;\n"
+" }\n"
+"\n"
+" @ManyToOne\n"
+" public City getCity() {\n"
+" return city;\n"
+" }\n"
+" ...\n"
+"}\n"
+"\n"
+"\n"
+"@Entity\n"
+"public class Software {\n"
+" @OneToMany(mappedBy=\"software\")\n"
+" <emphasis
role=\"bold\">@MapKey(name=\"codeName\")</emphasis>\n"
+" public Map<String, Version> getVersions() {\n"
+" return versions;\n"
+" }\n"
+"...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"@Table(name=\"tbl_version\")\n"
+"public class Version {\n"
+" <emphasis role=\"bold\">public String
getCodeName()</emphasis> {...}\n"
+"\n"
+" @ManyToOne\n"
+" public Software getSoftware() { ... }\n"
+"...\n"
+"}"
+
+#. Tag: para
+#: entity.xml:988
+#, no-c-format
+msgid ""
+"So <literal>City</literal> has a collection of
<literal>Street</literal>s "
+"that are ordered by <literal>streetName</literal> (of
<literal>Street</"
+"literal>) when the collection is loaded. <literal>Software</literal>
has a "
+"map of <literal>Version</literal>s which key is the
<literal>Version</"
+"literal> <literal>codeName</literal>."
+msgstr ""
+"Desta forma, o <literal>City</literal> possui uma coleção de
<literal>Street</literal>s que são solicitados pelo
<literal>streetName</literal> (do literal>Street</"
+"literal>) quando a coleção for carregada. O
<literal>Software</literal> possui um mapa de
<literal>Version</literal>s do qual a chave é um
<literal>Version</"
+"literal> <literal>codeName</literal>."
+
+#. Tag: para
+#: entity.xml:995
+#, no-c-format
+msgid ""
+"Unless the collection is a generic, you will have to define "
+"<literal>targetEntity</literal>. This is a annotation attribute that
take "
+"the target entity class as a value."
+msgstr "A não ser que a coleção seja genérica, você terá que definir um
<literal>targetEntity</literal>. Este é um atributo de anotação que leva uma
classe de entidade de destinação como um valor."
+
+#. Tag: title
+#: entity.xml:1002
+#, no-c-format
+msgid "One-to-many"
+msgstr "Um-para-muitos"
+
+#. Tag: para
+#: entity.xml:1004
+#, no-c-format
+msgid ""
+"One-to-many associations are declared at the property level with the "
+"annotation <literal>@OneToMany</literal>. One to many associations may
be "
+"bidirectional."
+msgstr "As associações um-para-muitos são declaradas no nÃvel da propriedade com o
<literal>@OneToMany</literal> de anotação. As associações um-para-muitos podem
ser bidirecionais."
+
+#. Tag: sect4
+#: entity.xml:1006
+#, no-c-format
+msgid ""
+"<sect5> <title>Bidirectional</title> <para>Since many to
one are (almost) "
+"always the owner side of a bidirectional relationship in the EJB3 spec, the "
+"one to many association is annotated by <literal>@OneToMany( mappedBy=...
)</"
+"literal></para> <programlisting>@Entity\n"
+"public class Troop {\n"
+" @OneToMany(mappedBy=\"troop\")\n"
+" public Set<Soldier> getSoldiers() {\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Soldier {\n"
+" @ManyToOne\n"
+" @JoinColumn(name=\"troop_fk\")\n"
+" public Troop getTroop() {\n"
+" ...\n"
+"} </programlisting>
<para><classname>Troop</classname> has a "
+"bidirectional one to many relationship with <literal>Soldier</literal>
"
+"through the <literal>troop</literal> property. You don't have to
(must not) "
+"define any physical mapping in the <literal>mappedBy</literal>
side.</para> "
+"<para>To map a bidirectional one to many, with the one-to-many side as the
"
+"owning side, you have to remove the <literal>mappedBy</literal> element
and "
+"set the many to one <literal>@JoinColumn</literal> as insertable and
"
+"updatable to false. This solution is obviously not optimized and will "
+"produce some additional UPDATE statements.</para>
<programlisting>@Entity\n"
+"public class Troop {\n"
+" @OneToMany\n"
+" @JoinColumn(name=\"troop_fk\") //we need to duplicate the physical
"
+"information\n"
+" public Set<Soldier> getSoldiers() {\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Soldier {\n"
+" @ManyToOne\n"
+" @JoinColumn(name=\"troop_fk\", insertable=false,
updatable=false)\n"
+" public Troop getTroop() {\n"
+" ...\n"
+"}</programlisting> </sect5> <sect5>
<title>Unidirectional</title> <para>A "
+"unidirectional one to many using a foreign key column in the owned entity is
"
+"not that common and not really recommended. We strongly advise you to use a "
+"join table for this kind of association (as explained in the next section). "
+"This kind of association is described through a
<literal>@JoinColumn</"
+"literal></para> <programlisting>\n"
+"@Entity\n"
+"public class Customer implements Serializable {\n"
+" @OneToMany(cascade=CascadeType.ALL, fetch=FetchType.EAGER)\n"
+" @JoinColumn(name=\"CUST_ID\")\n"
+" public Set<Ticket> getTickets() {\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Ticket implements Serializable {\n"
+" ... //no bidir\n"
+"}\n"
+" </programlisting>
<para><literal>Customer</literal> describes "
+"a unidirectional relationship with <literal>Ticket</literal> using the
join "
+"column <literal>CUST_ID</literal>.</para> </sect5>
<sect5> "
+"<title>Unidirectional with join table</title> <para>A
unidirectional one to "
+"many with join table is much preferred. This association is described "
+"through an <literal>(a)JoinTable</literal>.</para>
<programlisting>\n"
+"@Entity\n"
+"public class Trainer {\n"
+" @OneToMany\n"
+" @JoinTable(\n"
+" name=\"TrainedMonkeys\",\n"
+" joinColumns = @JoinColumn( name=\"trainer_id\"),\n"
+" inverseJoinColumns = @JoinColumn(
name=\"monkey_id\")\n"
+" )\n"
+" public Set<Monkey> getTrainedMonkeys() {\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Monkey {\n"
+" ... //no bidir\n"
+"}\n"
+" </programlisting>
<para><literal>Trainer</literal> describes "
+"a unidirectional relationship with <classname>Monkey</classname> using
the "
+"join table <classname>TrainedMonkeys</classname>, with a foreign key
"
+"<literal>trainer_id</literal> to <literal>Trainer</literal>
"
+"(<literal>joinColumns</literal>) and a foreign key
<literal>monkey_id</"
+"literal> to <literal>Monkey</literal>
(<literal>inversejoinColumns</"
+"literal>).</para> </sect5> <sect5
id=\"entity-mapping-association-collection-"
+"manytomany-default\" revision=\"1\">
<title>Defaults</title> <para>Without "
+"describing any physical mapping, a unidirectional one to many with join "
+"table is used. The table name is the concatenation of the owner table name, "
+"<keycap>_</keycap>, and the other side table name. The foreign key
name(s) "
+"referencing the owner table is the concatenation of the owner table, "
+"<keycap>_</keycap>, and the owner primary key column(s) name. The
foreign "
+"key name(s) referencing the other side is the concatenation of the owner "
+"property name, <keycap>_</keycap>, and the other side primary key
column(s) "
+"name. A unique constraint is added to the foreign key referencing the other "
+"side table to reflect the one to many.</para> <programlisting>\n"
+"@Entity\n"
+"public class Trainer {\n"
+" @OneToMany\n"
+" public Set<Tiger> getTrainedTigers() {\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Tiger {\n"
+" ... //no bidir\n"
+"}\n"
+" </programlisting>
<para><classname>Trainer</classname> "
+"describes a unidirectional relationship with
<classname>Tiger</classname> "
+"using the join table <literal>Trainer_Tiger</literal>, with a foreign
key "
+"<literal>trainer_id</literal> to <literal>Trainer</literal>
(table name, "
+"<keycap>_</keycap>, trainer id) and a foreign key
<literal>trainedTigers_id</"
+"literal> to <literal>Monkey</literal> (property name,
<keycap>_</keycap>, "
+"Tiger primary column).</para> </sect5>"
+msgstr ""
+"<sect5> <title>Bidirecional</title> <para> Uma vez que
muitos-para-um estão (quase) sempre ao lado do proprietário de uma relação bidirecional no
EJB3 spec, a associação uma-para-muitos é anotada pelo <literal>@OneToMany(
mappedBy=... )</"
+"literal></para> <programlisting>@Entity\n"
+"public class Troop {\n"
+" @OneToMany(mappedBy=\"troop\")\n"
+" public Set<Soldier> getSoldiers() {\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Soldier {\n"
+" @ManyToOne\n"
+" @JoinColumn(name=\"troop_fk\")\n"
+" public Troop getTroop() {\n"
+" ...\n"
+"} </programlisting>
<para><classname>Troop</classname> possui uma relação um-para-muito
bidirecional com <literal>Soldier</literal> "
+"através da propriedade <literal>troop</literal>. Você não precisa
definir (não deve) qualquer mapeamento ao lado <literal>mappedBy</literal>.
</para> "
+"<para>Para mapear um-para-muitos direcional, com o lado um-para-muitos como o
lado proprietário, você precisa remover o elemento <literal>mappedBy</literal>
e configurar o <literal>@JoinColumn</literal> muitos-para-um como inserÃvel e
atualizável para falso. Esta solução não é otimizada e produzirá algumas declarações
UPDATE adicionais.</para> <programlisting>@Entity\n"
+"public class Troop {\n"
+" @OneToMany\n"
+" @JoinColumn(name=\"troop_fk\") //we need to duplicate the physical
"
+"information\n"
+" public Set<Soldier> getSoldiers() {\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Soldier {\n"
+" @ManyToOne\n"
+" @JoinColumn(name=\"troop_fk\", insertable=false,
updatable=false)\n"
+" public Troop getTroop() {\n"
+" ...\n"
+"}</programlisting> </sect5> <sect5>
<title>Unidirecional</title> <para> Um-para-muitos unidirecional usando
uma coluna chave exterior na entidade proprietária não é comum, além de não ser
recomendada. Nós recomendamos que você use uma tabela de união para este tipo de
associação (conforme explicado na próxima seção). Este tipo de associação é descrita
através de um <literal>@JoinColumn</"
+"literal></para> <programlisting>\n"
+"@Entity\n"
+"public class Customer implements Serializable {\n"
+" @OneToMany(cascade=CascadeType.ALL, fetch=FetchType.EAGER)\n"
+" @JoinColumn(name=\"CUST_ID\")\n"
+" public Set<Ticket> getTickets() {\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Ticket implements Serializable {\n"
+" ... //no bidir\n"
+"}\n"
+" </programlisting>
<para><literal>Customer</literal> descreve uma relação unidirecional com
o <literal>Ticket</literal> usando o <literal>CUST_ID</literal> da
coluna de união.</para> </sect5> <sect5> "
+"<title>Unidirecional com a tabela de união</title> <para> É muito
mais preferÃvel o um-para-muitos unidirecional com a tabela de união. Esta associação é
descrita através de um <literal>(a)JoinTable</literal>.</para>
<programlisting>\n"
+"@Entity\n"
+"public class Trainer {\n"
+" @OneToMany\n"
+" @JoinTable(\n"
+" name=\"TrainedMonkeys\",\n"
+" joinColumns = @JoinColumn( name=\"trainer_id\"),\n"
+" inverseJoinColumns = @JoinColumn(
name=\"monkey_id\")\n"
+" )\n"
+" public Set<Monkey> getTrainedMonkeys() {\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Monkey {\n"
+" ... //no bidir\n"
+"}\n"
+" </programlisting>
<para><literal>Trainer</literal> descreve uma relação unidirecional com
<classname>Monkey</classname> usando o
<classname>TrainedMonkeys</classname> da tabela de união, com um
<literal>trainer_id</literal> de chave exterior para
<literal>Trainer</literal> "
+"(<literal>joinColumns</literal>) e um
<literal>monkey_id</"
+"literal> de chave exterior para <literal>Monkey</literal>
(<literal>inversejoinColumns</"
+"literal>).</para> </sect5> <sect5
id=\"entity-mapping-association-collection-"
+"manytomany-default\" revision=\"1\">
<title>Defaults</title> <para>Sem descrever qualquer mapeamento fÃsico
um-para-muitos unidirecional é usado com a tabela de união. O nome da tabela é a
concatenação do nome da tabela proprietária, <keycap>_</keycap>, além do outro
lado do nome da tabela. O(s) nome(s) da chave exterior referenciando a tabela proprietária
é a concatenação da tabela proprietária. O(s) nome(s) chave exteriore(s) referenciados da
tabela proprietária é a concatenação da tabela proprietária,
<keycap>_</keycap>, além do nome da(s) coluna(s) chave primária(s). O(s)
nome(s) chave exteriores referenciando o outro lado é a concatenação do nome da
propriedade proprietária, <keycap>_</keycap>, e o outro lado do nome de
coluna(s) de chave primária(s). A restrição única é adicionada à chave exterior
referenciando o outro lado da tabela para refletir um-para-muitos.</para>
<programlisting>\n"
+"@Entity\n"
+"public class Trainer {\n"
+" @OneToMany\n"
+" public Set<Tiger> getTrainedTigers() {\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Tiger {\n"
+" ... //no bidir\n"
+"}\n"
+" </programlisting>
<para><classname>Trainer</classname> descreve uma relação unidirecional
com o <classname>Tiger</classname> usando o
<literal>Trainer_Tiger</literal> de tabela de união, juntamente com o
<literal>trainer_id</literal> de chave exterior para
<literal>Trainer</literal> (nome de tabela, "
+"<keycap>_</keycap>, trainer id) e um
<literal>trainedTigers_id</"
+"literal> de chave exterior para <literal>Monkey</literal> (nome de
propriedade, <keycap>_</keycap>, "
+"coluna primária Tiger).</para> </sect5>"
+
+#. Tag: title
+#: entity.xml:1099
+#, no-c-format
+msgid "Many-to-many"
+msgstr "Muitos-para-muitos"
+
+#. Tag: sect4
+#: entity.xml:1099
+#, no-c-format
+msgid ""
+"<sect5> <title>Definition</title> <para>A many-to-many
association is "
+"defined logically using the <literal>@ManyToMany</literal> annotation.
You "
+"also have to describe the association table and the join conditions using "
+"the <literal>@JoinTable</literal> annotation. If the association is
"
+"bidirectional, one side has to be the owner and one side has to be the "
+"inverse end (ie. it will be ignored when updating the relationship values in
"
+"the association table):</para> <programlisting>\n"
+"@Entity\n"
+"public class Employer implements Serializable {\n"
+" @ManyToMany(\n"
+"
targetEntity=org.hibernate.test.metadata.manytomany.Employee.class,\n"
+" cascade={CascadeType.PERSIST, CascadeType.MERGE}\n"
+" )\n"
+" @JoinTable(\n"
+" name=\"EMPLOYER_EMPLOYEE\",\n"
+" joinColumns=@JoinColumn(name=\"EMPER_ID\"),\n"
+" inverseJoinColumns=@JoinColumn(name=\"EMPEE_ID\")\n"
+" )\n"
+" public Collection getEmployees() {\n"
+" return employees;\n"
+" }\n"
+" ...\n"
+"}\n"
+" </programlisting> <programlisting>\n"
+"@Entity\n"
+"public class Employee implements Serializable {\n"
+" @ManyToMany(\n"
+" cascade = {CascadeType.PERSIST, CascadeType.MERGE},\n"
+" mappedBy = \"employees\",\n"
+" targetEntity = Employer.class\n"
+" )\n"
+" public Collection getEmployers() {\n"
+" return employers;\n"
+" }\n"
+"}\n"
+" </programlisting> <para>We've already shown the many
"
+"declarations and the detailed attributes for associations. We'll go deeper
"
+"in the <literal>@JoinTable</literal> description, it defines a "
+"<literal>name</literal>, an array of join columns (an array in
annotation is "
+"defined using { A, B, C }), and an array of inverse join columns. The latter
"
+"ones are the columns of the association table which refer to the "
+"<classname>Employee</classname> primary key (the \"other
side\").</para> "
+"<para>As seen previously, the other side don't have to (must not)
describe "
+"the physical mapping: a simple <literal>mappedBy</literal> argument
"
+"containing the owner side property name bind the two.</para> </sect5>
"
+"<sect5> <title>Default values</title> <para>As any other
annotations, most "
+"values are guessed in a many to many relationship. Without describing any "
+"physical mapping in a unidirectional many to many the following rules "
+"applied. The table name is the concatenation of the owner table name, "
+"<keycap>_</keycap> and the other side table name. The foreign key
name(s) "
+"referencing the owner table is the concatenation of the owner table name, "
+"<keycap>_</keycap> and the owner primary key column(s). The foreign key
name"
+"(s) referencing the other side is the concatenation of the owner property "
+"name, <keycap>_</keycap>, and the other side primary key column(s).
These "
+"are the same rules used for a unidirectional one to many relationship.</"
+"para> <programlisting>\n"
+"@Entity\n"
+"public class Store {\n"
+" @ManyToMany(cascade = CascadeType.PERSIST)\n"
+" public Set<City> getImplantedIn() {\n"
+" ...\n"
+" }\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class City {\n"
+" ... //no bidirectional relationship\n"
+"}\n"
+" </programlisting> <para>A
<literal>Store_City</literal> is "
+"used as the join table. The <literal>Store_id</literal> column is a
foreign "
+"key to the <literal>Store</literal> table. The
<literal>implantedIn_id</"
+"literal> column is a foreign key to the <literal>City</literal>
table.</"
+"para> <para>Without describing any physical mapping in a bidirectional
many "
+"to many the following rules applied. The table name is the concatenation of "
+"the owner table name, <keycap>_</keycap> and the other side table name.
The "
+"foreign key name(s) referencing the owner table is the concatenation of the "
+"other side property name, <keycap>_</keycap>, and the owner primary key
"
+"column(s). The foreign key name(s) referencing the other side is the "
+"concatenation of the owner property name, <keycap>_</keycap>, and the
other "
+"side primary key column(s). These are the same rules used for a "
+"unidirectional one to many relationship.</para>
<programlisting>\n"
+"@Entity\n"
+"public class Store {\n"
+" @ManyToMany(cascade = {CascadeType.PERSIST, CascadeType.MERGE})\n"
+" public Set<Customer> getCustomers() {\n"
+" ...\n"
+" }\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Customer {\n"
+" @ManyToMany(mappedBy=\"customers\")\n"
+" public Set<Store> getStores() {\n"
+" ...\n"
+" }\n"
+"}\n"
+" </programlisting> <para>A
<literal>Store_Customer</literal> "
+"is used as the join table. The <literal>stores_id</literal> column is a
"
+"foreign key to the <literal>Store</literal> table. The "
+"<literal>customers_id</literal> column is a foreign key to the "
+"<literal>Customer</literal> table.</para> </sect5>"
+msgstr ""
+"<sect5> <title>Definição</title> <para>Uma associação
muitos-para-muitos é definida logicamente usando a anotação
<literal>@ManyToMany</literal>. Você também pode descrever a tabela de
associação e as condições de união usando a anotação
<literal>@JoinTable</literal>. Caso a associação seja bidirecional, um lado
precisará ser o proprietário e um lado precisará ser o lado inverso (ex.: ele será
ignorado quando atualizando os valores de relação na tabela de associação):</para>
<programlisting>\n"
+"@Entity\n"
+"public class Employer implements Serializable {\n"
+" @ManyToMany(\n"
+"
targetEntity=org.hibernate.test.metadata.manytomany.Employee.class,\n"
+" cascade={CascadeType.PERSIST, CascadeType.MERGE}\n"
+" )\n"
+" @JoinTable(\n "
+
+#. Tag: title
+#: entity.xml:1177
+#, no-c-format
+msgid "Transitive persistence with cascading"
+msgstr "Persistência transitiva com cascade"
+
+#. Tag: para
+#: entity.xml:1179
+#, no-c-format
+msgid ""
+"You probably have noticed the <literal>cascade</literal> attribute
taking an "
+"array of <classname>CascadeType</classname> as a value. The cascade
concept "
+"in EJB3 is very is similar to the transitive persistence and cascading of "
+"operations in Hibernate, but with slightly different semantics and cascading
"
+"types:"
+msgstr "Você provavelmente notou o atributo <literal>cascade</literal>
obtendo um array do <classname>CascadeType</classname> como um valor. O
conceito cascade no EJB3 é bastante similar à persistência transitiva e ao cascade das
operações no Hibernate, mas é completamente diferente nos tipos de semânticas e
cascade:"
+
+#. Tag: para
+#: entity.xml:1187
+#, no-c-format
+msgid ""
+"CascadeType.PERSIST: cascades the persist (create) operation to associated "
+"entities persist() is called or if the entity is managed"
+msgstr "CascadeType.PERSIST: realiza o cascade na operação de persistência (criação)
para persist() de entidades associadas serem chamadas ou a entidade ser gerenciada"
+
+#. Tag: para
+#: entity.xml:1192
+#, no-c-format
+msgid ""
+"CascadeType.MERGE: cascades the merge operation to associated entities if "
+"merge() is called or if the entity is managed"
+msgstr "CascadeType.MERGE: realiza o cascade na operação de união para entidades
associadas, caso merge() seja chamado ou a entidade for gerenciada"
+
+#. Tag: para
+#: entity.xml:1197
+#, no-c-format
+msgid ""
+"CascadeType.REMOVE: cascades the remove operation to associated entities if "
+"delete() is called"
+msgstr "CascadeType.REMOVE: realiza o cascade na operação de remoção para entidades
associadas, caso delete() seja chamado"
+
+#. Tag: para
+#: entity.xml:1202
+#, no-c-format
+msgid ""
+"CascadeType.REFRESH: cascades the refresh operation to associated entities "
+"if refresh() is called"
+msgstr "CascadeType.REFRESH: realiza cascade na operação de atualização para
entidades associadas, caso refresh() seja chamado"
+
+#. Tag: para
+#: entity.xml:1207
+#, no-c-format
+msgid "CascadeType.ALL: all of the above"
+msgstr "CascadeType.ALL: todos os citados acima"
+
+#. Tag: para
+#: entity.xml:1213
+#, no-c-format
+msgid ""
+"CascadeType.ALL also covers Hibernate specific operations like save-update, "
+"lock etc... Check <xref linkend=\"entity-hibspec-cascade\"/> for
more "
+"information"
+msgstr ""
+"CascadeType.ALL cobre também as operações especÃficas do Hibernate como
save-update, "
+"lock etc... Veja <xref linkend=\"entity-hibspec-cascade\"/> para
maiores informações "
+
+#. Tag: para
+#: entity.xml:1218
+#, no-c-format
+msgid ""
+"Please refer to the chapter 6.3 of the EJB3 specification for more "
+"information on cascading and create/merge semantics."
+msgstr "Por favor refira-se ao capÃtulo 6.3 da especificação EJB3 para maiores
informações no cascade e semânticas de união/criação."
+
+#. Tag: title
+#: entity.xml:1223
+#, no-c-format
+msgid "Association fetching"
+msgstr "Buscando associação"
+
+#. Tag: para
+#: entity.xml:1225
+#, no-c-format
+msgid ""
+"You have the ability to either eagerly or lazily fetch associated entities. "
+"The <literal>fetch</literal> parameter can be set to
<literal>FetchType."
+"LAZY</literal> or <literal>FetchType.EAGER</literal>.
<literal>EAGER</"
+"literal> will try to use an outer join select to retrieve the associated "
+"object, while <literal>LAZY</literal> will only trigger a select when
the "
+"associated object is accessed for the first time.
<literal>@OneToMany</"
+"literal> and <literal>@ManyToMany</literal> associations are
defaulted to "
+"<literal>LAZY</literal> and <literal>@OneToOne</literal>
and "
+"<literal>@ManyToOne</literal> are defaulted to
<literal>EAGER</literal>. For "
+"more information about static fetching, check <xref
linkend=\"entity-hibspec-"
+"singleassoc-fetching\"/>."
+msgstr ""
+"Você possui a habilidade para tanto buscar lazily (lentamente) ou eagerly
(avidamente) as entidades associadas. O parâmetro <literal>fetch</literal>
pode ser configurado para <literal>FetchType."
+"LAZY</literal> ou <literal>FetchType.EAGER</literal>. O
<literal>EAGER</"
+"literal> tentará usar uma outra seleção de união para restaurar o objeto
associado, enquanto <literal>LAZY</literal> apenas realizará o trigger numa
seleção quando o objeto associado for acessado pela primeira vez. As associações
<literal>@OneToMany</"
+"literal> e <literal>@ManyToMany</literal> são padronizadas para
<literal>LAZY</literal> e <literal>@OneToOne</literal>, enquanto
que as <literal>@ManyToOne</literal> são padronizadas para
<literal>EAGER</literal>. Para maiores informações a respeito da busca
estática, consulte <xref linkend=\"entity-hibspec-"
+"singleassoc-fetching\"/>."
+
+#. Tag: para
+#: entity.xml:1238
+#, no-c-format
+msgid ""
+"The recommanded approach is to use <literal>LAZY</literal> onn all
static "
+"fetching definitions and override this choice dynamically through JPA-QL. "
+"JPA-QL has a <literal>fetch</literal> keyword that allows you to
override "
+"laziness when doing a particular query. This is very useful to improve "
+"performance and is decided on a use case to use case basis."
+msgstr "A abordagem recomendada é usar o <literal>LAZY</literal> em
todas as definições de busca estática e substituir esta escolha dinâmica através do
JPA-QL. O JPA-QL possui uma palavra chave <literal>fetch</literal> que permite
que você substitua lentamente quando realizando uma consulta particular. Isto é bastante
útil para melhoramento do desempenho e é decidido em cada caso de uso."
+
+#. Tag: title
+#: entity.xml:1248
+#, no-c-format
+msgid "Mapping composite primary and foreign keys"
+msgstr "Mapeamento primário composto e chaves exteriores"
+
+#. Tag: para
+#: entity.xml:1250
+#, no-c-format
+msgid ""
+"Composite primary keys use a embedded class as the primary key "
+"representation, so you'd use the <literal>@Id</literal> and "
+"<literal>@Embeddable</literal> annotations. Alternatively, you can use
the "
+"<literal>@EmbeddedId</literal> annotation. Note that the dependent
class has "
+"to be serializable and implements
<methodname>equals()</methodname>/"
+"<methodname>hashCode()</methodname>. You can also use
<literal>@IdClass</"
+"literal> as described in <xref
linkend=\"entity-mapping-identifier\"/>."
+msgstr ""
+"As chaves primárias compostas usam a classe incorporada como a representação de
chave primária, de forma que você usaria as anotações <literal>@Id</literal> e
"
+"<literal>@Embeddable</literal>. Alternativamente, você pode usar a
anotação <literal>@EmbeddedId</literal>. Perceba que a classe dependente
precisa ser serializada e implementa <methodname>equals()</methodname>/"
+"<methodname>hashCode()</methodname>. Você pode usar também o
<literal>@IdClass</"
+"literal>, conforme descrito no <xref
linkend=\"entity-mapping-identifier\"/>."
+
+#. Tag: programlisting
+#: entity.xml:1259
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class RegionalArticle implements Serializable {\n"
+"\n"
+" @Id\n"
+" public RegionalArticlePk getPk() { ... }\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"public class RegionalArticlePk implements Serializable { ... }"
+msgstr ""
+"@Entity\n"
+"public class RegionalArticle implements Serializable {\n"
+"\n"
+" @Id\n"
+" public RegionalArticlePk getPk() { ... }\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"public class RegionalArticlePk implements Serializable { ... }"
+
+#. Tag: para
+#: entity.xml:1261
+#, no-c-format
+msgid "or alternatively"
+msgstr "ou alternativamente"
+
+#. Tag: programlisting
+#: entity.xml:1263
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class RegionalArticle implements Serializable {\n"
+"\n"
+" @EmbeddedId\n"
+" public RegionalArticlePk getPk() { ... }\n"
+"}\n"
+"\n"
+"public class RegionalArticlePk implements Serializable { ... }"
+msgstr ""
+"@Entity\n"
+"public class RegionalArticle implements Serializable {\n"
+"\n"
+" @EmbeddedId\n"
+" public RegionalArticlePk getPk() { ... }\n"
+"}\n"
+"\n"
+"public class RegionalArticlePk implements Serializable { ... }"
+
+#. Tag: para
+#: entity.xml:1265
+#, no-c-format
+msgid ""
+"<literal>@Embeddable</literal> inherit the access type of its owning
entity "
+"unless the Hibernate specific annotation <literal>@AccessType</literal>
is "
+"used. Composite foreign keys (if not using the default sensitive values) are
"
+"defined on associations using the <literal>@JoinColumns</literal>
element, "
+"which is basically an array of <literal>@JoinColumn</literal>. It is
"
+"considered a good practice to express
<literal>referencedColumnNames</"
+"literal> explicitly. Otherwise, Hibernate will suppose that you use the same
"
+"order of columns as in the primary key declaration."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1275
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Parent implements Serializable {\n"
+" @Id\n"
+" public ParentPk id;\n"
+" public int age;\n"
+"\n"
+" @OneToMany(cascade=CascadeType.ALL)\n"
+" @JoinColumns ({\n"
+" @JoinColumn(name=\"parentCivility\", referencedColumnName =
\"isMale"
+"\"),\n"
+" @JoinColumn(name=\"parentLastName\", referencedColumnName =
"
+"\"lastName\"),\n"
+" @JoinColumn(name=\"parentFirstName\", referencedColumnName =
"
+"\"firstName\")\n"
+" })\n"
+" public Set<Child> children; //unidirectional\n"
+" ...\n"
+"}"
+msgstr ""
+"@Entity\n"
+"public class Parent implements Serializable {\n"
+" @Id\n"
+" public ParentPk id;\n"
+" public int age;\n"
+"\n"
+" @OneToMany(cascade=CascadeType.ALL)\n"
+" @JoinColumns ({\n"
+" @JoinColumn(name=\"parentCivility\", referencedColumnName =
\"isMale"
+"\"),\n"
+" @JoinColumn(name=\"parentLastName\", referencedColumnName =
"
+"\"lastName\"),\n"
+" @JoinColumn(name=\"parentFirstName\", referencedColumnName =
"
+"\"firstName\")\n"
+" })\n"
+" public Set<Child> children; //unidirectional\n"
+" ...\n"
+"}"
+
+#. Tag: programlisting
+#: entity.xml:1277
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Child implements Serializable {\n"
+" @Id @GeneratedValue\n"
+" public Integer id;\n"
+"\n"
+" @ManyToOne\n"
+" @JoinColumns ({\n"
+" @JoinColumn(name=\"parentCivility\", referencedColumnName =
\"isMale"
+"\"),\n"
+" @JoinColumn(name=\"parentLastName\", referencedColumnName =
"
+"\"lastName\"),\n"
+" @JoinColumn(name=\"parentFirstName\", referencedColumnName =
"
+"\"firstName\")\n"
+" })\n"
+" public Parent parent; //unidirectional\n"
+"}"
+msgstr ""
+"@Entity\n"
+"public class Child implements Serializable {\n"
+" @Id @GeneratedValue\n"
+" public Integer id;\n"
+"\n"
+" @ManyToOne\n"
+" @JoinColumns ({\n"
+" @JoinColumn(name=\"parentCivility\", referencedColumnName =
\"isMale"
+"\"),\n"
+" @JoinColumn(name=\"parentLastName\", referencedColumnName =
"
+"\"lastName\"),\n"
+" @JoinColumn(name=\"parentFirstName\", referencedColumnName =
"
+"\"firstName\")\n"
+" })\n"
+" public Parent parent; //unidirectional\n"
+"}"
+
+#. Tag: programlisting
+#: entity.xml:1279
+#, no-c-format
+msgid ""
+"@Embeddable\n"
+"public class ParentPk implements Serializable {\n"
+" String firstName;\n"
+" String lastName;\n"
+" ...\n"
+"}"
+msgstr ""
+"@Embeddable\n"
+"public class ParentPk implements Serializable {\n"
+" String firstName;\n"
+" String lastName;\n"
+" ...\n"
+"}"
+
+#. Tag: para
+#: entity.xml:1281
+#, no-c-format
+msgid "Note the explicit usage of the
<literal>referencedColumnName</literal>."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1286
+#, no-c-format
+msgid "Mapping secondary tables"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1288
+#, no-c-format
+msgid ""
+"You can map a single entity bean to several tables using the "
+"<literal>@SecondaryTable</literal> or
<literal>@SecondaryTables</literal> "
+"class level annotations. To express that a column is in a particular table, "
+"use the <literal>table</literal> parameter of
<literal>@Column</literal> or "
+"<literal>(a)JoinColumn</literal>."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1295
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Table(name=\"MainCat\")\n"
+"<emphasis role=\"bold\">@SecondaryTables({\n"
+" @SecondaryTable(name=\"Cat1\", pkJoinColumns={\n"
+" @PrimaryKeyJoinColumn(name=\"cat_id\",
referencedColumnName=\"id\")\n"
+" ),\n"
+" @SecondaryTable(name=\"Cat2\",
uniqueConstraints={@UniqueConstraint"
+"(columnNames={\"storyPart2\"})})\n"
+"})</emphasis>\n"
+"public class Cat implements Serializable {\n"
+"\n"
+" private Integer id;\n"
+" private String name;\n"
+" private String storyPart1;\n"
+" private String storyPart2;\n"
+"\n"
+" @Id @GeneratedValue\n"
+" public Integer getId() {\n"
+" return id;\n"
+" }\n"
+"\n"
+" public String getName() {\n"
+" return name;\n"
+" }\n"
+" \n"
+" <emphasis
role=\"bold\">@Column(table=\"Cat1\")</emphasis>\n"
+" public String getStoryPart1() {\n"
+" return storyPart1;\n"
+" }\n"
+"\n"
+" <emphasis
role=\"bold\">@Column(table=\"Cat2\")</emphasis>\n"
+" public String getStoryPart2() {\n"
+" return storyPart2;\n"
+" }"
+msgstr ""
+"@Entity\n"
+"@Table(name=\"MainCat\")\n"
+"<emphasis role=\"bold\">@SecondaryTables({\n"
+" @SecondaryTable(name=\"Cat1\", pkJoinColumns={\n"
+" @PrimaryKeyJoinColumn(name=\"cat_id\",
referencedColumnName=\"id\")\n"
+" ),\n"
+" @SecondaryTable(name=\"Cat2\",
uniqueConstraints={@UniqueConstraint"
+"(columnNames={\"storyPart2\"})})\n"
+"})</emphasis>\n"
+"public class Cat implements Serializable {\n"
+"\n"
+" private Integer id;\n"
+" private String name;\n"
+" private String storyPart1;\n"
+" private String storyPart2;\n"
+"\n"
+" @Id @GeneratedValue\n"
+" public Integer getId() {\n"
+" return id;\n"
+" }\n"
+"\n"
+" public String getName() {\n"
+" return name;\n"
+" }\n"
+" \n"
+" <emphasis
role=\"bold\">@Column(table=\"Cat1\")</emphasis>\n"
+" public String getStoryPart1() {\n"
+" return storyPart1;\n"
+" }\n"
+"\n"
+" <emphasis
role=\"bold\">@Column(table=\"Cat2\")</emphasis>\n"
+" public String getStoryPart2() {\n"
+" return storyPart2;\n"
+" }"
+
+#. Tag: para
+#: entity.xml:1297
+#, no-c-format
+msgid ""
+"In this example, <literal>name</literal> will be in
<literal>MainCat</"
+"literal>. <literal>storyPart1</literal> will be in
<literal>Cat1</literal> "
+"and <literal>storyPart2</literal> will be in
<literal>Cat2</literal>. "
+"<literal>Cat1</literal> will be joined to
<literal>MainCat</literal> using "
+"the <literal>cat_id</literal> as a foreign key, and
<literal>Cat2</literal> "
+"using <literal>id</literal> (ie the same column name, the
<literal>MainCat</"
+"literal> id column has). Plus a unique constraint on
<literal>storyPart2</"
+"literal> has been set."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1307
+#, no-c-format
+msgid ""
+"Check out the JBoss EJB 3 tutorial or the Hibernate Annotations unit test "
+"suite for more examples."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1313
+#, no-c-format
+msgid "Mapping Queries"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1317
+#, no-c-format
+msgid "Mapping JPAQL/HQL queries"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1319
+#, no-c-format
+msgid ""
+"You can map EJBQL/HQL queries using annotations.
<literal>@NamedQuery</"
+"literal> and <literal>@NamedQueries</literal> can be defined at the
class "
+"level or in a JPA XML file. However their definitions are global to the "
+"session factory/entity manager factory scope. A named query is defined by "
+"its name and the actual query string."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1326
+#, no-c-format
+msgid ""
+"<entity-mappings>\n"
+" <named-query name=\"plane.getAll\">\n"
+" <query>select p from Plane p</query>\n"
+" </named-query>\n"
+" ...\n"
+"</entity-mappings>\n"
+"...\n"
+"\n"
+"@Entity\n"
+"(a)NamedQuery(name=\"night.moreRecentThan\", query=\"select n from
Night n "
+"where n.date >= :date\")\n"
+"public class Night {\n"
+" ...\n"
+"}\n"
+"\n"
+"public class MyDao {\n"
+" doStuff() {\n"
+" Query q = s.getNamedQuery(\"night.moreRecentThan\");\n"
+" q.setDate( \"date\", aMonthAgo );\n"
+" List results = q.list();\n"
+" ...\n"
+" }\n"
+" ...\n"
+"}"
+msgstr ""
+"<entity-mappings>\n"
+" <named-query name=\"plane.getAll\">\n"
+" <query>select p from Plane p</query>\n"
+" </named-query>\n"
+" ...\n"
+"</entity-mappings>\n"
+"...\n"
+"\n"
+"@Entity\n"
+"(a)NamedQuery(name=\"night.moreRecentThan\", query=\"select n from
Night n "
+"where n.date >= :date\")\n"
+"public class Night {\n"
+" ...\n"
+"}\n"
+"\n"
+"public class MyDao {\n"
+" doStuff() {\n"
+" Query q = s.getNamedQuery(\"night.moreRecentThan\");\n"
+" q.setDate( \"date\", aMonthAgo );\n"
+" List results = q.list();\n"
+" ...\n"
+" }\n"
+" ...\n"
+"}"
+
+#. Tag: para
+#: entity.xml:1328
+#, no-c-format
+msgid ""
+"You can also provide some hints to a query through an array of "
+"<literal>QueryHint</literal> through a
<literal>hints</literal> attribute."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1332
+#, no-c-format
+msgid "The availabe Hibernate hints are"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1337
+#, no-c-format
+msgid "Query hints"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1346
+#, no-c-format
+msgid "hint"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1348
+#, no-c-format
+msgid "description"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1354
+#, no-c-format
+msgid "org.hibernate.cacheable"
+msgstr "org.hibernate.cacheable"
+
+#. Tag: entry
+#: entity.xml:1356
+#, no-c-format
+msgid ""
+"Whether the query should interact with the second level cache (defualt to "
+"false)"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1361
+#, no-c-format
+msgid "org.hibernate.cacheRegion"
+msgstr "org.hibernate.cacheRegion"
+
+#. Tag: entry
+#: entity.xml:1363
+#, no-c-format
+msgid "Cache region name (default used otherwise)"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1367
+#, no-c-format
+msgid "org.hibernate.timeout"
+msgstr "org.hibernate.timeout"
+
+#. Tag: entry
+#: entity.xml:1369
+#, no-c-format
+msgid "Query timeout"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1373
+#, no-c-format
+msgid "org.hibernate.fetchSize"
+msgstr "org.hibernate.fetchSize"
+
+#. Tag: entry
+#: entity.xml:1375
+#, no-c-format
+msgid "resultset fetch size"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1379
+#, no-c-format
+msgid "org.hibernate.flushMode"
+msgstr "org.hibernate.flushMode"
+
+#. Tag: entry
+#: entity.xml:1381
+#, no-c-format
+msgid "Flush mode used for this query"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1385
+#, no-c-format
+msgid "org.hibernate.cacheMode"
+msgstr "org.hibernate.cacheMode"
+
+#. Tag: entry
+#: entity.xml:1387
+#, no-c-format
+msgid "Cache mode used for this query"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1391
+#, no-c-format
+msgid "org.hibernate.readOnly"
+msgstr "org.hibernate.readOnly"
+
+#. Tag: entry
+#: entity.xml:1393
+#, no-c-format
+msgid ""
+"Entities loaded by this query should be in read only mode or not (default to
"
+"false)"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1398
+#, no-c-format
+msgid "org.hibernate.comment"
+msgstr "org.hibernate.comment"
+
+#. Tag: entry
+#: entity.xml:1400
+#, no-c-format
+msgid "Query comment added to the generated SQL"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1408
+#, no-c-format
+msgid "Mapping native queries"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1410
+#, no-c-format
+msgid ""
+"You can also map a native query (ie a plain SQL query). To achieve that, you
"
+"need to describe the SQL resultset structure using "
+"<literal>@SqlResultSetMapping</literal> (or
<literal>@SqlResultSetMappings</"
+"literal> if you plan to define several resulset mappings). Like "
+"<literal>@NamedQuery</literal>, a
<literal>@SqlResultSetMapping</literal> "
+"can be defined at class level or in a JPA XML file. However its scope is "
+"global to the application."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1419
+#, no-c-format
+msgid ""
+"As we will see, a <literal>resultSetMapping</literal> parameter is
defined "
+"in <literal>@NamedNativeQuery</literal>, it represents the name of a
defined "
+"<literal>@SqlResultSetMapping</literal>. The resultset mapping declares
the "
+"entities retrieved by this native query. Each field of the entity is bound "
+"to an SQL alias (or column name). All fields of the entity including the "
+"ones of subclasses and the foreign key columns of related entities have to "
+"be present in the SQL query. Field definitions are optional provided that "
+"they map to the same column name as the one declared on the class property."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1429
+#, no-c-format
+msgid ""
+"@NamedNativeQuery(name=\"night&area\", query=\"select
night.id nid, "
+"night.night_duration, \"\n"
+" + \" night.night_date, area.id aid, night.area_id, area.name
\"\n"
+" + \"from Night night, Area area where night.area_id = area.id\",
"
+"<emphasis\n"
+"
role=\"bold\">resultSetMapping=\"joinMapping\"</emphasis>)\n"
+"@SqlResultSetMapping(name=\"joinMapping\", entities={\n"
+" @EntityResult(entityClass=org.hibernate.test.annotations.query.Night."
+"class, fields = {\n"
+" @FieldResult(name=\"id\", column=\"nid\"),\n"
+" @FieldResult(name=\"duration\",
column=\"night_duration\"),\n"
+" @FieldResult(name=\"date\",
column=\"night_date\"),\n"
+" @FieldResult(name=\"area\",
column=\"area_id\"),\n"
+" discriminatorColumn=\"disc\"\n"
+" }),\n"
+" @EntityResult(entityClass=org.hibernate.test.annotations.query.Area."
+"class, fields = {\n"
+" @FieldResult(name=\"id\", column=\"aid\"),\n"
+" @FieldResult(name=\"name\", column=\"name\")\n"
+" })\n"
+" }\n"
+")"
+msgstr ""
+"@NamedNativeQuery(name=\"night&area\", query=\"select
night.id nid, "
+"night.night_duration, \"\n"
+" + \" night.night_date, area.id aid, night.area_id, area.name
\"\n"
+" + \"from Night night, Area area where night.area_id = area.id\",
"
+"<emphasis\n"
+"
role=\"bold\">resultSetMapping=\"joinMapping\"</emphasis>)\n"
+"@SqlResultSetMapping(name=\"joinMapping\", entities={\n"
+" @EntityResult(entityClass=org.hibernate.test.annotations.query.Night."
+"class, fields = {\n"
+" @FieldResult(name=\"id\", column=\"nid\"),\n"
+" @FieldResult(name=\"duration\",
column=\"night_duration\"),\n"
+" @FieldResult(name=\"date\",
column=\"night_date\"),\n"
+" @FieldResult(name=\"area\",
column=\"area_id\"),\n"
+" discriminatorColumn=\"disc\"\n"
+" }),\n"
+" @EntityResult(entityClass=org.hibernate.test.annotations.query.Area."
+"class, fields = {\n"
+" @FieldResult(name=\"id\", column=\"aid\"),\n"
+" @FieldResult(name=\"name\", column=\"name\")\n"
+" })\n"
+" }\n"
+")"
+
+#. Tag: para
+#: entity.xml:1431
+#, no-c-format
+msgid ""
+"In the above example, the <literal>night&area</literal> named
query use "
+"the <literal>joinMapping</literal> result set mapping. This mapping
returns "
+"2 entities, <literal>Night</literal> and
<literal>Area</literal>, each "
+"property is declared and associated to a column name, actually the column "
+"name retrieved by the query. Let's now see an implicit declaration of the
"
+"property / column."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1438
+#, no-c-format
+msgid ""
+"@Entity\n"
+"<emphasis
role=\"bold\">@SqlResultSetMapping(name=\"implicit\", "
+"entities=(a)EntityResult(entityClass=org.hibernate.test.annotations.query."
+"SpaceShip.class))\n"
+"@NamedNativeQuery(name=\"implicitSample\", query=\"select * from
SpaceShip"
+"\", resultSetMapping=\"implicit\")</emphasis>\n"
+"public class SpaceShip {\n"
+" private String name;\n"
+" private String model;\n"
+" private double speed;\n"
+"\n"
+" @Id\n"
+" public String getName() {\n"
+" return name;\n"
+" }\n"
+"\n"
+" public void setName(String name) {\n"
+" this.name = name;\n"
+" }\n"
+"\n"
+" @Column(name=\"model_txt\")\n"
+" public String getModel() {\n"
+" return model;\n"
+" }\n"
+"\n"
+" public void setModel(String model) {\n"
+" this.model = model;\n"
+" }\n"
+"\n"
+" public double getSpeed() {\n"
+" return speed;\n"
+" }\n"
+"\n"
+" public void setSpeed(double speed) {\n"
+" this.speed = speed;\n"
+" }\n"
+"}"
+msgstr ""
+"@Entity\n"
+"<emphasis
role=\"bold\">@SqlResultSetMapping(name=\"implicit\", "
+"entities=(a)EntityResult(entityClass=org.hibernate.test.annotations.query."
+"SpaceShip.class))\n"
+"@NamedNativeQuery(name=\"implicitSample\", query=\"select * from
SpaceShip"
+"\", resultSetMapping=\"implicit\")</emphasis>\n"
+"public class SpaceShip {\n"
+" private String name;\n"
+" private String model;\n"
+" private double speed;\n"
+"\n"
+" @Id\n"
+" public String getName() {\n"
+" return name;\n"
+" }\n"
+"\n"
+" public void setName(String name) {\n"
+" this.name = name;\n"
+" }\n"
+"\n"
+" @Column(name=\"model_txt\")\n"
+" public String getModel() {\n"
+" return model;\n"
+" }\n"
+"\n"
+" public void setModel(String model) {\n"
+" this.model = model;\n"
+" }\n"
+"\n"
+" public double getSpeed() {\n"
+" return speed;\n"
+" }\n"
+"\n"
+" public void setSpeed(double speed) {\n"
+" this.speed = speed;\n"
+" }\n"
+"}"
+
+#. Tag: para
+#: entity.xml:1440
+#, no-c-format
+msgid ""
+"In this example, we only describe the entity member of the result set "
+"mapping. The property / column mappings is done using the entity mapping "
+"values. In this case the <literal>model</literal> property is bound to
the "
+"<literal>model_txt </literal>column. If the association to a related
entity "
+"involve a composite primary key, a <literal>@FieldResult</literal>
element "
+"should be used for each foreign key column. The
<literal>@FieldResult</"
+"literal> name is composed of the property name for the relationship, "
+"followed by a dot (\".\"), followed by the name or the field or property
of "
+"the primary key."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1450
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@SqlResultSetMapping(name=\"compositekey\",\n"
+" entities=(a)EntityResult(entityClass=org.hibernate.test.annotations."
+"query.SpaceShip.class,\n"
+" fields = {\n"
+" @FieldResult(name=\"name\", column =
\"name\"),\n"
+" @FieldResult(name=\"model\", column =
\"model\"),\n"
+" @FieldResult(name=\"speed\", column =
\"speed\"),\n"
+"<emphasis role=\"bold\">
@FieldResult(name=\"captain."
+"firstname\", column = \"firstn\"),\n"
+" @FieldResult(name=\"captain.lastname\", column =
\"lastn"
+"\"),</emphasis>\n"
+" @FieldResult(name=\"dimensions.length\", column =
"
+"\"length\"),\n"
+" @FieldResult(name=\"dimensions.width\", column =
\"width"
+"\")\n"
+" }),\n"
+" columns = { @ColumnResult(name = \"surface\"),\n"
+" @ColumnResult(name = \"volume\") } )\n"
+"\n"
+"@NamedNativeQuery(name=\"compositekey\",\n"
+" query=\"select name, model, speed, lname as lastn, fname as firstn,
"
+"length, width, length * width as surface from SpaceShip\", \n"
+" resultSetMapping=\"compositekey\")\n"
+"} )\n"
+"public class SpaceShip {\n"
+" private String name;\n"
+" private String model;\n"
+" private double speed;\n"
+" private Captain captain;\n"
+" private Dimensions dimensions;\n"
+"\n"
+" @Id\n"
+" public String getName() {\n"
+" return name;\n"
+" }\n"
+"\n"
+" public void setName(String name) {\n"
+" this.name = name;\n"
+" }\n"
+"\n"
+" @ManyToOne(fetch= FetchType.LAZY)\n"
+" @JoinColumns( {\n"
+" @JoinColumn(name=\"fname\", referencedColumnName =
\"firstname"
+"\"),\n"
+" @JoinColumn(name=\"lname\", referencedColumnName =
\"lastname"
+"\")\n"
+" } )\n"
+" public Captain getCaptain() {\n"
+" return captain;\n"
+" }\n"
+"\n"
+" public void setCaptain(Captain captain) {\n"
+" this.captain = captain;\n"
+" }\n"
+"\n"
+" public String getModel() {\n"
+" return model;\n"
+" }\n"
+"\n"
+" public void setModel(String model) {\n"
+" this.model = model;\n"
+" }\n"
+"\n"
+" public double getSpeed() {\n"
+" return speed;\n"
+" }\n"
+"\n"
+" public void setSpeed(double speed) {\n"
+" this.speed = speed;\n"
+" }\n"
+"\n"
+" public Dimensions getDimensions() {\n"
+" return dimensions;\n"
+" }\n"
+"\n"
+" public void setDimensions(Dimensions dimensions) {\n"
+" this.dimensions = dimensions;\n"
+" }\n"
+"}\n"
+"\n"
+"@Entity\n"
+"(a)IdClass(Identity.class)\n"
+"public class Captain implements Serializable {\n"
+" private String firstname;\n"
+" private String lastname;\n"
+"\n"
+" @Id\n"
+" public String getFirstname() {\n"
+" return firstname;\n"
+" }\n"
+"\n"
+" public void setFirstname(String firstname) {\n"
+" this.firstname = firstname;\n"
+" }\n"
+"\n"
+" @Id\n"
+" public String getLastname() {\n"
+" return lastname;\n"
+" }\n"
+"\n"
+" public void setLastname(String lastname) {\n"
+" this.lastname = lastname;\n"
+" }\n"
+"}"
+msgstr ""
+"@Entity\n"
+"@SqlResultSetMapping(name=\"compositekey\",\n"
+" entities=(a)EntityResult(entityClass=org.hibernate.test.annotations."
+"query.SpaceShip.class,\n"
+" fields = {\n"
+" @FieldResult(name=\"name\", column =
\"name\"),\n"
+" @FieldResult(name=\"model\", column =
\"model\"),\n"
+" @FieldResult(name=\"speed\", column =
\"speed\"),\n"
+"<emphasis role=\"bold\">
@FieldResult(name=\"captain."
+"firstname\", column = \"firstn\"),\n"
+" @FieldResult(name=\"captain.lastname\", column =
\"lastn"
+"\"),</emphasis>\n"
+" @FieldResult(name=\"dimensions.length\", column =
"
+"\"length\"),\n"
+" @FieldResult(name=\"dimensions.width\", column =
\"width"
+"\")\n"
+" }),\n"
+" columns = { @ColumnResult(name = \"surface\"),\n"
+" @ColumnResult(name = \"volume\") } )\n"
+"\n"
+"@NamedNativeQuery(name=\"compositekey\",\n"
+" query=\"select name, model, speed, lname as lastn, fname as firstn,
"
+"length, width, length * width as surface from SpaceShip\", \n"
+" resultSetMapping=\"compositekey\")\n"
+"} )\n"
+"public class SpaceShip {\n"
+" private String name;\n"
+" private String model;\n"
+" private double speed;\n"
+" private Captain captain;\n"
+" private Dimensions dimensions;\n"
+"\n"
+" @Id\n"
+" public String getName() {\n"
+" return name;\n"
+" }\n"
+"\n"
+" public void setName(String name) {\n"
+" this.name = name;\n"
+" }\n"
+"\n"
+" @ManyToOne(fetch= FetchType.LAZY)\n"
+" @JoinColumns( {\n"
+" @JoinColumn(name=\"fname\", referencedColumnName =
\"firstname"
+"\"),\n"
+" @JoinColumn(name=\"lname\", referencedColumnName =
\"lastname"
+"\")\n"
+" } )\n"
+" public Captain getCaptain() {\n"
+" return captain;\n"
+" }\n"
+"\n"
+" public void setCaptain(Captain captain) {\n"
+" this.captain = captain;\n"
+" }\n"
+"\n"
+" public String getModel() {\n"
+" return model;\n"
+" }\n"
+"\n"
+" public void setModel(String model) {\n"
+" this.model = model;\n"
+" }\n"
+"\n"
+" public double getSpeed() {\n"
+" return speed;\n"
+" }\n"
+"\n"
+" public void setSpeed(double speed) {\n"
+" this.speed = speed;\n"
+" }\n"
+"\n"
+" public Dimensions getDimensions() {\n"
+" return dimensions;\n"
+" }\n"
+"\n"
+" public void setDimensions(Dimensions dimensions) {\n"
+" this.dimensions = dimensions;\n"
+" }\n"
+"}\n"
+"\n"
+"@Entity\n"
+"(a)IdClass(Identity.class)\n"
+"public class Captain implements Serializable {\n"
+" private String firstname;\n"
+" private String lastname;\n"
+"\n"
+" @Id\n"
+" public String getFirstname() {\n"
+" return firstname;\n"
+" }\n"
+"\n"
+" public void setFirstname(String firstname) {\n"
+" this.firstname = firstname;\n"
+" }\n"
+"\n"
+" @Id\n"
+" public String getLastname() {\n"
+" return lastname;\n"
+" }\n"
+"\n"
+" public void setLastname(String lastname) {\n"
+" this.lastname = lastname;\n"
+" }\n"
+"}"
+
+#. Tag: para
+#: entity.xml:1453
+#, no-c-format
+msgid ""
+"If you look at the dimension property, you'll see that Hibernate supports
"
+"the dotted notation for embedded objects (you can even have nested embedded "
+"objects). EJB3 implementations do not have to support this feature, we do
:-)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1459
+#, no-c-format
+msgid ""
+"If you retrieve a single entity and if you use the default mapping, you can "
+"use the <literal>resultClass</literal> attribute instead of "
+"<literal>resultSetMapping</literal>:"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1463
+#, no-c-format
+msgid ""
+"<emphasis
role=\"bold\">@NamedNativeQuery(name=\"implicitSample\",
query="
+"\"select * from SpaceShip\", \n"
+" resultClass=SpaceShip.class)</emphasis>\n"
+"public class SpaceShip {"
+msgstr ""
+"<emphasis
role=\"bold\">@NamedNativeQuery(name=\"implicitSample\",
query="
+"\"select * from SpaceShip\", \n"
+" resultClass=SpaceShip.class)</emphasis>\n"
+"public class SpaceShip {"
+
+#. Tag: para
+#: entity.xml:1465
+#, no-c-format
+msgid ""
+"In some of your native queries, you'll have to return scalar values, for
"
+"example when building report queries. You can map them in the "
+"<literal>@SqlResultsetMapping</literal> through
<literal>@ColumnResult</"
+"literal>. You actually can even mix, entities and scalar returns in the same
"
+"native query (this is probably not that common though)."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1472
+#, no-c-format
+msgid ""
+"<emphasis
role=\"bold\">@SqlResultSetMapping(name=\"scalar\", "
+"columns=@ColumnResult(name=\"dimension\"))\n"
+"@NamedNativeQuery(name=\"scalar\", query=\"select length*width as
dimension "
+"from SpaceShip\",
resultSetMapping=\"scalar\")</emphasis>"
+msgstr ""
+"<emphasis
role=\"bold\">@SqlResultSetMapping(name=\"scalar\", "
+"columns=@ColumnResult(name=\"dimension\"))\n"
+"@NamedNativeQuery(name=\"scalar\", query=\"select length*width as
dimension "
+"from SpaceShip\",
resultSetMapping=\"scalar\")</emphasis>"
+
+#. Tag: para
+#: entity.xml:1474
+#, no-c-format
+msgid ""
+"An other query hint specific to native queries has been introduced: "
+"<literal>org.hibernate.callable</literal> which can be true or false
"
+"depending on whether the query is a stored procedure or not."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1482
+#, no-c-format
+msgid "Hibernate Annotation Extensions"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1484
+#, no-c-format
+msgid ""
+"Hibernate 3.1 offers a variety of additional annotations that you can mix/"
+"match with your EJB 3 entities. They have been designed as a natural "
+"extension of EJB3 annotations."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1488
+#, no-c-format
+msgid ""
+"To empower the EJB3 capabilities, hibernate provides specific annotations "
+"that match hibernate features. The
<classname>org.hibernate.annotations</"
+"classname> package contains all these annotations extensions."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1494
+#, no-c-format
+msgid "Entity"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1496
+#, no-c-format
+msgid ""
+"You can fine tune some of the actions done by Hibernate on entities beyond "
+"what the EJB3 spec offers."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1499
+#, no-c-format
+msgid ""
+"<classname>(a)org.hibernate.annotations.Entity</classname> adds
additional "
+"metadata that may be needed beyond what is defined in the standard "
+"<literal>@Entity</literal>"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1503
+#, no-c-format
+msgid "mutable: whether this entity is mutable or not"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1508
+#, no-c-format
+msgid "dynamicInsert: allow dynamic SQL for inserts"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1513
+#, no-c-format
+msgid "dynamicUpdate: allow dynamic SQL for updates"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1518
+#, no-c-format
+msgid ""
+"selectBeforeUpdate: Specifies that Hibernate should never perform an SQL "
+"UPDATE unless it is certain that an object is actually modified."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1523
+#, no-c-format
+msgid ""
+"polymorphism: whether the entity polymorphism is of PolymorphismType."
+"IMPLICIT (default) or PolymorphismType.EXPLICIT"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1528
+#, no-c-format
+msgid ""
+"optimisticLock: optimistic locking strategy (OptimisticLockType.VERSION, "
+"OptimisticLockType.NONE, OptimisticLockType.DIRTY or OptimisticLockType.ALL)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1534
+#, no-c-format
+msgid ""
+"(a)javax.persistence.Entity is still mandatory, @org.hibernate.annotations."
+"Entity is not a replacement."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1538
+#, no-c-format
+msgid "Here are some additional Hibernate annotation extensions"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1540
+#, no-c-format
+msgid ""
+"<literal>(a)org.hibernate.annotations.BatchSize</literal> allows you to
define "
+"the batch size when fetching instances of this entity ( eg. "
+"<literal>@BatchSize(size=4)</literal> ). When loading a given entity,
"
+"Hibernate will then load all the uninitialized entities of the same type in "
+"the persistence context up to the batch size."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1546
+#, no-c-format
+msgid ""
+"<literal>(a)org.hibernate.annotations.Proxy</literal> defines the
laziness "
+"attributes of the entity. lazy (default to true) define whether the class is
"
+"lazy or not. proxyClassName is the interface used to generate the proxy "
+"(default is the class itself)."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1551
+#, no-c-format
+msgid ""
+"<literal>(a)org.hibernate.annotations.Where</literal> defines an optional
SQL "
+"WHERE clause used when instances of this class is retrieved."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1555
+#, no-c-format
+msgid ""
+"<literal>(a)org.hibernate.annotations.Check</literal> defines an optional
"
+"check constraints defined in the DDL statetement."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1558
+#, no-c-format
+msgid ""
+"<literal>(a)OnDelete(action=OnDeleteAction.CASCADE)</literal> on joined
"
+"subclasses: use a SQL cascade delete on deletion instead of the regular "
+"Hibernate mechanism."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1562
+#, no-c-format
+msgid ""
+"<literal>@Table(appliesTo=\"tableName\", indexes = {
@Index(name=\"index1\", "
+"columnNames={\"column1\", \"column2\"} ) } )</literal>
creates the defined "
+"indexes on the columns of table <literal>tableName</literal>. This can
be "
+"applied on the primary table or any secondary table. The
<literal>@Tables</"
+"literal> annotation allows your to apply indexes on different tables. This
"
+"annotation is expected where
<literal>(a)javax.persistence.Table</literal> or "
+"<literal>(a)javax.persistence.SecondaryTable</literal>(s) occurs."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1572
+#, no-c-format
+msgid ""
+"<literal>(a)org.hibernate.annotations.Table</literal> is a complement,
not a "
+"replacement to <literal>(a)javax.persistence.Table</literal>. Especially,
if "
+"you want to change the default name of a table, you must use
<literal>(a)javax."
+"persistence.Table</literal>, not
<literal>(a)org.hibernate.annotations.Table</"
+"literal>."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1580
+#, no-c-format
+msgid ""
+"<literal>(a)org.hibernate.annotations.Table</literal> can also be used to
"
+"define the following elements of secondary tables:"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1585
+#, no-c-format
+msgid ""
+"<literal>fetch</literal>: If set to JOIN, the default, Hibernate will
use an "
+"inner join to retrieve a secondary table defined by a class or its "
+"superclasses and an outer join for a secondary table defined by a subclass. "
+"If set to select then Hibernate will use a sequential select for a secondary
"
+"table defined on a subclass, which will be issued only if a row turns out to
"
+"represent an instance of the subclass. Inner joins will still be used to "
+"retrieve a secondary defined by the class and its superclasses."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1597
+#, no-c-format
+msgid ""
+"<literal>inverse</literal>: If true, Hibernate will not try to insert
or "
+"update the properties defined by this join. Default to false."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1603
+#, no-c-format
+msgid ""
+"<literal>optional</literal>: If enabled (the default), Hibernate will
insert "
+"a row only if the properties defined by this join are non-null and will "
+"always use an outer join to retrieve the properties."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1610
+#, no-c-format
+msgid ""
+"<literal>foreignKey</literal>: defines the Foreign Key name of a
secondary "
+"table pointing back to the primary table."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1615
+#, no-c-format
+msgid ""
+"<literal>@Immutable</literal> marks an entity or collection as
immutable. An "
+"immutable entity may not be updated by the application. This allows "
+"Hibernate to make some minor performance optimizations. Updates to an "
+"immutable entity will be ignored, but no exception is thrown. "
+"<literal>@Immutable</literal> must be used on root entities only.
"
+"<literal>@Immutable</literal> placed on a collection makes the
collection "
+"immutable, meaning additions and deletions to and from the collection are "
+"not allowed. A <literal>HibernateException</literal> is thrown in this
case."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1625
+#, no-c-format
+msgid ""
+"<literal>@Persister</literal> lets you define your own custom
persistence "
+"strategy. You may, for example, specify your own subclass of
<classname>org."
+"hibernate.persister.EntityPersister</classname> or you might even provide a
"
+"completely new implementation of the interface <literal>org.hibernate."
+"persister.ClassPersister</literal> that implements persistence via, for
"
+"example, stored procedure calls, serialization to flat files or LDAP."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1633
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@BatchSize(size=5)\n"
+"(a)org.hibernate.annotations.Entity(\n"
+" selectBeforeUpdate = true,\n"
+" dynamicInsert = true, dynamicUpdate = true,\n"
+" optimisticLock = OptimisticLockType.ALL,\n"
+" polymorphism = PolymorphismType.EXPLICIT)\n"
+"@Where(clause=\"1=1\")\n"
+"(a)org.hibernate.annotations.Table(name=\"Forest\", indexes = {
@Index(name="
+"\"idx\", columnNames = { \"name\", \"length\" } ) }
)\n"
+"(a)Persister(impl=MyEntityPersister.class)\n"
+"public class Forest { ... }"
+msgstr ""
+"@Entity\n"
+"@BatchSize(size=5)\n"
+"(a)org.hibernate.annotations.Entity(\n"
+" selectBeforeUpdate = true,\n"
+" dynamicInsert = true, dynamicUpdate = true,\n"
+" optimisticLock = OptimisticLockType.ALL,\n"
+" polymorphism = PolymorphismType.EXPLICIT)\n"
+"@Where(clause=\"1=1\")\n"
+"(a)org.hibernate.annotations.Table(name=\"Forest\", indexes = {
@Index(name="
+"\"idx\", columnNames = { \"name\", \"length\" } ) }
)\n"
+"(a)Persister(impl=MyEntityPersister.class)\n"
+"public class Forest { ... }"
+
+#. Tag: programlisting
+#: entity.xml:1633
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Inheritance(\n"
+" strategy=InheritanceType.JOINED\n"
+")\n"
+"public class Vegetable { ... }\n"
+"\n"
+"@Entity\n"
+"(a)OnDelete(action=OnDeleteAction.CASCADE)\n"
+"public class Carrot extends Vegetable { ... }"
+msgstr ""
+"@Entity\n"
+"@Inheritance(\n"
+" strategy=InheritanceType.JOINED\n"
+")\n"
+"public class Vegetable { ... }\n"
+"\n"
+"@Entity\n"
+"(a)OnDelete(action=OnDeleteAction.CASCADE)\n"
+"public class Carrot extends Vegetable { ... }"
+
+#. Tag: title
+#: entity.xml:1637
+#, no-c-format
+msgid "Identifier"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1639
+#, no-c-format
+msgid ""
+"Hibernate Annotations goes beyond the Java Persistence specification when "
+"defining identifiers."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1643
+#, no-c-format
+msgid "Generators"
+msgstr ""
+
+#. Tag: literal
+#: entity.xml:1645
+#, no-c-format
+msgid ""
+"<literal>(a)org.hibernate.annotations.GenericGenerator</literal> and
"
+"<literal>(a)org.hibernate.annotations.GenericGenerators</literal> allows
you "
+"to define an Hibernate specific id generator."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1650
+#, no-c-format
+msgid ""
+"@Id @GeneratedValue(generator=\"system-uuid\")\n"
+"@GenericGenerator(name=\"system-uuid\", strategy =
\"uuid\")\n"
+"public String getId() {\n"
+"\n"
+"@Id @GeneratedValue(generator=\"hibseq\")\n"
+"@GenericGenerator(name=\"hibseq\", strategy =
\"seqhilo\",\n"
+" parameters = {\n"
+" @Parameter(name=\"max_lo\", value = \"5\"),\n"
+" @Parameter(name=\"sequence\",
value=\"heybabyhey\")\n"
+" }\n"
+")\n"
+"public Integer getId() {"
+msgstr ""
+"@Id @GeneratedValue(generator=\"system-uuid\")\n"
+"@GenericGenerator(name=\"system-uuid\", strategy =
\"uuid\")\n"
+"public String getId() {\n"
+"\n"
+"@Id @GeneratedValue(generator=\"hibseq\")\n"
+"@GenericGenerator(name=\"hibseq\", strategy =
\"seqhilo\",\n"
+" parameters = {\n"
+" @Parameter(name=\"max_lo\", value = \"5\"),\n"
+" @Parameter(name=\"sequence\",
value=\"heybabyhey\")\n"
+" }\n"
+")\n"
+"public Integer getId() {"
+
+#. Tag: para
+#: entity.xml:1652
+#, no-c-format
+msgid ""
+"<literal>strategy</literal> is the short name of an Hibernate3
generator "
+"strategy or the fully qualified class name of an "
+"<classname>IdentifierGenerator</classname> implementation. You can add
some "
+"parameters through the <literal>parameters</literal> attribute."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1658
+#, no-c-format
+msgid ""
+"Contrary to their standard counterpart,
<literal>@GenericGenerator</literal> "
+"and <literal>@GenericGenerators</literal> can be used in package level
"
+"annotations, making them application level generators (just like if they "
+"were in a JPA XML file)."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1664
+#, no-c-format
+msgid ""
+"@GenericGenerators(\n"
+" {\n"
+" @GenericGenerator(\n"
+" name=\"hibseq\",\n"
+" strategy = \"seqhilo\",\n"
+" parameters = {\n"
+" @Parameter(name=\"max_lo\", value =
\"5\"),\n"
+" @Parameter(name=\"sequence\",
value=\"heybabyhey\")\n"
+" }\n"
+" ),\n"
+" @GenericGenerator(...)\n"
+" }\n"
+")\n"
+"package org.hibernate.test.model"
+msgstr ""
+"@GenericGenerators(\n"
+" {\n"
+" @GenericGenerator(\n"
+" name=\"hibseq\",\n"
+" strategy = \"seqhilo\",\n"
+" parameters = {\n"
+" @Parameter(name=\"max_lo\", value =
\"5\"),\n"
+" @Parameter(name=\"sequence\",
value=\"heybabyhey\")\n"
+" }\n"
+" ),\n"
+" @GenericGenerator(...)\n"
+" }\n"
+")\n"
+"package org.hibernate.test.model"
+
+#. Tag: title
+#: entity.xml:1668
+#, no-c-format
+msgid "@NaturalId"
+msgstr "@NaturalId"
+
+#. Tag: para
+#: entity.xml:1670
+#, no-c-format
+msgid ""
+"While not used as identifier property, some (group of) properties represent "
+"natural identifier of an entity. This is especially true when the schema "
+"uses the recommended approach of using surrogate primary key even if a "
+"natural business key exists. Hibernate allows to map such natural properties
"
+"and reuse them in a <classname>Criteria</classname> query. The natural
"
+"identifier is composed of all the properties marked
<classname>@NaturalId</"
+"classname>."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1679
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Citizen {\n"
+" @Id\n"
+" @GeneratedValue\n"
+" private Integer id;\n"
+" private String firstname;\n"
+" private String lastname;\n"
+" \n"
+" @NaturalId\n"
+" @ManyToOne\n"
+" private State state;\n"
+"\n"
+" @NaturalId\n"
+" private String ssn;\n"
+" ...\n"
+"}\n"
+"\n"
+"\n"
+"\n"
+"//and later on query\n"
+"List results = s.createCriteria( Citizen.class )\n"
+" .add( Restrictions.naturalId().set( \"ssn\",
\"1234\" ).set"
+"( \"state\", ste ) )\n"
+" .list();"
+msgstr ""
+"@Entity\n"
+"public class Citizen {\n"
+" @Id\n"
+" @GeneratedValue\n"
+" private Integer id;\n"
+" private String firstname;\n"
+" private String lastname;\n"
+" \n"
+" @NaturalId\n"
+" @ManyToOne\n"
+" private State state;\n"
+"\n"
+" @NaturalId\n"
+" private String ssn;\n"
+" ...\n"
+"}\n"
+"\n"
+"\n"
+"\n"
+"//and later on query\n"
+"List results = s.createCriteria( Citizen.class )\n"
+" .add( Restrictions.naturalId().set( \"ssn\",
\"1234\" ).set"
+"( \"state\", ste ) )\n"
+" .list();"
+
+#. Tag: para
+#: entity.xml:1681
+#, no-c-format
+msgid ""
+"Note that the group of properties representing the natural identifier have "
+"to be unique (Hibernate will generate a unique constraint if the database "
+"schema is generated)."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1688
+#, no-c-format
+msgid "Property"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1691
+#, no-c-format
+msgid "Access type"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1693
+#, no-c-format
+msgid ""
+"The access type is guessed from the position of <literal>@Id</literal>
or "
+"<literal>@EmbeddedId</literal> in the entity hierarchy. Sub-entities,
"
+"embedded objects and mapped superclass inherit the access type from the root
"
+"entity."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1698
+#, no-c-format
+msgid "In Hibernate, you can override the access type to:"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1702
+#, no-c-format
+msgid "use a custom access type strategy"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1706
+#, no-c-format
+msgid "fine tune the access type at the class level or at the property level"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1711
+#, no-c-format
+msgid ""
+"An @AccessType annotation has been introduced to support this behavior. You "
+"can define the access type on"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1716
+#, no-c-format
+msgid "an entity"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1720
+#, no-c-format
+msgid "a superclass"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1724
+#, no-c-format
+msgid "an embeddable object"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1728
+#, no-c-format
+msgid "a property"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1732
+#, no-c-format
+msgid ""
+"The access type is overriden for the annotated element, if overriden on a "
+"class, all the properties of the given class inherit the access type. For "
+"root entities, the access type is considered to be the default one for the "
+"whole hierarchy (overridable at class or property level)."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1738
+#, no-c-format
+msgid ""
+"If the access type is marked as \"property\", the getters are scanned for
"
+"annotations, if the access type is marked as \"field\", the fields are
"
+"scanned for annotations. Otherwise the elements marked with @Id or "
+"@embeddedId are scanned."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1743
+#, no-c-format
+msgid ""
+"You can override an access type for a property, but the element to annotate "
+"will not be influenced: for example an entity having access type "
+"<literal>field</literal>, can annotate a field with
<literal>@AccessType"
+"(\"property\")</literal>, the access type will then be property for
this "
+"attribute, the the annotations still have to be carried on the field."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1750
+#, no-c-format
+msgid ""
+"If a superclass or an embeddable object is not annotated, the root entity "
+"access type is used (even if an access type has been define on an "
+"intermediate superclass or embeddable object). The russian doll principle "
+"does not apply."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1755
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Person implements Serializable {\n"
+" @Id @GeneratedValue //access type field\n"
+" Integer id;\n"
+"\n"
+" @Embedded\n"
+" @AttributeOverrides({\n"
+" @AttributeOverride(name = \"iso2\", column = @Column(name =
\"bornIso2"
+"\")),\n"
+" @AttributeOverride(name = \"name\", column = @Column(name = "
+"\"bornCountryName\"))\n"
+" })\n"
+" Country bornIn;\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"<emphasis
role=\"bold\">@AccessType(\"property\")</emphasis> //override
"
+"access type for all properties in Country\n"
+"public class Country implements Serializable {\n"
+" private String iso2;\n"
+" private String name;\n"
+"\n"
+" public String getIso2() {\n"
+" return iso2;\n"
+" }\n"
+"\n"
+" public void setIso2(String iso2) {\n"
+" this.iso2 = iso2;\n"
+" }\n"
+"\n"
+" @Column(name = \"countryName\")\n"
+" public String getName() {\n"
+" return name;\n"
+" }\n"
+"\n"
+" public void setName(String name) {\n"
+" this.name = name;\n"
+" }\n"
+"}"
+msgstr ""
+"@Entity\n"
+"public class Person implements Serializable {\n"
+" @Id @GeneratedValue //access type field\n"
+" Integer id;\n"
+"\n"
+" @Embedded\n"
+" @AttributeOverrides({\n"
+" @AttributeOverride(name = \"iso2\", column = @Column(name =
\"bornIso2"
+"\")),\n"
+" @AttributeOverride(name = \"name\", column = @Column(name = "
+"\"bornCountryName\"))\n"
+" })\n"
+" Country bornIn;\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"<emphasis
role=\"bold\">@AccessType(\"property\")</emphasis> //override
"
+"access type for all properties in Country\n"
+"public class Country implements Serializable {\n"
+" private String iso2;\n"
+" private String name;\n"
+"\n"
+" public String getIso2() {\n"
+" return iso2;\n"
+" }\n"
+"\n"
+" public void setIso2(String iso2) {\n"
+" this.iso2 = iso2;\n"
+" }\n"
+"\n"
+" @Column(name = \"countryName\")\n"
+" public String getName() {\n"
+" return name;\n"
+" }\n"
+"\n"
+" public void setName(String name) {\n"
+" this.name = name;\n"
+" }\n"
+"}"
+
+#. Tag: title
+#: entity.xml:1759
+#, no-c-format
+msgid "Formula"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1761
+#, no-c-format
+msgid ""
+"Sometimes, you want the Database to do some computation for you rather than "
+"in the JVM, you might also create some kind of virtual column. You can use a
"
+"SQL fragment (aka formula) instead of mapping a property into a column. This
"
+"kind of property is read only (its value is calculated by your formula "
+"fragment)."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1767
+#, no-c-format
+msgid ""
+"@Formula(\"obj_length * obj_height * obj_width\")\n"
+"public long getObjectVolume()"
+msgstr ""
+"@Formula(\"obj_length * obj_height * obj_width\")\n"
+"public long getObjectVolume()"
+
+#. Tag: para
+#: entity.xml:1769
+#, no-c-format
+msgid "The SQL fragment can be as complex as you want and even include
subselects."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1774
+#, no-c-format
+msgid "Type"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1776
+#, no-c-format
+msgid ""
+"<literal>(a)org.hibernate.annotations.Type</literal> overrides the
default "
+"hibernate type used: this is generally not necessary since the type is "
+"correctly inferred by Hibernate. Please refer to the Hibernate reference "
+"guide for more informations on the Hibernate types."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1781
+#, no-c-format
+msgid ""
+"<literal>(a)org.hibernate.annotations.TypeDef</literal> and
<literal>(a)org."
+"hibernate.annotations.TypeDefs</literal> allows you to declare type "
+"definitions. These annotations can be placed at the class or package level. "
+"Note that these definitions are be global for the session factory (even when
"
+"defined at the class level). Type definitions have to be defined before any "
+"usage. If the type is used on a single entity, you can plance the definition
"
+"on the entity itself. Otherwise, it is recommended to place the definition a
"
+"the package level since the entity processing order is not guaranteed."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1790
+#, no-c-format
+msgid ""
+"Package level annotations are placed in a file named
<filename>package-info."
+"java</filename> in the appropriate package. Place your annotations before
"
+"the package declaration."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1793
+#, no-c-format
+msgid ""
+"//in org/hibernate/test/annotations/entity/package-info.java\n"
+"@TypeDefs(\n"
+" {\n"
+" @TypeDef(\n"
+" name=\"caster\",\n"
+" typeClass = CasterStringType.class,\n"
+" parameters = {\n"
+" @Parameter(name=\"cast\", value=\"lower\")\n"
+" }\n"
+" )\n"
+" }\n"
+")\n"
+"package org.hibernate.test.annotations.entity;\n"
+"\n"
+"//in org/hibernate/test/annotations/entity/Forest.java\n"
+"public class Forest {\n"
+" @Type(type=\"caster\")\n"
+" public String getSmallText() {\n"
+" ...\n"
+"}"
+msgstr ""
+"//in org/hibernate/test/annotations/entity/package-info.java\n"
+"@TypeDefs(\n"
+" {\n"
+" @TypeDef(\n"
+" name=\"caster\",\n"
+" typeClass = CasterStringType.class,\n"
+" parameters = {\n"
+" @Parameter(name=\"cast\", value=\"lower\")\n"
+" }\n"
+" )\n"
+" }\n"
+")\n"
+"package org.hibernate.test.annotations.entity;\n"
+"\n"
+"//in org/hibernate/test/annotations/entity/Forest.java\n"
+"public class Forest {\n"
+" @Type(type=\"caster\")\n"
+" public String getSmallText() {\n"
+" ...\n"
+"}"
+
+#. Tag: para
+#: entity.xml:1795
+#, no-c-format
+msgid ""
+"When using composite user type, you will have to express column definitions.
"
+"The <literal>@Columns</literal> has been introduced for that
purpose."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1799
+#, no-c-format
+msgid ""
+"(a)Type(type=\"org.hibernate.test.annotations.entity.MonetaryAmountUserType"
+"\")\n"
+"@Columns(columns = {\n"
+" @Column(name=\"r_amount\"),\n"
+" @Column(name=\"r_currency\")\n"
+"})\n"
+"public MonetaryAmount getAmount() {\n"
+" return amount;\n"
+"}\n"
+"\n"
+"\n"
+"public class MonetaryAmount implements Serializable {\n"
+" private BigDecimal amount;\n"
+" private Currency currency;\n"
+" ...\n"
+"}"
+msgstr ""
+"(a)Type(type=\"org.hibernate.test.annotations.entity.MonetaryAmountUserType"
+"\")\n"
+"@Columns(columns = {\n"
+" @Column(name=\"r_amount\"),\n"
+" @Column(name=\"r_currency\")\n"
+"})\n"
+"public MonetaryAmount getAmount() {\n"
+" return amount;\n"
+"}\n"
+"\n"
+"\n"
+"public class MonetaryAmount implements Serializable {\n"
+" private BigDecimal amount;\n"
+" private Currency currency;\n"
+" ...\n"
+"}"
+
+#. Tag: title
+#: entity.xml:1803
+#, no-c-format
+msgid "Index"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1805
+#, no-c-format
+msgid ""
+"You can define an index on a particular column using the
<literal>@Index</"
+"literal> annotation on a one column property, the columnNames attribute will
"
+"then be ignored"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1809
+#, no-c-format
+msgid ""
+"@Column(secondaryTable=\"Cat1\")\n"
+"@Index(name=\"story1index\")\n"
+"public String getStoryPart1() {\n"
+" return storyPart1;\n"
+"}"
+msgstr ""
+"@Column(secondaryTable=\"Cat1\")\n"
+"@Index(name=\"story1index\")\n"
+"public String getStoryPart1() {\n"
+" return storyPart1;\n"
+"}"
+
+#. Tag: title
+#: entity.xml:1813
+#, no-c-format
+msgid "@Parent"
+msgstr "@Parent"
+
+#. Tag: para
+#: entity.xml:1815
+#, no-c-format
+msgid ""
+"When inside an embeddable object, you can define one of the properties as a "
+"pointer back to the owner element."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1818
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Person {\n"
+" @Embeddable public Address address;\n"
+" ...\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"public class Address {\n"
+" @Parent public Person owner;\n"
+" ...\n"
+"}\n"
+"\n"
+"\n"
+"person == person.address.owner"
+msgstr ""
+"@Entity\n"
+"public class Person {\n"
+" @Embeddable public Address address;\n"
+" ...\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"public class Address {\n"
+" @Parent public Person owner;\n"
+" ...\n"
+"}\n"
+"\n"
+"\n"
+"person == person.address.owner"
+
+#. Tag: title
+#: entity.xml:1822
+#, no-c-format
+msgid "Generated properties"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1824
+#, no-c-format
+msgid ""
+"Some properties are generated at insert or update time by your database. "
+"Hibernate can deal with such properties and triggers a subsequent select to "
+"read these properties."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1828
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Antenna {\n"
+" @Id public Integer id;\n"
+" @Generated(GenerationTime.ALWAYS) @Column(insertable = false, updatable "
+"= false)\n"
+" public String longitude;\n"
+"\n"
+" @Generated(GenerationTime.INSERT) @Column(insertable = false)\n"
+" public String latitude;\n"
+"}"
+msgstr ""
+"@Entity\n"
+"public class Antenna {\n"
+" @Id public Integer id;\n"
+" @Generated(GenerationTime.ALWAYS) @Column(insertable = false, updatable "
+"= false)\n"
+" public String longitude;\n"
+"\n"
+" @Generated(GenerationTime.INSERT) @Column(insertable = false)\n"
+" public String latitude;\n"
+"}"
+
+#. Tag: para
+#: entity.xml:1830
+#, no-c-format
+msgid ""
+"Annotate your property as <literal>@Generated</literal> You have to
make "
+"sure your insertability or updatability does not conflict with the "
+"generation strategy you have chosen. When GenerationTime.INSERT is chosen, "
+"the property must not contains insertable columns, when GenerationTime."
+"ALWAYS is chosen, the property must not contains insertable nor updatable "
+"columns."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1837
+#, no-c-format
+msgid ""
+"<literal>@Version</literal> properties cannot be
<literal>@Generated(INSERT)"
+"</literal> by design, it has to be either
<literal>NEVER</literal> or "
+"<literal>ALWAYS</literal>."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1843
+#, no-c-format
+msgid "@Target"
+msgstr "@Target"
+
+#. Tag: para
+#: entity.xml:1845
+#, no-c-format
+msgid ""
+"Sometimes, the type guessed by reflection is not the one you want Hibernate "
+"to use. This is especially true on components when an interface is used. You
"
+"can use <literal>@Target</literal> to by pass the reflection guessing
"
+"mechanism (very much like the <literal>targetEntity</literal> attribute
"
+"available on associations."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1852
+#, no-c-format
+msgid ""
+"@Embedded\n"
+" <emphasis
role=\"bold\">(a)Target(OwnerImpl.class)</emphasis>\n"
+" public Owner getOwner() {\n"
+" return owner;\n"
+" }"
+msgstr ""
+"@Embedded\n"
+" <emphasis
role=\"bold\">(a)Target(OwnerImpl.class)</emphasis>\n"
+" public Owner getOwner() {\n"
+" return owner;\n"
+" }"
+
+#. Tag: title
+#: entity.xml:1858
+#, no-c-format
+msgid "Optimistic lock"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1860
+#, no-c-format
+msgid ""
+"It is sometimes useful to avoid increasing the version number even if a "
+"given property is dirty (particularly collections). You can do that by "
+"annotating the property (or collection) with <literal>@OptimisticLock"
+"(excluded=true)</literal>."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1865
+#, no-c-format
+msgid ""
+"More formally, specifies that updates to this property do not require "
+"acquisition of the optimistic lock."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1871
+#, no-c-format
+msgid "Inheritance"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1873
+#, no-c-format
+msgid ""
+"SINGLE_TABLE is a very powerful strategy but sometimes, and especially for "
+"legacy systems, you cannot add an additional discriminator column. For that "
+"purpose Hibernate has introduced the notion of discriminator formula: "
+"<literal>@DiscriminatorFormula</literal> is a replacement of "
+"<literal>@DiscriminatorColumn</literal> and use a SQL fragment as a
formula "
+"for discriminator resolution (no need to have a dedicated column)."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1882
+#, no-c-format
+msgid ""
+"@Entity\n"
+"<emphasis role=\"bold\">@DiscriminatorFormula(\"case when
forest_type is "
+"null then 0 else forest_type end\")</emphasis>\n"
+"public class Forest { ... }"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1884
+#, no-c-format
+msgid ""
+"By default, when querying the top entities, Hibernate does not put a "
+"restriction clause on the discriminator column. This can be inconvenient if "
+"this column contains values not mapped in your hierarchy (through "
+"<literal>@DiscriminatorValue</literal>). To work around that you can
use "
+"<literal>@ForceDiscriminator</literal> (at the class level, next to
"
+"<literal>@DiscriminatorColumn</literal>). Hibernate will then list the
"
+"available values when loading the entities."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1892
+#, no-c-format
+msgid ""
+"You can define the foreign key name generated by Hibernate for subclass "
+"tables in the JOINED inheritance strategy."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1895
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Inheritance(strategy = InheritanceType.JOINED)\n"
+"public abstract class File { ... }\n"
+"\n"
+"@Entity\n"
+"@ForeignKey(name = \"FK_DOCU_FILE\")\n"
+"public class Document extends File {"
+msgstr ""
+"@Entity\n"
+"@Inheritance(strategy = InheritanceType.JOINED)\n"
+"public abstract class File { ... }\n"
+"\n"
+"@Entity\n"
+"@ForeignKey(name = \"FK_DOCU_FILE\")\n"
+"public class Document extends File {"
+
+#. Tag: para
+#: entity.xml:1897
+#, no-c-format
+msgid ""
+"The foreign key from the <literal>Document</literal> table to the
"
+"<literal>File</literal> table will be named
<literal>FK_DOCU_FILE</literal>."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1903
+#, no-c-format
+msgid "Single Association related annotations"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1905
+#, no-c-format
+msgid ""
+"By default, when Hibernate cannot resolve the association because the "
+"expected associated element is not in database (wrong id on the association "
+"column), an exception is raised by Hibernate. This might be inconvenient for
"
+"legacy and badly maintained schemas. You can ask Hibernate to ignore such "
+"elements instead of raising an exception using the
<literal>@NotFound</"
+"literal> annotation. This annotation can be used on a
<literal>@OneToOne</"
+"literal> (with FK), <literal>@ManyToOne</literal>,
<literal>@OneToMany</"
+"literal> or <literal>@ManyToMany</literal> association."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1915
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Child {\n"
+" ...\n"
+" @ManyToOne\n"
+" @NotFound(action=NotFoundAction.IGNORE)\n"
+" public Parent getParent() { ... }\n"
+" ...\n"
+"}"
+msgstr ""
+"@Entity\n"
+"public class Child {\n"
+" ...\n"
+" @ManyToOne\n"
+" @NotFound(action=NotFoundAction.IGNORE)\n"
+" public Parent getParent() { ... }\n"
+" ...\n"
+"}"
+
+#. Tag: para
+#: entity.xml:1917
+#, no-c-format
+msgid ""
+"Sometimes you want to delegate to your database the deletion of cascade when
"
+"a given entity is deleted."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1920
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Child {\n"
+" ...\n"
+" @ManyToOne\n"
+" @OnDelete(action=OnDeleteAction.CASCADE)\n"
+" public Parent getParent() { ... }\n"
+" ...\n"
+"}"
+msgstr ""
+"@Entity\n"
+"public class Child {\n"
+" ...\n"
+" @ManyToOne\n"
+" @OnDelete(action=OnDeleteAction.CASCADE)\n"
+" public Parent getParent() { ... }\n"
+" ...\n"
+"}"
+
+#. Tag: para
+#: entity.xml:1922
+#, no-c-format
+msgid ""
+"In this case Hibernate generates a cascade delete constraint at the database
"
+"level."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1925
+#, no-c-format
+msgid ""
+"Foreign key constraints, while generated by Hibernate, have a fairly "
+"unreadable name. You can override the constraint name by use "
+"<literal>(a)ForeignKey</literal>."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1929
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Child {\n"
+" ...\n"
+" @ManyToOne\n"
+" <emphasis
role=\"bold\">@ForeignKey(name=\"FK_PARENT\")</emphasis>\n"
+" public Parent getParent() { ... }\n"
+" ...\n"
+"}\n"
+"\n"
+"alter table Child add constraint FK_PARENT foreign key (parent_id) "
+"references Parent"
+msgstr ""
+"@Entity\n"
+"public class Child {\n"
+" ...\n"
+" @ManyToOne\n"
+" <emphasis
role=\"bold\">@ForeignKey(name=\"FK_PARENT\")</emphasis>\n"
+" public Parent getParent() { ... }\n"
+" ...\n"
+"}\n"
+"\n"
+"alter table Child add constraint FK_PARENT foreign key (parent_id) "
+"references Parent"
+
+#. Tag: title
+#: entity.xml:1932
+#, no-c-format
+msgid "Lazy options and fetching modes"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1934
+#, no-c-format
+msgid ""
+"EJB3 comes with the <literal>fetch</literal> option to define lazy
loading "
+"and fetching modes, however Hibernate has a much more option set in this "
+"area. To fine tune the lazy loading and fetching strategies, some additional
"
+"annotations have been introduced:"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1941
+#, no-c-format
+msgid ""
+"<literal>@LazyToOne</literal>: defines the lazyness option on "
+"<literal>@ManyToOne</literal> and
<literal>@OneToOne</literal> associations. "
+"<literal>LazyToOneOption</literal> can be
<literal>PROXY</literal> (ie use a "
+"proxy based lazy loading), <literal>NO_PROXY</literal> (use a bytecode
"
+"enhancement based lazy loading - note that build time bytecode processing is
"
+"necessary) and <literal>FALSE</literal> (association not lazy)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1951
+#, no-c-format
+msgid ""
+"<literal>@LazyCollection</literal>: defines the lazyness option on
"
+"<literal>@ManyTo</literal>Many and
<literal>@OneToMany</literal> "
+"associations. LazyCollectionOption can be <literal>TRUE</literal> (the
"
+"collection is lazy and will be loaded when its state is accessed), "
+"<literal>EXTRA</literal> (the collection is lazy and all operations
will try "
+"to avoid the collection loading, this is especially useful for huge "
+"collections when loading all the elements is not necessary) and FALSE "
+"(association not lazy)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1963
+#, no-c-format
+msgid ""
+"<literal>@Fetch</literal>: defines the fetching strategy used to load
the "
+"association. <literal>FetchMode</literal> can be
<literal>SELECT</literal> "
+"(a select is triggered when the association needs to be loaded), "
+"<literal>SUBSELECT</literal> (only available for collections, use a
"
+"subselect strategy - please refers to the Hibernate Reference Documentation "
+"for more information) or <literal>JOIN</literal> (use a SQL JOIN to
load the "
+"association while loading the owner entity). <literal>JOIN</literal>
"
+"overrides any lazy attribute (an association loaded through a
<literal>JOIN</"
+"literal> strategy cannot be lazy)."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1977
+#, no-c-format
+msgid "The Hibernate annotations overrides the EJB3 fetching options."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1981
+#, no-c-format
+msgid "Lazy and fetch options equivalent"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1986
+#, no-c-format
+msgid "Annotations"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1988
+#, no-c-format
+msgid "Lazy"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1990
+#, no-c-format
+msgid "Fetch"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1996
+#, no-c-format
+msgid "(a)[One|Many]ToOne](fetch=FetchType.LAZY)"
+msgstr "(a)[One|Many]ToOne](fetch=FetchType.LAZY)"
+
+#. Tag: entry
+#: entity.xml:1998
+#, no-c-format
+msgid "@LazyToOne(PROXY)"
+msgstr "@LazyToOne(PROXY)"
+
+#. Tag: entry
+#: entity.xml:2000 entity.xml:2016
+#, no-c-format
+msgid "@Fetch(SELECT)"
+msgstr "@Fetch(SELECT)"
+
+#. Tag: entry
+#: entity.xml:2004
+#, no-c-format
+msgid "(a)[One|Many]ToOne](fetch=FetchType.EAGER)"
+msgstr "(a)[One|Many]ToOne](fetch=FetchType.EAGER)"
+
+#. Tag: entry
+#: entity.xml:2006
+#, no-c-format
+msgid "@LazyToOne(FALSE)"
+msgstr "@LazyToOne(FALSE)"
+
+#. Tag: entry
+#: entity.xml:2008 entity.xml:2024
+#, no-c-format
+msgid "@Fetch(JOIN)"
+msgstr "@Fetch(JOIN)"
+
+#. Tag: entry
+#: entity.xml:2012
+#, no-c-format
+msgid "(a)ManyTo[One|Many](fetch=FetchType.LAZY)"
+msgstr "(a)ManyTo[One|Many](fetch=FetchType.LAZY)"
+
+#. Tag: entry
+#: entity.xml:2014
+#, no-c-format
+msgid "@LazyCollection(TRUE)"
+msgstr "@LazyCollection(TRUE)"
+
+#. Tag: entry
+#: entity.xml:2020
+#, no-c-format
+msgid "(a)ManyTo[One|Many](fetch=FetchType.EAGER)"
+msgstr "(a)ManyTo[One|Many](fetch=FetchType.EAGER)"
+
+#. Tag: entry
+#: entity.xml:2022
+#, no-c-format
+msgid "@LazyCollection(FALSE)"
+msgstr "@LazyCollection(FALSE)"
+
+#. Tag: title
+#: entity.xml:2032
+#, no-c-format
+msgid "@Any"
+msgstr "@Any"
+
+#. Tag: para
+#: entity.xml:2034
+#, no-c-format
+msgid ""
+"The <classname>@Any</classname> annotation defines a polymorphic
association "
+"to classes from multiple tables. This type of mapping always requires more "
+"than one column. The first column holds the type of the associated entity. "
+"The remaining columns hold the identifier. It is impossible to specify a "
+"foreign key constraint for this kind of association, so this is most "
+"certainly not meant as the usual way of mapping (polymorphic) associations. "
+"You should use this only in very special cases (eg. audit logs, user session
"
+"data, etc)."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2043
+#, no-c-format
+msgid ""
+"The @Any annotation describes the column holding the metadata information. "
+"To link the value of the metadata information and an actual entity type, The
"
+"<classname>@AnyDef</classname> and
<classname>@AnyDefs</classname> "
+"annotations are used."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2048
+#, no-c-format
+msgid ""
+"@Any( metaColumn = @Column( name = \"property_type\" ),
fetch=FetchType."
+"EAGER )\n"
+" @AnyMetaDef( \n"
+" idType = \"integer\", \n"
+" metaType = \"string\", \n"
+" metaValues = {\n"
+" @MetaValue( value = \"S\", targetEntity =
StringProperty."
+"class ),\n"
+" @MetaValue( value = \"I\", targetEntity =
IntegerProperty."
+"class )\n"
+" } )\n"
+" @JoinColumn( name = \"property_id\" )\n"
+" public Property getMainProperty() {\n"
+" return mainProperty;\n"
+" }"
+msgstr ""
+"@Any( metaColumn = @Column( name = \"property_type\" ),
fetch=FetchType."
+"EAGER )\n"
+" @AnyMetaDef( \n"
+" idType = \"integer\", \n"
+" metaType = \"string\", \n"
+" metaValues = {\n"
+" @MetaValue( value = \"S\", targetEntity =
StringProperty."
+"class ),\n"
+" @MetaValue( value = \"I\", targetEntity =
IntegerProperty."
+"class )\n"
+" } )\n"
+" @JoinColumn( name = \"property_id\" )\n"
+" public Property getMainProperty() {\n"
+" return mainProperty;\n"
+" }"
+
+#. Tag: para
+#: entity.xml:2050
+#, no-c-format
+msgid ""
+"<methodname>idType</methodname> represents the target entities
identifier "
+"property type and <methodname>metaType</methodname> the metadata type
"
+"(usually String)."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2054
+#, no-c-format
+msgid ""
+"Note that <classname>@AnyDef</classname> can be mutualized and reused.
It is "
+"recommended to place it as a package metadata in this case."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2058
+#, no-c-format
+msgid ""
+"//on a package\n"
+"@AnyMetaDef( name=\"property\" \n"
+" idType = \"integer\", \n"
+" metaType = \"string\", \n"
+" metaValues = {\n"
+" @MetaValue( value = \"S\", targetEntity = StringProperty.class
),\n"
+" @MetaValue( value = \"I\", targetEntity = IntegerProperty.class
)\n"
+" } )\n"
+"package org.hibernate.test.annotations.any;\n"
+"\n"
+"\n"
+"//in a class\n"
+" @Any( metaDef=\"property\", metaColumn = @Column( name =
\"property_type"
+"\" ), fetch=FetchType.EAGER )\n"
+" @JoinColumn( name = \"property_id\" )\n"
+" public Property getMainProperty() {\n"
+" return mainProperty;\n"
+" }"
+msgstr ""
+"//on a package\n"
+"@AnyMetaDef( name=\"property\" \n"
+" idType = \"integer\", \n"
+" metaType = \"string\", \n"
+" metaValues = {\n"
+" @MetaValue( value = \"S\", targetEntity = StringProperty.class
),\n"
+" @MetaValue( value = \"I\", targetEntity = IntegerProperty.class
)\n"
+" } )\n"
+"package org.hibernate.test.annotations.any;\n"
+"\n"
+"\n"
+"//in a class\n"
+" @Any( metaDef=\"property\", metaColumn = @Column( name =
\"property_type"
+"\" ), fetch=FetchType.EAGER )\n"
+" @JoinColumn( name = \"property_id\" )\n"
+" public Property getMainProperty() {\n"
+" return mainProperty;\n"
+" }"
+
+#. Tag: title
+#: entity.xml:2063
+#, no-c-format
+msgid "Collection related annotations"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:2066
+#, no-c-format
+msgid "Enhance collection settings"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2068
+#, no-c-format
+msgid "It is possible to set"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2070
+#, no-c-format
+msgid "the batch size for collections using @BatchSize"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2075
+#, no-c-format
+msgid ""
+"the where clause, using @Where (applied on the target entity) or "
+"@WhereJoinTable (applied on the association table)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2080
+#, no-c-format
+msgid "the check clause, using @Check"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2085
+#, no-c-format
+msgid "the SQL order by clause, using @OrderBy"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2090
+#, no-c-format
+msgid "the delete cascade strategy through
@OnDelete(action=OnDeleteAction.CASCADE)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2095
+#, no-c-format
+msgid ""
+"the collection immutability using @Immutable: if set specifies that the "
+"elements of the collection never change (a minor performance optimization in
"
+"some cases)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2100
+#, no-c-format
+msgid ""
+"a custom collection persister (ie the persistence strategy used) using "
+"<literal>@Persister</literal>: the class must implement
<classname>org."
+"hibernate.persister.collectionCollectionPersister</classname>"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2107
+#, no-c-format
+msgid ""
+"You can also declare a sort comparator. Use the
<literal>@Sort</literal> "
+"annotation. Expressing the comparator type you want between unsorted, "
+"natural or custom comparator. If you want to use your own comparator "
+"implementation, you'll also have to express the implementation class using
"
+"the <literal>comparator</literal> attribute. Note that you need to use
"
+"either a <classname>SortedSet</classname> or a
<classname>SortedMap</"
+"classname> interface."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2116
+#, no-c-format
+msgid ""
+"(a)OneToMany(cascade=CascadeType.ALL, fetch=FetchType.EAGER)\n"
+" @JoinColumn(name=\"CUST_ID\")\n"
+" @Sort(type = SortType.COMPARATOR, comparator = TicketComparator.class)\n"
+" @Where(clause=\"1=1\")\n"
+" @OnDelete(action=OnDeleteAction.CASCADE)\n"
+" public SortedSet<Ticket> getTickets() {\n"
+" return tickets;\n"
+" }"
+msgstr ""
+"(a)OneToMany(cascade=CascadeType.ALL, fetch=FetchType.EAGER)\n"
+" @JoinColumn(name=\"CUST_ID\")\n"
+" @Sort(type = SortType.COMPARATOR, comparator = TicketComparator.class)\n"
+" @Where(clause=\"1=1\")\n"
+" @OnDelete(action=OnDeleteAction.CASCADE)\n"
+" public SortedSet<Ticket> getTickets() {\n"
+" return tickets;\n"
+" }"
+
+#. Tag: para
+#: entity.xml:2118
+#, no-c-format
+msgid ""
+"Please refer to the previous descriptions of these annotations for more "
+"informations."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2121
+#, no-c-format
+msgid ""
+"Foreign key constraints, while generated by Hibernate, have a fairly "
+"unreadable name. You can override the constraint name by use "
+"<literal>@ForeignKey</literal>. Note that this annotation has to be
placed "
+"on the owning side of the relationship, <literal>inverseName</literal>
"
+"referencing to the other side constraint."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2128
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Woman {\n"
+" ...\n"
+" @ManyToMany(cascade = {CascadeType.ALL})\n"
+" <emphasis role=\"bold\">@ForeignKey(name =
\"TO_WOMAN_FK\", inverseName "
+"= \"TO_MAN_FK\")</emphasis>\n"
+" public Set<Man> getMens() {\n"
+" return mens;\n"
+" }\n"
+"}\n"
+"\n"
+"alter table Man_Woman add constraint TO_WOMAN_FK foreign key (woman_id) "
+"references Woman\n"
+"alter table Man_Woman add constraint TO_MAN_FK foreign key (man_id) "
+"references Man"
+msgstr ""
+"@Entity\n"
+"public class Woman {\n"
+" ...\n"
+" @ManyToMany(cascade = {CascadeType.ALL})\n"
+" <emphasis role=\"bold\">@ForeignKey(name =
\"TO_WOMAN_FK\", inverseName "
+"= \"TO_MAN_FK\")</emphasis>\n"
+" public Set<Man> getMens() {\n"
+" return mens;\n"
+" }\n"
+"}\n"
+"\n"
+"alter table Man_Woman add constraint TO_WOMAN_FK foreign key (woman_id) "
+"references Woman\n"
+"alter table Man_Woman add constraint TO_MAN_FK foreign key (man_id) "
+"references Man"
+
+#. Tag: title
+#: entity.xml:2132
+#, no-c-format
+msgid "Extra collection types"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:2135
+#, no-c-format
+msgid "List"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2137
+#, no-c-format
+msgid ""
+"Beyond EJB3, Hibernate Annotations supports true
<classname>List</classname> "
+"and <classname>Array</classname>. Map your collection the same way as
usual "
+"and add the @<literal>IndexColumn</literal>. This annotation allows you
to "
+"describe the column that will hold the index. You can also declare the index
"
+"value in DB that represent the first element (aka as base index). The usual "
+"value is <literal>0</literal> or
<literal>1</literal>."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2146
+#, no-c-format
+msgid ""
+"@OneToMany(cascade = CascadeType.ALL)\n"
+"@IndexColumn(name = \"drawer_position\", base=1)\n"
+"public List<Drawer> getDrawers() {\n"
+" return drawers;\n"
+"}"
+msgstr ""
+"@OneToMany(cascade = CascadeType.ALL)\n"
+"@IndexColumn(name = \"drawer_position\", base=1)\n"
+"public List<Drawer> getDrawers() {\n"
+" return drawers;\n"
+"}"
+
+#. Tag: para
+#: entity.xml:2149
+#, no-c-format
+msgid ""
+"If you forgot to set <literal>@IndexColumn</literal>, the bag semantic
is "
+"applied. If you want the bag semantic without the limitations of it, "
+"consider using <literal>(a)CollectionId</literal>."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:2157
+#, no-c-format
+msgid "<title>Map</title>"
+msgstr "<title>Map</title>"
+
+#. Tag: para
+#: entity.xml:2159
+#, no-c-format
+msgid ""
+"Hibernate Annotations also supports true Map mappings, if
<literal>(a)javax."
+"persistence.MapKey</literal> is not set, hibernate will map the key element
"
+"or embeddable object in its/their own columns. To override the default "
+"columns, you can use
<literal>(a)org.hibernate.annotations.MapKey</literal> if "
+"your key is a basic type (defaulted to <literal>mapkey</literal>) or an
"
+"embeddable object, or you can use <literal>(a)org.hibernate.annotations."
+"MapKeyManyToMany</literal> if your key is an entity."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2169
+#, no-c-format
+msgid ""
+"Both <literal>(a)org.hibernate.annotations.MapKey</literal> and
<literal>(a)org."
+"hibernate.annotations.MapKeyManyToMany</literal> allows you to override the
"
+"target element to be used. This is especially useful if your collection does
"
+"not use generics (or if you use interfaces)."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2175
+#, no-c-format
+msgid ""
+"@CollectionOfElements(targetElement = SizeImpl.class)\n"
+" @MapKeyManyToMany(<emphasis role=\"bold\">targetEntity =
LuggageImpl."
+"class</emphasis>)\n"
+" private Map<Luggage, Size> sizePerLuggage = new
HashMap<"
+"Luggage, Size>();"
+msgstr ""
+"@CollectionOfElements(targetElement = SizeImpl.class)\n"
+" @MapKeyManyToMany(<emphasis role=\"bold\">targetEntity =
LuggageImpl."
+"class</emphasis>)\n"
+" private Map<Luggage, Size> sizePerLuggage = new
HashMap<"
+"Luggage, Size>();"
+
+#. Tag: title
+#: entity.xml:2182
+#, no-c-format
+msgid "Bidirectional association with indexed collections"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2184
+#, no-c-format
+msgid ""
+"A bidirectional association where one end is an indexed collection (ie. "
+"represented as a <literal>@IndexColumn</literal>,
<literal>(a)org.hibernate."
+"annotations.MapKey</literal> or
<classname>(a)org.hibernate.annotations."
+"MapKeyManyToMany</classname>) requires special consideration. If a property
"
+"on the associated class explicitly maps the indexed value, the use of "
+"<methodname>mappedBy</methodname> is permitted:"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2192
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Parent {\n"
+" @OneToMany(mappedBy=\"parent\")\n"
+" @org.hibernate.annotations.IndexColumn(name=\"order\")\n"
+" private List<Child> children;\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Child {\n"
+" ...\n"
+" //the index column is mapped as a property in the associated entity\n"
+" @Column(name=\"order\")\n"
+" private int order;\n"
+"\n"
+" @ManyToOne\n"
+" @JoinColumn(name=\"parent_id\", nullable=false)\n"
+" private Parent parent;\n"
+" ...\n"
+"}"
+msgstr ""
+"@Entity\n"
+"public class Parent {\n"
+" @OneToMany(mappedBy=\"parent\")\n"
+" @org.hibernate.annotations.IndexColumn(name=\"order\")\n"
+" private List<Child> children;\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Child {\n"
+" ...\n"
+" //the index column is mapped as a property in the associated entity\n"
+" @Column(name=\"order\")\n"
+" private int order;\n"
+"\n"
+" @ManyToOne\n"
+" @JoinColumn(name=\"parent_id\", nullable=false)\n"
+" private Parent parent;\n"
+" ...\n"
+"}"
+
+#. Tag: para
+#: entity.xml:2194
+#, no-c-format
+msgid ""
+"But, if there is no such property on the child class, we can't think of the
"
+"association as truly bidirectional (there is information available at one "
+"end of the association that is not available at the other end: the index). "
+"In this case, we can't map the collection as
<literal>mappedBy</literal>. "
+"Instead, we could use the following mapping:"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2201
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Parent {\n"
+" @OneToMany\n"
+" @org.hibernate.annotations.IndexColumn(name=\"order\")\n"
+" @JoinColumn(name=\"parent_id\", nullable=false)\n"
+" private List<Child> children;\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Child {\n"
+" ...\n"
+" @ManyToOne\n"
+" @JoinColumn(name=\"parent_id\", insertable=false, updatable=false,
"
+"nullable=false)\n"
+" private Parent parent;\n"
+" ...\n"
+"}"
+msgstr ""
+"@Entity\n"
+"public class Parent {\n"
+" @OneToMany\n"
+" @org.hibernate.annotations.IndexColumn(name=\"order\")\n"
+" @JoinColumn(name=\"parent_id\", nullable=false)\n"
+" private List<Child> children;\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Child {\n"
+" ...\n"
+" @ManyToOne\n"
+" @JoinColumn(name=\"parent_id\", insertable=false, updatable=false,
"
+"nullable=false)\n"
+" private Parent parent;\n"
+" ...\n"
+"}"
+
+#. Tag: para
+#: entity.xml:2203
+#, no-c-format
+msgid ""
+"Note that in this mapping, the collection-valued end of the association is "
+"responsible for updating the foreign key."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:2208
+#, no-c-format
+msgid "Bag with primary key"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2210
+#, no-c-format
+msgid ""
+"Another interesting feature is the ability to define a surrogate primary key
"
+"to a bag collection. This remove pretty much all of the drawbacks of bags: "
+"update and removal are efficient, more than one
<literal>EAGER</literal> bag "
+"per query or per entity. This primary key will be contained in a additional "
+"column of your collection table but will not be visible to the Java "
+"application. @CollectionId is used to mark a collection as id bag, it also "
+"allow to override the primary key column(s), the primary key type and the "
+"generator strategy. The strategy can be <literal>identity</literal>, or
any "
+"defined generator name of your application."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2221
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@TableGenerator(name=\"ids_generator\", table=\"IDS\")\n"
+"public class Passport {\n"
+" ...\n"
+"\n"
+" @ManyToMany(cascade = CascadeType.ALL)\n"
+" @JoinTable(name=\"PASSPORT_VISASTAMP\")\n"
+" <emphasis role=\"bold\">@CollectionId(\n"
+" columns = @Column(name=\"COLLECTION_ID\"), \n"
+" type=@Type(type=\"long\"), \n"
+" generator = \"ids_generator\"\n"
+" )</emphasis>\n"
+" private Collection<Stamp> visaStamp = new ArrayList();\n"
+" ...\n"
+"}"
+msgstr ""
+"@Entity\n"
+"@TableGenerator(name=\"ids_generator\", table=\"IDS\")\n"
+"public class Passport {\n"
+" ...\n"
+"\n"
+" @ManyToMany(cascade = CascadeType.ALL)\n"
+" @JoinTable(name=\"PASSPORT_VISASTAMP\")\n"
+" <emphasis role=\"bold\">@CollectionId(\n"
+" columns = @Column(name=\"COLLECTION_ID\"), \n"
+" type=@Type(type=\"long\"), \n"
+" generator = \"ids_generator\"\n"
+" )</emphasis>\n"
+" private Collection<Stamp> visaStamp = new ArrayList();\n"
+" ...\n"
+"}"
+
+#. Tag: title
+#: entity.xml:2225
+#, no-c-format
+msgid "Collection of element or composite elements"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2227
+#, no-c-format
+msgid ""
+"Hibernate Annotations also supports collections of core types (Integer, "
+"String, Enums, ...), collections of embeddable objects and even arrays of "
+"primitive types. This is known as collection of elements."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2232
+#, no-c-format
+msgid ""
+"A collection of elements has to be annotated as "
+"<literal>@CollectionOfElements</literal> (as a replacement of "
+"<literal>@OneToMany</literal>) To define the collection table, the
"
+"<literal>@JoinTable</literal> annotation is used on the association
"
+"property, <literal>joinColumns</literal> defines the join columns
between "
+"the entity primary table and the collection table (inverseJoincolumn is "
+"useless and should be left empty). For collection of core types or array of "
+"primitive types, you can override the element column definition using a "
+"<literal>@Column</literal> on the association property. You can also
"
+"override the columns of a collection of embeddable object using "
+"<literal>@AttributeOverride</literal>. To reach the collection element,
you "
+"need to append \"element\" to the attribute override name (eg
\"element\" "
+"for core types, or \"element.serial\" for the serial property of an
"
+"embeddable element). To reach the index/key of a collection, append
\"key\" "
+"instead."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2249
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Boy {\n"
+" private Integer id;\n"
+" private Set<String> nickNames = new
HashSet<String>();\n"
+" private int[] favoriteNumbers;\n"
+" private Set<Toy> favoriteToys = new
HashSet<Toy>();\n"
+" private Set<Character> characters = new
HashSet<Character>"
+"();\n"
+"\n"
+" @Id @GeneratedValue\n"
+" public Integer getId() {\n"
+" return id;\n"
+" }\n"
+"\n"
+" <emphasis role=\"bold\">@CollectionOfElements\n"
+" public Set<String></emphasis> getNickNames() {\n"
+" return nickNames;\n"
+" }\n"
+"\n"
+" <emphasis role=\"bold\">@CollectionOfElements\n"
+" @JoinTable(\n"
+" table=@Table(name=\"BoyFavoriteNumbers\"),\n"
+" joinColumns = @JoinColumn(name=\"BoyId\")\n"
+" )\n"
+" @Column(name=\"favoriteNumber\",
nullable=false)</emphasis>\n"
+" @IndexColumn(name=\"nbr_index\")\n"
+" public int[] getFavoriteNumbers() {\n"
+" return favoriteNumbers;\n"
+" }\n"
+"\n"
+" <emphasis role=\"bold\">@CollectionOfElements\n"
+" @AttributeOverride( name=\"element.serial\",
column=@Column(name="
+"\"serial_nbr\") )</emphasis>\n"
+" public Set<Toy> getFavoriteToys() {\n"
+" return favoriteToys;\n"
+" }\n"
+"\n"
+" <emphasis role=\"bold\">@CollectionOfElements\n"
+" public Set<Character></emphasis> getCharacters() {\n"
+" return characters;\n"
+" }\n"
+" ...\n"
+"}\n"
+"\n"
+"public enum Character {\n"
+" GENTLE,\n"
+" NORMAL,\n"
+" AGGRESSIVE,\n"
+" ATTENTIVE,\n"
+" VIOLENT,\n"
+" CRAFTY\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"public class Toy {\n"
+" public String name;\n"
+" public String serial;\n"
+" public Boy owner;\n"
+"\n"
+" public String getName() {\n"
+" return name;\n"
+" }\n"
+"\n"
+" public void setName(String name) {\n"
+" this.name = name;\n"
+" }\n"
+"\n"
+" public String getSerial() {\n"
+" return serial;\n"
+" }\n"
+"\n"
+" public void setSerial(String serial) {\n"
+" this.serial = serial;\n"
+" }\n"
+"\n"
+" <emphasis role=\"bold\">@Parent</emphasis>\n"
+" public Boy getOwner() {\n"
+" return owner;\n"
+" }\n"
+"\n"
+" public void setOwner(Boy owner) {\n"
+" this.owner = owner;\n"
+" }\n"
+"\n"
+" public boolean equals(Object o) {\n"
+" if ( this == o ) return true;\n"
+" if ( o == null || getClass() != o.getClass() ) return false;\n"
+"\n"
+" final Toy toy = (Toy) o;\n"
+"\n"
+" if ( !name.equals( toy.name ) ) return false;\n"
+" if ( !serial.equals( toy.serial ) ) return false;\n"
+"\n"
+" return true;\n"
+" }\n"
+"\n"
+" public int hashCode() {\n"
+" int result;\n"
+" result = name.hashCode();\n"
+" result = 29 * result + serial.hashCode();\n"
+" return result;\n"
+" }\n"
+"}"
+msgstr ""
+"@Entity\n"
+"public class Boy {\n"
+" private Integer id;\n"
+" private Set<String> nickNames = new
HashSet<String>();\n"
+" private int[] favoriteNumbers;\n"
+" private Set<Toy> favoriteToys = new
HashSet<Toy>();\n"
+" private Set<Character> characters = new
HashSet<Character>"
+"();\n"
+"\n"
+" @Id @GeneratedValue\n"
+" public Integer getId() {\n"
+" return id;\n"
+" }\n"
+"\n"
+" <emphasis role=\"bold\">@CollectionOfElements\n"
+" public Set<String></emphasis> getNickNames() {\n"
+" return nickNames;\n"
+" }\n"
+"\n"
+" <emphasis role=\"bold\">@CollectionOfElements\n"
+" @JoinTable(\n"
+" table=@Table(name=\"BoyFavoriteNumbers\"),\n"
+" joinColumns = @JoinColumn(name=\"BoyId\")\n"
+" )\n"
+" @Column(name=\"favoriteNumber\",
nullable=false)</emphasis>\n"
+" @IndexColumn(name=\"nbr_index\")\n"
+" public int[] getFavoriteNumbers() {\n"
+" return favoriteNumbers;\n"
+" }\n"
+"\n"
+" <emphasis role=\"bold\">@CollectionOfElements\n"
+" @AttributeOverride( name=\"element.serial\",
column=@Column(name="
+"\"serial_nbr\") )</emphasis>\n"
+" public Set<Toy> getFavoriteToys() {\n"
+" return favoriteToys;\n"
+" }\n"
+"\n"
+" <emphasis role=\"bold\">@CollectionOfElements\n"
+" public Set<Character></emphasis> getCharacters() {\n"
+" return characters;\n"
+" }\n"
+" ...\n"
+"}\n"
+"\n"
+"public enum Character {\n"
+" GENTLE,\n"
+" NORMAL,\n"
+" AGGRESSIVE,\n"
+" ATTENTIVE,\n"
+" VIOLENT,\n"
+" CRAFTY\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"public class Toy {\n"
+" public String name;\n"
+" public String serial;\n"
+" public Boy owner;\n"
+"\n"
+" public String getName() {\n"
+" return name;\n"
+" }\n"
+"\n"
+" public void setName(String name) {\n"
+" this.name = name;\n"
+" }\n"
+"\n"
+" public String getSerial() {\n"
+" return serial;\n"
+" }\n"
+"\n"
+" public void setSerial(String serial) {\n"
+" this.serial = serial;\n"
+" }\n"
+"\n"
+" <emphasis role=\"bold\">@Parent</emphasis>\n"
+" public Boy getOwner() {\n"
+" return owner;\n"
+" }\n"
+"\n"
+" public void setOwner(Boy owner) {\n"
+" this.owner = owner;\n"
+" }\n"
+"\n"
+" public boolean equals(Object o) {\n"
+" if ( this == o ) return true;\n"
+" if ( o == null || getClass() != o.getClass() ) return false;\n"
+"\n"
+" final Toy toy = (Toy) o;\n"
+"\n"
+" if ( !name.equals( toy.name ) ) return false;\n"
+" if ( !serial.equals( toy.serial ) ) return false;\n"
+"\n"
+" return true;\n"
+" }\n"
+"\n"
+" public int hashCode() {\n"
+" int result;\n"
+" result = name.hashCode();\n"
+" result = 29 * result + serial.hashCode();\n"
+" return result;\n"
+" }\n"
+"}"
+
+#. Tag: para
+#: entity.xml:2251
+#, no-c-format
+msgid ""
+"On a collection of embeddable objects, the embeddable object can have a "
+"property annotated with <literal>@Parent</literal>. This property will
then "
+"point back to the entity containing the collection."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2257
+#, no-c-format
+msgid ""
+"Previous versions of Hibernate Annotations used the
<literal>@OneToMany</"
+"literal> to mark a collection of elements. Due to semantic inconsistencies,
"
+"we've introduced the annotation
<literal>@CollectionOfElements</literal>. "
+"Marking collections of elements the old way still work but is considered "
+"deprecated and is going to be unsupported in future releases"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:2267
+#, no-c-format
+msgid "@ManyToAny"
+msgstr "@ManyToAny"
+
+#. Tag: para
+#: entity.xml:2269
+#, no-c-format
+msgid ""
+"<classname>@ManyToAny</classname> allows polymorphic associations to
classes "
+"from multiple tables. This type of mapping always requires more than one "
+"column. The first column holds the type of the associated entity. The "
+"remaining columns hold the identifier. It is impossible to specify a foreign
"
+"key constraint for this kind of association, so this is most certainly not "
+"meant as the usual way of mapping (polymorphic) associations. You should use
"
+"this only in very special cases (eg. audit logs, user session data, etc)."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2279
+#, no-c-format
+msgid ""
+"@ManyToAny(\n"
+" metaColumn = @Column( name = \"property_type\" ) )\n"
+" @AnyMetaDef( \n"
+" idType = \"integer\", \n"
+" metaType = \"string\",\n"
+" metaValues = {\n"
+" @MetaValue( value = \"S\", targetEntity =
StringProperty."
+"class ),\n"
+" @MetaValue( value = \"I\", targetEntity =
IntegerProperty."
+"class ) } )\n"
+" @Cascade( { org.hibernate.annotations.CascadeType.ALL } )\n"
+" @JoinTable( name = \"obj_properties\", joinColumns = @JoinColumn(
name = "
+"\"obj_id\" ),\n"
+" inverseJoinColumns = @JoinColumn( name = \"property_id\" )
)\n"
+" public List<Property> getGeneralProperties() {"
+msgstr ""
+"@ManyToAny(\n"
+" metaColumn = @Column( name = \"property_type\" ) )\n"
+" @AnyMetaDef( \n"
+" idType = \"integer\", \n"
+" metaType = \"string\",\n"
+" metaValues = {\n"
+" @MetaValue( value = \"S\", targetEntity =
StringProperty."
+"class ),\n"
+" @MetaValue( value = \"I\", targetEntity =
IntegerProperty."
+"class ) } )\n"
+" @Cascade( { org.hibernate.annotations.CascadeType.ALL } )\n"
+" @JoinTable( name = \"obj_properties\", joinColumns = @JoinColumn(
name = "
+"\"obj_id\" ),\n"
+" inverseJoinColumns = @JoinColumn( name = \"property_id\" )
)\n"
+" public List<Property> getGeneralProperties() {"
+
+#. Tag: para
+#: entity.xml:2281
+#, no-c-format
+msgid ""
+"Like <classname>@Any</classname>,
<classname>@ManyToAny</classname> can use "
+"named <classname>@AnyDef</classname>s, see <xref
linkend=\"entity-hibspec-"
+"singleassoc-any\"/> for more info."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:2290
+#, no-c-format
+msgid "Cascade"
+msgstr "Cascade"
+
+#. Tag: para
+#: entity.xml:2292
+#, no-c-format
+msgid ""
+"Hibernate offers more operations than the Java Persistence specification. "
+"You can use the <literal>@Cascade</literal> annotation to cascade the
"
+"following operations:"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2298
+#, no-c-format
+msgid "PERSIST"
+msgstr "PERSIST"
+
+#. Tag: para
+#: entity.xml:2302
+#, no-c-format
+msgid "MERGE"
+msgstr "MERGE"
+
+#. Tag: para
+#: entity.xml:2306
+#, no-c-format
+msgid "REMOVE"
+msgstr "REMOVE"
+
+#. Tag: para
+#: entity.xml:2310
+#, no-c-format
+msgid "REFRESH"
+msgstr "REFRESH"
+
+#. Tag: para
+#: entity.xml:2314
+#, no-c-format
+msgid "DELETE"
+msgstr "DELETE"
+
+#. Tag: para
+#: entity.xml:2318
+#, no-c-format
+msgid "SAVE_UPDATE"
+msgstr "SAVE_UPDATE"
+
+#. Tag: para
+#: entity.xml:2322
+#, no-c-format
+msgid "REPLICATE"
+msgstr "REPLICATE"
+
+#. Tag: para
+#: entity.xml:2326
+#, no-c-format
+msgid "DELETE_ORPHAN"
+msgstr "DELETE_ORPHAN"
+
+#. Tag: para
+#: entity.xml:2330
+#, no-c-format
+msgid "LOCK"
+msgstr "LOCK"
+
+#. Tag: para
+#: entity.xml:2334
+#, no-c-format
+msgid "EVICT"
+msgstr "EVICT"
+
+#. Tag: para
+#: entity.xml:2338
+#, no-c-format
+msgid ""
+"This is especially useful for <literal>SAVE_UPDATE</literal> (which is
the "
+"operation cascaded at flush time if you use plain Hibernate Annotations - "
+"Hibernate EntityManager cascade <literal>PERSIST</literal> at flush
time as "
+"per the specification). DELETE_ORPHAN applies only to
<literal>@OneToMany</"
+"literal> associations, and indicates that the
<methodname>delete()/remove()</"
+"methodname> operation should be applied to any child object that is removed
"
+"from the association. In other words, if a child is dereferenced by a "
+"persistent parent and if <literal>DELETE_ORPHAN</literal> is used, the
"
+"\"orphaned\" child is deleted."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2350
+#, no-c-format
+msgid ""
+"@OneToMany( cascade = {CascadeType.PERSIST, CascadeType.MERGE}
<emphasis\n"
+" role=\"bold\">)\n"
+"(a)Cascade({org.hibernate.annotations.CascadeType.SAVE_UPDATE,\n"
+"
org.hibernate.annotations.CascadeType.DELETE_ORPHAN})</emphasis>\n"
+"public Collection<Employer> getEmployers()"
+msgstr ""
+"@OneToMany( cascade = {CascadeType.PERSIST, CascadeType.MERGE}
<emphasis\n"
+" role=\"bold\">)\n"
+"(a)Cascade({org.hibernate.annotations.CascadeType.SAVE_UPDATE,\n"
+"
org.hibernate.annotations.CascadeType.DELETE_ORPHAN})</emphasis>\n"
+"public Collection<Employer> getEmployers()"
+
+#. Tag: para
+#: entity.xml:2352
+#, no-c-format
+msgid ""
+"It is recommended to use @Cascade to compliment @*To*(cascade=...) as shown "
+"in the previous example."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:2357
+#, no-c-format
+msgid "Cache"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2359
+#, no-c-format
+msgid ""
+"In order to optimize your database accesses, you can activate the so called "
+"second level cache of Hibernate. This cache is configurable on a per entity "
+"and per collection basis."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2363
+#, no-c-format
+msgid ""
+"<literal>(a)org.hibernate.annotations.Cache</literal> defines the caching
"
+"strategy and region of a given second level cache. This annotation can be "
+"applied on the root entity (not the sub entities), and on the collections."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2368
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)\n"
+"public class Forest { ... }"
+msgstr ""
+"@Entity\n"
+"@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)\n"
+"public class Forest { ... }"
+
+#. Tag: programlisting
+#: entity.xml:2370
+#, no-c-format
+msgid ""
+"(a)OneToMany(cascade=CascadeType.ALL, fetch=FetchType.EAGER)\n"
+" @JoinColumn(name=\"CUST_ID\")\n"
+" @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)\n"
+" public SortedSet<Ticket> getTickets() {\n"
+" return tickets;\n"
+" }"
+msgstr ""
+"(a)OneToMany(cascade=CascadeType.ALL, fetch=FetchType.EAGER)\n"
+" @JoinColumn(name=\"CUST_ID\")\n"
+" @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)\n"
+" public SortedSet<Ticket> getTickets() {\n"
+" return tickets;\n"
+" }"
+
+#. Tag: programlisting
+#: entity.xml:2383
+#, no-c-format
+msgid ""
+"@Cache(\n"
+" CacheConcurrencyStrategy usage();\n"
+" String region() default \"\";\n"
+" String include() default \"all\";\n"
+")"
+msgstr ""
+"@Cache(\n"
+" CacheConcurrencyStrategy usage();\n"
+" String region() default \"\";\n"
+" String include() default \"all\";\n"
+")"
+
+#. Tag: para
+#: entity.xml:2387
+#, no-c-format
+msgid ""
+"usage: the given cache concurrency strategy (NONE, READ_ONLY, "
+"NONSTRICT_READ_WRITE, READ_WRITE, TRANSACTIONAL)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2392
+#, no-c-format
+msgid ""
+"region (optional): the cache region (default to the fqcn of the class or the
"
+"fq role name of the collection)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2397
+#, no-c-format
+msgid ""
+"<literal>include</literal> (optional): all to include all properties,
non-"
+"lazy to only include non lazy properties (default all)."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:2406
+#, no-c-format
+msgid "Filters"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2408
+#, no-c-format
+msgid ""
+"Hibernate has the ability to apply arbitrary filters on top of your data. "
+"Those filters are applied at runtime on a given session. First, you need to "
+"define them."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2412
+#, no-c-format
+msgid ""
+"<literal>(a)org.hibernate.annotations.FilterDef</literal> or "
+"<literal>@FilterDefs</literal> define filter definition(s) used by
filter(s) "
+"using the same name. A filter definition has a name() and an array of "
+"parameters(). A parameter will allow you to adjust the behavior of the "
+"filter at runtime. Each parameter is defined by a
<literal>@ParamDef</"
+"literal> which has a name and a type. You can also define a
defaultCondition"
+"() parameter for a given <literal>@FilterDef</literal> to set the
default "
+"condition to use when none are defined in each individual
<literal>@Filter</"
+"literal>. A <literal>@FilterDef</literal>(s) can be defined at the
class or "
+"package level."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2424
+#, no-c-format
+msgid ""
+"We now need to define the SQL filter clause applied to either the entity "
+"load or the collection load. <literal>@Filter</literal> is used and
placed "
+"either on the entity or the collection element"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2428
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@FilterDef(name=\"minLength\", parameters=@ParamDef(
name=\"minLength\", "
+"type=\"integer\" ) )\n"
+"@Filters( {\n"
+" @Filter(name=\"betweenLength\", condition=\":minLength <=
length and :"
+"maxLength >= length\"),\n"
+" @Filter(name=\"minLength\", condition=\":minLength <=
length\")\n"
+"} )\n"
+"public class Forest { ... }"
+msgstr ""
+"@Entity\n"
+"@FilterDef(name=\"minLength\", parameters=@ParamDef(
name=\"minLength\", "
+"type=\"integer\" ) )\n"
+"@Filters( {\n"
+" @Filter(name=\"betweenLength\", condition=\":minLength <=
length and :"
+"maxLength >= length\"),\n"
+" @Filter(name=\"minLength\", condition=\":minLength <=
length\")\n"
+"} )\n"
+"public class Forest { ... }"
+
+#. Tag: para
+#: entity.xml:2430
+#, no-c-format
+msgid ""
+"When the collection use an association table as a relational representation,
"
+"you might want to apply the filter condition to the association table itself
"
+"or to the target entity table. To apply the constraint on the target entity,
"
+"use the regular <literal>@Filter</literal> annotation. However, if you
wan "
+"to target the association table, use the
<literal>@FilterJoinTable</literal> "
+"annotation."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2438
+#, no-c-format
+msgid ""
+"@OneToMany\n"
+" @JoinTable\n"
+" //filter on the target entity table\n"
+" @Filter(name=\"betweenLength\", condition=\":minLength <=
length and :"
+"maxLength >= length\")\n"
+" //filter on the association table\n"
+" @FilterJoinTable(name=\"security\", condition=\":userlevel
>= "
+"requredLevel\")\n"
+" public Set<Forest> getForests() { ... }"
+msgstr ""
+"@OneToMany\n"
+" @JoinTable\n"
+" //filter on the target entity table\n"
+" @Filter(name=\"betweenLength\", condition=\":minLength <=
length and :"
+"maxLength >= length\")\n"
+" //filter on the association table\n"
+" @FilterJoinTable(name=\"security\", condition=\":userlevel
>= "
+"requredLevel\")\n"
+" public Set<Forest> getForests() { ... }"
+
+#. Tag: title
+#: entity.xml:2442
+#, no-c-format
+msgid "Queries"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2444
+#, no-c-format
+msgid ""
+"Since Hibernate has more features on named queries than the one defined in "
+"the EJB3 specification,
<literal>(a)org.hibernate.annotations.NamedQuery</"
+"literal>,
<literal>(a)org.hibernate.annotations.NamedQueries</literal>, "
+"<literal>(a)org.hibernate.annotations.NamedNativeQuery</literal> and
"
+"<literal>(a)org.hibernate.annotations.NamedNativeQueries</literal> have
been "
+"introduced. They add some attributes to the standard version and can be used
"
+"as a replacement:"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2455
+#, no-c-format
+msgid "flushMode: define the query flush mode (Always, Auto, Commit or
Manual)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2460
+#, no-c-format
+msgid "cacheable: whether the query should be cached or not"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2464
+#, no-c-format
+msgid "cacheRegion: cache region used if the query is cached"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2468
+#, no-c-format
+msgid "fetchSize: JDBC statement fetch size for this query"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2472
+#, no-c-format
+msgid "timeout: query time out"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2476
+#, no-c-format
+msgid "callable: for native queries only, to be set to true for stored
procedures"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2481
+#, no-c-format
+msgid ""
+"comment: if comments are activated, the comment seen when the query is sent "
+"to the database."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2486
+#, no-c-format
+msgid "cacheMode: Cache interaction mode (get, ignore, normal, put or
refresh)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2491
+#, no-c-format
+msgid ""
+"readOnly: whether or not the elements retrievent from the query are in read "
+"only mode."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2496
+#, no-c-format
+msgid ""
+"Those hints can be set in a standard
<literal>(a)javax.persistence.NamedQuery</"
+"literal> annotations through the detyped
<literal>@QueryHint</literal>. "
+"Another key advantage is the ability to set those annotations at a package "
+"level."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:2503
+#, no-c-format
+msgid "Custom SQL for CRUD operations"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2505
+#, no-c-format
+msgid ""
+"Hibernate gives you the ability to override every single SQL statement "
+"generated. We have seen native SQL query usage already, but you can also "
+"override the SQL statement used to load or change the state of entities."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2510
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Table(name=\"CHAOS\")\n"
+"<emphasis role=\"bold\">@SQLInsert( sql=\"INSERT INTO
CHAOS(size, name, "
+"nickname, id) VALUES(?,upper(?),?,?)\")\n"
+"@SQLUpdate( sql=\"UPDATE CHAOS SET size = ?, name = upper(?), nickname = ?
"
+"WHERE id = ?\")\n"
+"@SQLDelete( sql=\"DELETE CHAOS WHERE id = ?\")\n"
+"@SQLDeleteAll( sql=\"DELETE CHAOS\")\n"
+"</emphasis><emphasis role=\"bold\">@Loader(namedQuery =
\"chaos\")</"
+"emphasis>\n"
+"@NamedNativeQuery(name=\"chaos\", query=\"select id, size, name,
lower"
+"( nickname ) as nickname from CHAOS where id= ?\", resultClass = Chaos."
+"class)\n"
+"public class Chaos {\n"
+" @Id\n"
+" private Long id;\n"
+" private Long size;\n"
+" private String name;\n"
+" private String nickname;"
+msgstr ""
+"@Entity\n"
+"@Table(name=\"CHAOS\")\n"
+"<emphasis role=\"bold\">@SQLInsert( sql=\"INSERT INTO
CHAOS(size, name, "
+"nickname, id) VALUES(?,upper(?),?,?)\")\n"
+"@SQLUpdate( sql=\"UPDATE CHAOS SET size = ?, name = upper(?), nickname = ?
"
+"WHERE id = ?\")\n"
+"@SQLDelete( sql=\"DELETE CHAOS WHERE id = ?\")\n"
+"@SQLDeleteAll( sql=\"DELETE CHAOS\")\n"
+"</emphasis><emphasis role=\"bold\">@Loader(namedQuery =
\"chaos\")</"
+"emphasis>\n"
+"@NamedNativeQuery(name=\"chaos\", query=\"select id, size, name,
lower"
+"( nickname ) as nickname from CHAOS where id= ?\", resultClass = Chaos."
+"class)\n"
+"public class Chaos {\n"
+" @Id\n"
+" private Long id;\n"
+" private Long size;\n"
+" private String name;\n"
+" private String nickname;"
+
+#. Tag: para
+#: entity.xml:2512
+#, no-c-format
+msgid ""
+"<literal>@SQLInsert</literal>,
<literal>@SQLUpdate</literal>, "
+"<literal>@SQLDelete</literal>,
<literal>@SQLDeleteAll</literal> respectively "
+"override the INSERT statement, UPDATE statement, DELETE statement, DELETE "
+"statement to remove all entities."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2517
+#, no-c-format
+msgid ""
+"If you expect to call a store procedure, be sure to set the "
+"<literal>callable</literal> attribute to true
(<literal>@SQLInsert"
+"(callable=true, ...)</literal>)."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2521
+#, no-c-format
+msgid ""
+"To check that the execution happens correctly, Hibernate allows you to "
+"define one of those three strategies:"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2526
+#, no-c-format
+msgid ""
+"NONE: no check is performed: the store procedure is expected to fail upon "
+"issues"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2531
+#, no-c-format
+msgid "COUNT: use of rowcount to check that the update is successful"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2536
+#, no-c-format
+msgid ""
+"PARAM: like COUNT but using an output parameter rather that the standard "
+"mechanism"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2541
+#, no-c-format
+msgid ""
+"To define the result check style, use the <literal>check</literal>
parameter "
+"(<literal>(a)SQLUpdate(check=ResultCheckStyle.COUNT,
...)</literal>)."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2545
+#, no-c-format
+msgid ""
+"You can also override the SQL load statement by a native SQL query or a HQL "
+"query. You just have to refer to a named query with the "
+"<literal><literal>@Loader</literal></literal>
annotation."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2549
+#, no-c-format
+msgid ""
+"You can use the exact same set of annotations to override the collection "
+"related statements."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2552
+#, no-c-format
+msgid ""
+"@OneToMany\n"
+"@JoinColumn(name=\"chaos_fk\")\n"
+"<emphasis role=\"bold\">@SQLInsert( sql=\"UPDATE
CASIMIR_PARTICULE SET "
+"chaos_fk = ? where id = ?\")\n"
+"@SQLDelete( sql=\"UPDATE CASIMIR_PARTICULE SET chaos_fk = null where id =
?"
+"\")</emphasis>\n"
+"private Set<CasimirParticle> particles = new HashSet<"
+"CasimirParticle>();"
+msgstr ""
+"@OneToMany\n"
+"@JoinColumn(name=\"chaos_fk\")\n"
+"<emphasis role=\"bold\">@SQLInsert( sql=\"UPDATE
CASIMIR_PARTICULE SET "
+"chaos_fk = ? where id = ?\")\n"
+"@SQLDelete( sql=\"UPDATE CASIMIR_PARTICULE SET chaos_fk = null where id =
?"
+"\")</emphasis>\n"
+"private Set<CasimirParticle> particles = new HashSet<"
+"CasimirParticle>();"
+
+#. Tag: para
+#: entity.xml:2554
+#, no-c-format
+msgid ""
+"The parameters order is important and is defined by the order Hibernate "
+"handle properties. You can see the expected order by enabling debug logging "
+"for the <literal>org.hibernate.persister.entity</literal> level. With
this "
+"level enabled Hibernate will print out the static SQL that is used to "
+"create, update, delete etc. entities. (To see the expected sequence, "
+"remember to not include your custom SQL through annotations as that will "
+"override the Hibernate generated static sql.)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2563
+#, no-c-format
+msgid ""
+"Overriding SQL statements for secondary tables is also possible using "
+"<literal>(a)org.hibernate.annotations.Table</literal> and either (or all)
"
+"attributes <literal>sqlInsert</literal>,
<literal>sqlUpdate</literal>, "
+"<literal>sqlDelete</literal>:"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2568
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@SecondaryTables({\n"
+" @SecondaryTable(name = \"`Cat nbr1`\"),\n"
+" @SecondaryTable(name = \"Cat2\"})\n"
+"(a)org.hibernate.annotations.Tables( {\n"
+" @Table(appliesTo = \"Cat\", comment = \"My cat table\"
),\n"
+" @Table(appliesTo = \"Cat2\", foreignKey =
@ForeignKey(name=\"FK_CAT2_CAT"
+"\"), fetch = FetchMode.SELECT,\n"
+" <emphasis
role=\"bold\">sqlInsert=@SQLInsert(sql=\"insert into Cat2"
+"(storyPart2, id) values(upper(?), ?)\") )</emphasis>\n"
+"} )\n"
+"public class Cat implements Serializable {"
+msgstr ""
+"@Entity\n"
+"@SecondaryTables({\n"
+" @SecondaryTable(name = \"`Cat nbr1`\"),\n"
+" @SecondaryTable(name = \"Cat2\"})\n"
+"(a)org.hibernate.annotations.Tables( {\n"
+" @Table(appliesTo = \"Cat\", comment = \"My cat table\"
),\n"
+" @Table(appliesTo = \"Cat2\", foreignKey =
@ForeignKey(name=\"FK_CAT2_CAT"
+"\"), fetch = FetchMode.SELECT,\n"
+" <emphasis
role=\"bold\">sqlInsert=@SQLInsert(sql=\"insert into Cat2"
+"(storyPart2, id) values(upper(?), ?)\") )</emphasis>\n"
+"} )\n"
+"public class Cat implements Serializable {"
+
+#. Tag: para
+#: entity.xml:2570
+#, no-c-format
+msgid ""
+"The previous example also show that you can give a comment to a given table "
+"(promary or secondary): This comment will be used for DDL generation."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:2576
+#, no-c-format
+msgid "Tuplizer"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2578
+#, no-c-format
+msgid ""
+"<classname>org.hibernate.tuple.Tuplizer</classname>, and its
sub-interfaces, "
+"are responsible for managing a particular representation of a piece of data,
"
+"given that representation's
<literal>org.hibernate.EntityMode</literal>. If "
+"a given piece of data is thought of as a data structure, then a tuplizer is "
+"the thing which knows how to create such a data structure and how to extract
"
+"values from and inject values into such a data structure. For example, for "
+"the POJO entity mode, the correpsonding tuplizer knows how create the POJO "
+"through its constructor and how to access the POJO properties using the "
+"defined property accessors. There are two high-level types of Tuplizers, "
+"represented by the
<classname>org.hibernate.tuple.EntityTuplizer</classname> "
+"and <classname>org.hibernate.tuple.ComponentTuplizer</classname>
interfaces. "
+"EntityTuplizers are responsible for managing the above mentioned contracts "
+"in regards to entities, while <classname>ComponentTuplizers</classname>
do "
+"the same for components. Check the Hibernate reference documentation for "
+"more information."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2596
+#, no-c-format
+msgid ""
+"To define tuplixer in annotations, simply use the
<literal>@Tuplizer</"
+"literal> annotation on the according element"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2599
+#, no-c-format
+msgid ""
+"@Entity\n"
+"<emphasis role=\"bold\">@Tuplizer(impl =
DynamicEntityTuplizer.class)</"
+"emphasis>\n"
+"public interface Cuisine {\n"
+" @Id\n"
+" @GeneratedValue\n"
+" public Long getId();\n"
+" public void setId(Long id);\n"
+"\n"
+" public String getName();\n"
+" public void setName(String name);\n"
+"\n"
+" <emphasis role=\"bold\">@Tuplizer(impl =
DynamicComponentTuplizer.class)"
+"</emphasis>\n"
+" public Country getCountry();\n"
+" public void setCountry(Country country);\n"
+"\n"
+"\n"
+"}"
+msgstr ""
+"@Entity\n"
+"<emphasis role=\"bold\">@Tuplizer(impl =
DynamicEntityTuplizer.class)</"
+"emphasis>\n"
+"public interface Cuisine {\n"
+" @Id\n"
+" @GeneratedValue\n"
+" public Long getId();\n"
+" public void setId(Long id);\n"
+"\n"
+" public String getName();\n"
+" public void setName(String name);\n"
+"\n"
+" <emphasis role=\"bold\">@Tuplizer(impl =
DynamicComponentTuplizer.class)"
+"</emphasis>\n"
+" public Country getCountry();\n"
+" public void setCountry(Country country);\n"
+"\n"
+"\n"
+"}"
+
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/pt-BR/setup.po
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/pt-BR/setup.po
(rev 0)
+++ annotations/branches/v3_4_0_GA_CP/src/main/docbook/pt-BR/setup.po 2009-12-22 06:50:19
UTC (rev 18313)
@@ -0,0 +1,337 @@
+# translation of setup.po to
+# Header entry was created by KBabel!
+#
+#. Tag: title
+#: setup.xml:28
+#, no-c-format
+msgid ""
+msgstr ""
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Last-Translator: \n"
+"PO-Revision-Date: 2009-11-19 10:26+1000\n"
+"Project-Id-Version: setup\n"
+"Language-Team: <en(a)li.org>\n"
+"X-Generator: KBabel 1.11.4\n"
+"MIME-Version: 1.0\n"
+
+#. Tag: title
+#: setup.xml:28
+#, no-c-format
+msgid "Setting up an annotations project"
+msgstr ""
+
+#. Tag: title
+#: setup.xml:31
+#, no-c-format
+msgid "Requirements"
+msgstr ""
+
+#. Tag: para
+#: setup.xml:35
+#, no-c-format
+msgid ""
+"<ulink
url=\"http://www.hibernate.org/6.html\">Download</ulink> and unpack
"
+"the Hibernate Annotations distribution from the Hibernate website."
+msgstr ""
+
+#. Tag: emphasis
+#: setup.xml:41
+#, no-c-format
+msgid "This release requires Hibernate Core 3.3 and above."
+msgstr ""
+
+#. Tag: para
+#: setup.xml:46
+#, no-c-format
+msgid "This release is known to work on Hibernate Core 3.3.0.SP1"
+msgstr ""
+
+#. Tag: para
+#: setup.xml:50
+#, no-c-format
+msgid ""
+"Make sure you have JDK 5.0 installed or above. You can of course continue "
+"using XDoclet and get some of the benefits of annotation-based metadata with
"
+"older JDK versions. Note that this document only describes JDK 5.0 "
+"annotations and you have to refer to the XDoclet documentation for more "
+"information."
+msgstr ""
+
+#. Tag: title
+#: setup.xml:60
+#, no-c-format
+msgid "Configuration"
+msgstr ""
+
+#. Tag: para
+#: setup.xml:62
+#, no-c-format
+msgid ""
+"First, set up your classpath (after you have created a new project in your "
+"favorite IDE):"
+msgstr ""
+
+#. Tag: para
+#: setup.xml:65
+#, no-c-format
+msgid ""
+"Copy all Hibernate3 core and required 3rd party library files (see lib/"
+"README.txt in Hibernate)."
+msgstr ""
+
+#. Tag: para
+#: setup.xml:70
+#, no-c-format
+msgid ""
+"Copy <filename>hibernate-annotations.jar</filename>,
<filename>lib/hibernate-"
+"comons-annotations.jar</filename> and
<filename>lib/ejb3-persistence.jar</"
+"filename> from the Hibernate Annotations distribution to your classpath as
"
+"well."
+msgstr ""
+
+#. Tag: para
+#: setup.xml:77
+#, no-c-format
+msgid ""
+"If you wish to use <ulink
url=\"http://validator.hibernate.org\">Hibernate "
+"Validator</ulink>, download it from the Hibernate website and add "
+"<filename>hibernate-validator.jar</filename> in your classpath."
+msgstr ""
+
+#. Tag: para
+#: setup.xml:82
+#, no-c-format
+msgid ""
+"If you wish to use <ulink
url=\"http://search.hibernate.org\">Hibernate "
+"Search</ulink>, download it from the Hibernate website and add "
+"<filename>hibernate-search.jar</filename> and
<filename>lucene-core-x.y.z."
+"jar</filename> in your classpath."
+msgstr ""
+
+#. Tag: para
+#: setup.xml:88
+#, no-c-format
+msgid ""
+"We also recommend a small wrapper class to startup Hibernate in a static "
+"initializer block, known as <classname>HibernateUtil</classname>. You
might "
+"have seen this class in various forms in other areas of the Hibernate "
+"documentation. For Annotation support you have to enhance this helper class "
+"as follows:"
+msgstr ""
+
+#. Tag: programlisting
+#: setup.xml:92
+#, no-c-format
+msgid ""
+"package hello;\n"
+"\n"
+"import org.hibernate.*;\n"
+"import org.hibernate.cfg.*;\n"
+"import test.*;\n"
+"import test.animals.Dog;\n"
+"\n"
+"public class HibernateUtil {\n"
+"\n"
+"private static final SessionFactory sessionFactory;\n"
+"\n"
+" static {\n"
+" try {\n"
+"\n"
+" sessionFactory = new <emphasis role=\"bold"
+"\">AnnotationConfiguration()</emphasis>\n"
+" configure().buildSessionFactory();\n"
+" } catch (Throwable ex) {\n"
+" // Log exception!\n"
+" throw new ExceptionInInitializerError(ex);\n"
+" }\n"
+" }\n"
+"\n"
+" public static Session getSession()\n"
+" throws HibernateException {\n"
+" return sessionFactory.openSession();\n"
+" }\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: setup.xml:94
+#, no-c-format
+msgid ""
+"Interesting here is the use of <classname>AnnotationConfiguration</"
+"classname>. The packages and annotated classes are declared in your regular
"
+"XML configuration file (usually
<filename>hibernate.cfg.xml</filename>). "
+"Here is the equivalent of the above declaration:"
+msgstr ""
+
+#. Tag: programlisting
+#: setup.xml:100
+#, no-c-format
+msgid ""
+"<!DOCTYPE hibernate-configuration PUBLIC\n"
+" \"-//Hibernate/Hibernate Configuration DTD 3.0//EN\"\n"
+" \"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"
+"\">\n"
+"\n"
+" <hibernate-configuration>\n"
+" <session-factory>\n"
+" <emphasis role=\"bold\"><mapping
package=\"test.animals\"/"
+">\n"
+" <mapping class=\"test.Flight\"/>\n"
+" <mapping class=\"test.Sky\"/>\n"
+" <mapping class=\"test.Person\"/>\n"
+" <mapping
class=\"test.animals.Dog\"/></emphasis>\n"
+"<emphasis role=\"bold\"> <mapping
resource=\"test/animals/orm."
+"xml\"/></emphasis>\n"
+" </session-factory>\n"
+" </hibernate-configuration>"
+msgstr ""
+
+#. Tag: para
+#: setup.xml:102
+#, no-c-format
+msgid ""
+"Note that you can mix the hbm.xml use and the new annotation one. The "
+"resource element can be either an hbm file or an EJB3 XML deployment "
+"descriptor. The distinction is transparent for your configuration process."
+msgstr ""
+
+#. Tag: para
+#: setup.xml:107
+#, no-c-format
+msgid ""
+"Alternatively, you can define the annotated classes and packages using the "
+"programmatic API"
+msgstr ""
+
+#. Tag: programlisting
+#: setup.xml:110
+#, no-c-format
+msgid ""
+"sessionFactory = new <emphasis
role=\"bold\">AnnotationConfiguration()\n"
+" .addPackage(\"test.animals\") //the fully qualified package
name\n"
+" .addAnnotatedClass(Flight.class)\n"
+" .addAnnotatedClass(Sky.class)\n"
+" .addAnnotatedClass(Person.class)\n"
+" .addAnnotatedClass(Dog.class)</emphasis>\n"
+"<emphasis
role=\"bold\">.addResource(\"test/animals/orm.xml\")</emphasis>\n"
+" configure()..buildSessionFactory();"
+msgstr ""
+
+#. Tag: para
+#: setup.xml:112
+#, no-c-format
+msgid ""
+"You can also use the Hibernate EntityManager which has its own configuration
"
+"mechanism. Please refer to this project documentation for more details."
+msgstr ""
+
+#. Tag: para
+#: setup.xml:116
+#, no-c-format
+msgid ""
+"There is no other difference in the way you use Hibernate APIs with "
+"annotations, except for this startup routine change or in the configuration "
+"file. You can use your favorite configuration method for other properties "
+"( <filename>hibernate.properties</filename>,
<filename>hibernate.cfg.xml</"
+"filename>, programmatic APIs, etc). You can even mix annotated persistent
"
+"classes and classic <filename>hbm.cfg.xml</filename> declarations with
the "
+"same <classname>SessionFactory</classname>. You can however not declare
a "
+"class several times (whether annotated or through hbm.xml). You cannot mix "
+"configuration strategies (hbm vs annotations) in a mapped entity hierarchy "
+"either."
+msgstr ""
+
+#. Tag: para
+#: setup.xml:128
+#, no-c-format
+msgid ""
+"To ease the migration process from hbm files to annotations, the "
+"configuration mechanism detects the mapping duplication between annotations "
+"and hbm files. HBM files are then prioritized over annotated metadata on a "
+"class to class basis. You can change the priority using
<literal>hibernate."
+"mapping.precedence</literal> property. The default is <literal>hbm,
class</"
+"literal>, changing it to <literal>class, hbm</literal> will
prioritize the "
+"annotated classes over hbm files when a conflict occurs."
+msgstr ""
+
+#. Tag: title
+#: setup.xml:139
+#, no-c-format
+msgid "Properties"
+msgstr ""
+
+#. Tag: para
+#: setup.xml:141
+#, no-c-format
+msgid ""
+"Asides from the Hibernate core properties, Hibernate Annotations reacts to "
+"the following one"
+msgstr ""
+
+#. Tag: title
+#: setup.xml:146
+#, no-c-format
+msgid "Logging"
+msgstr ""
+
+#. Tag: para
+#: setup.xml:148
+#, no-c-format
+msgid ""
+"Hibernate Annotations utilizes <ulink
url=\"http://www.slf4j.org/\">Simple "
+"Logging Facade for Java</ulink> (SLF4J) in order to log various system
"
+"events. SLF4J can direct your logging output to several logging frameworks "
+"(NOP, Simple, log4j version 1.2, JDK 1.4 logging, JCL or logback) depending "
+"on your chosen binding. In order to setup logging properly you will need "
+"<filename>slf4j-api.jar</filename> in your classpath together with the
jar "
+"file for your preferred binding -
<filename>slf4j-log4j12.jar</filename> in "
+"the case of Log4J. See the SLF4J <ulink type=\"\"
url=\"http://www.slf4j.org/"
+"manual.html\">documentation</ulink> for more detail."
+msgstr ""
+
+#. Tag: para
+#: setup.xml:160
+#, no-c-format
+msgid "The logging categories interesting for Hibernate Annotations are:"
+msgstr ""
+
+#. Tag: title
+#: setup.xml:164
+#, no-c-format
+msgid "Hibernate Annotations Log Categories"
+msgstr ""
+
+#. Tag: entry
+#: setup.xml:169
+#, no-c-format
+msgid "Category"
+msgstr ""
+
+#. Tag: entry
+#: setup.xml:171
+#, no-c-format
+msgid "Function"
+msgstr ""
+
+#. Tag: emphasis
+#: setup.xml:177
+#, no-c-format
+msgid "org.hibernate.cfg"
+msgstr ""
+
+#. Tag: entry
+#: setup.xml:179
+#, no-c-format
+msgid "Log all configuration related events (not only annotations)."
+msgstr ""
+
+#. Tag: para
+#: setup.xml:186
+#, no-c-format
+msgid ""
+"For further category configuration refer to the <ulink
url=\"http://www."
+"hibernate.org/hib_docs/v3/reference/en/html_single/#configuration-logging"
+"\">Logging</ulink> in the Hibernate Core documentation."
+msgstr ""
+
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/pt-BR/xml-overriding.po
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/pt-BR/xml-overriding.po
(rev 0)
+++ annotations/branches/v3_4_0_GA_CP/src/main/docbook/pt-BR/xml-overriding.po 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,432 @@
+# translation of xml-overriding.po to
+# Header entry was created by KBabel!
+#
+#. Tag: title
+#: xml-overriding.xml:28
+#, no-c-format
+msgid ""
+msgstr ""
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Last-Translator: \n"
+"PO-Revision-Date: 2009-11-19 10:26+1000\n"
+"Project-Id-Version: xml-overriding\n"
+"Language-Team: <en(a)li.org>\n"
+"X-Generator: KBabel 1.11.4\n"
+"MIME-Version: 1.0\n"
+
+#. Tag: title
+#: xml-overriding.xml:28
+#, no-c-format
+msgid "Overriding metadata through XML"
+msgstr ""
+
+#. Tag: para
+#: xml-overriding.xml:30
+#, no-c-format
+msgid ""
+"The primary target for metadata in EJB3 is annotations, but the EJB3 "
+"specification provides a way to override or replace the annotation defined "
+"metadata through an XML deployment descriptor. In the current release only "
+"pure EJB3 annotations overriding are supported. If you wish to use Hibernate
"
+"specific features in some entities, you'll have to either use annotations or
"
+"fallback to hbm files. You can of course mix and match annotated entities "
+"and entities describes in hbm files."
+msgstr ""
+
+#. Tag: para
+#: xml-overriding.xml:38
+#, no-c-format
+msgid "The unit test suite shows some additional XML file samples."
+msgstr ""
+
+#. Tag: title
+#: xml-overriding.xml:41
+#, no-c-format
+msgid "Principles"
+msgstr ""
+
+#. Tag: para
+#: xml-overriding.xml:43
+#, no-c-format
+msgid ""
+"The XML deployment descriptor structure has been designed to reflect the "
+"annotations one. So if you know the annotations structure, using the XML "
+"schema will be straightforward for you."
+msgstr ""
+
+#. Tag: para
+#: xml-overriding.xml:47
+#, no-c-format
+msgid ""
+"You can define one ot more XML files describing your metadata, these files "
+"will be merged by the overriding engine."
+msgstr ""
+
+#. Tag: title
+#: xml-overriding.xml:51
+#, no-c-format
+msgid "Global level metadata"
+msgstr ""
+
+#. Tag: para
+#: xml-overriding.xml:53
+#, no-c-format
+msgid ""
+"You can define global level metadata available for all XML files. You must "
+"not define these metadata more than once per deployment."
+msgstr ""
+
+#. Tag: programlisting
+#: xml-overriding.xml:56
+#, no-c-format
+msgid ""
+"<?xml version=\"1.0\"
encoding=\"UTF-8\"?>\n"
+"\n"
+"<entity-mappings \n"
+"
xmlns=\"http://java.sun.com/xml/ns/persistence/orm\"\n"
+"
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
+"
xsi:schemaLocation=\"http://java.sun.com/xml/ns/persistence/orm
orm_1_0.xsd"
+"\"\n"
+" version=\"1.0\">\n"
+"\n"
+" <persistence-unit-metadata>\n"
+" <xml-mapping-metadata-complete/>\n"
+" <persistence-unit-defaults>\n"
+" <schema>myschema</schema>\n"
+" <catalog>mycatalog</catalog>\n"
+" <cascade-persist/>\n"
+" </persistence-unit-defaults>\n"
+" </persistence-unit-metadata>"
+msgstr ""
+
+#. Tag: para
+#: xml-overriding.xml:58
+#, no-c-format
+msgid ""
+"<literal>xml-mapping-metadata-complete</literal> means that all entity,
"
+"mapped-superclasses and embeddable metadata should be picked up from XML (ie
"
+"ignore annotations)."
+msgstr ""
+
+#. Tag: para
+#: xml-overriding.xml:62
+#, no-c-format
+msgid ""
+"<literal>schema / catalog</literal> will override all default
definitions of "
+"schema and catalog in the metadata (both XML and annotations)."
+msgstr ""
+
+#. Tag: para
+#: xml-overriding.xml:66
+#, no-c-format
+msgid ""
+"<literal>cascade-persist</literal> means that all associations have
PERSIST "
+"as a cascade type. We recommend you to not use this feature."
+msgstr ""
+
+#. Tag: title
+#: xml-overriding.xml:72
+#, no-c-format
+msgid "Entity level metadata"
+msgstr ""
+
+#. Tag: para
+#: xml-overriding.xml:74
+#, no-c-format
+msgid "You can either define or override metadata informations on a given
entity."
+msgstr ""
+
+#. Tag: section
+#: xml-overriding.xml:75
+#, no-c-format
+msgid ""
+"<programlistingco> <areaspec> <area coords=\"3 85\"
id=\"aa1\"/> <area "
+"coords=\"9 85\" id=\"aa2\"/> <area coords=\"10
85\" id=\"aa3\"/> <area "
+"coords=\"11 85\" id=\"aa4\"/> <area coords=\"17
85\" id=\"aa5\"/> <area "
+"coords=\"23 85\" id=\"aa6\"/> <area coords=\"24
85\" id=\"aa7\"/> <area "
+"coords=\"25 85\" id=\"aa8\"/> <area coords=\"26
85\" id=\"aa9\"/> <area "
+"coords=\"31 85\" id=\"aa10\"/> </areaspec>
<programlisting><?xml version="
+"\"1.0\" encoding=\"UTF-8\"?>\n"
+"\n"
+"<entity-mappings \n"
+"
xmlns=\"http://java.sun.com/xml/ns/persistence/orm\"\n"
+"
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
+"
xsi:schemaLocation=\"http://java.sun.com/xml/ns/persistence/orm
orm_1_0.xsd"
+"\"\n"
+" version=\"1.0\">\n"
+"\n"
+"
<package>org.hibernate.test.annotations.reflection</"
+"package>\n"
+" <entity class=\"Administration\" access=\"PROPERTY\"
metadata-"
+"complete=\"true\">\n"
+" <table name=\"tbl_admin\">\n"
+" <unique-constraint>\n"
+"
<column-name>firstname</column-name>\n"
+"
<column-name>lastname</column-name>\n"
+" </unique-constraint>\n"
+" </table>\n"
+" <secondary-table name=\"admin2\">\n"
+" <primary-key-join-column name=\"admin_id\"
referenced-column-"
+"name=\"id\"/>\n"
+" <unique-constraint>\n"
+"
<column-name>address</column-name>\n"
+" </unique-constraint>\n"
+" </secondary-table>\n"
+" <id-class class=\"SocialSecurityNumber\"/>\n"
+" <inheritance strategy=\"JOINED\"/>\n"
+" <sequence-generator name=\"seqhilo\"
sequence-name=\"seqhilo\"/"
+">\n"
+" <table-generator name=\"table\"
table=\"tablehilo\"/>\n"
+" ...\n"
+" </entity>\n"
+"\n"
+" <entity class=\"PostalAdministration\">\n"
+" <primary-key-join-column name=\"id\"/>\n"
+" ...\n"
+" </entity>\n"
+"</entity-mappings></programlisting> <calloutlist>
<callout arearefs="
+"\"aa1\"> <para><literal>entity-mappings</literal>:
entity-mappings is the "
+"root element for all XML files. You must declare the xml schema, the schema "
+"file is included in the hibernate-annotations.jar file, no internet access "
+"will be processed by Hibernate Annotations.</para> </callout>
<callout "
+"arearefs=\"aa2\"> <para><literal>package</literal>
(optional): default "
+"package used for all non qualified class names in the given deployment "
+"descriptor file.</para> </callout> <callout
arearefs=\"aa3\"> "
+"<para><literal>entity</literal>: desribes an entity.</para>
"
+"<para><literal>metadata-complete</literal> defines whether the
metadata "
+"description for this element is complete or not (in other words, if "
+"annotations present at the class level should be considered or not).</para>
"
+"<para>An entity has to have a <literal>class</literal> attribute
refering "
+"the java class the metadata applies on.</para> <para>You can overrides
"
+"entity name through the <literal>name</literal> attribute, if none is
"
+"defined and if an <literal>(a)Entity.name</literal> is present, then it
is "
+"used (provided that metadata complete is not set).</para> <para>For
metadata "
+"complete (see below) element, you can define an
<literal>access</literal> "
+"(either <literal>FIELD</literal> or
<literal>PROPERTY</literal> (default)). "
+"For non medatada complete element, if <literal>access</literal> is not
"
+"defined, the @Id position will lead position, if
<literal>access</literal> "
+"is defined, the value is used.</para> </callout> <callout
arearefs=\"aa4\"> "
+"<para><literal>table</literal>: you can declare table properties
(name, "
+"schema, catalog), if none is defined, the java annotation is used.</para>
"
+"<para>You can define one or several unique constraints as seen in the "
+"example</para> </callout> <callout arearefs=\"aa5\">
"
+"<para><literal>secondary-table</literal>: defines a secondary
table very "
+"much like a regular table except that you can define the primary key / "
+"foreign key column(s) through the
<literal>primary-key-join-column</literal> "
+"element. On non metadata complete, annotation secondary tables are used only
"
+"if there is no <literal>secondary-table</literal> definition,
annotations "
+"are ignored otherwise.</para> </callout> <callout
arearefs=\"aa6\"> "
+"<para><literal>id-class</literal>: defines the id class in a
similar way "
+"<literal>@IdClass</literal> does</para> </callout>
<callout arearefs=\"aa7"
+"\"> <para><literal>inheritance</literal>: defines the
inheritance strategy "
+"(<literal>JOINED</literal>,
<literal>TABLE_PER_CLASS</literal>, "
+"<literal>SINGLE_TABLE</literal>), Available only at the root entity
level</"
+"para> </callout> <callout arearefs=\"aa8\">
<para><literal>sequence-"
+"generator</literal>: defines a sequence generator</para>
</callout> <callout "
+"arearefs=\"aa9\">
<para><literal>table-generator</literal>: defines a table "
+"generator</para> </callout> <callout arearefs=\"aa10\">
"
+"<para><literal><literal>primary-key-join-column</literal></literal>:
defines "
+"the primary key join column for sub entities when JOINED inheritance "
+"strategy is used</para> </callout> </calloutlist>
</programlistingco> "
+"<programlistingco> <areaspec> <area coords=\"11 85\"
id=\"ab1\"/> <area "
+"coords=\"18 85\" id=\"ab2\"/> <area coords=\"22
85\" id=\"ab3\"/> <area "
+"coords=\"28 85\" id=\"ab4\"/> <area coords=\"34
85\" id=\"ab5\"/> </"
+"areaspec> <programlisting><?xml version=\"1.0\"
encoding=\"UTF-8\"?>\n"
+"\n"
+"<entity-mappings \n"
+"
xmlns=\"http://java.sun.com/xml/ns/persistence/orm\"\n"
+"
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
+"
xsi:schemaLocation=\"http://java.sun.com/xml/ns/persistence/orm
orm_1_0.xsd"
+"\"\n"
+" version=\"1.0\">\n"
+"\n"
+"
<package>org.hibernate.test.annotations.reflection</"
+"package>\n"
+" <entity class=\"Music\" access=\"PROPERTY\"
metadata-complete=\"true"
+"\">\n"
+"
<discriminator-value>Generic</discriminator-value>\n"
+" <discriminator-column length=\"34\"/>\n"
+" ...\n"
+" </entity>\n"
+"\n"
+" <entity class=\"PostalAdministration\">\n"
+" <primary-key-join-column name=\"id\"/>\n"
+" <named-query name=\"adminById\">\n"
+" <query>select m from Administration m where m.id =
:id</"
+"query>\n"
+" <hint name=\"org.hibernate.timeout\"
value=\"200\"/>\n"
+" </named-query>\n"
+" <named-native-query name=\"allAdmin\"
result-set-mapping=\"adminrs"
+"\">\n"
+" <query>select *, count(taxpayer_id) as taxPayerNumber
\n"
+" from Administration, TaxPayer\n"
+" where taxpayer_admin_id = admin_id group by
...</query>\n"
+" <hint name=\"org.hibernate.timeout\"
value=\"200\"/>\n"
+" </named-native-query>\n"
+" <sql-result-set-mapping name=\"adminrs\">\n"
+" <entity-result
entity-class=\"Administration\">\n"
+" <field-result name=\"name\"
column=\"fld_name\"/>\n"
+" </entity-result>\n"
+" <column-result
name=\"taxPayerNumber\"/>\n"
+" </sql-result-set-mapping>\n"
+" <attribute-override name=\"ground\">\n"
+" <column name=\"fld_ground\" unique=\"true\"
scale=\"2\"/>\n"
+" </attribute-override>\n"
+" <association-override name=\"referer\">\n"
+" <join-column name=\"referer_id\"
referenced-column-name=\"id"
+"\"/>\n"
+" </association-override>\n"
+" ...\n"
+" </entity>\n"
+"</entity-mappings></programlisting> <calloutlist>
<callout arearefs="
+"\"ab1\"> <para><literal>discriminator-value /
discriminator-column</"
+"literal>: defines the discriminator value and the column holding it when the
"
+"SINGLE_TABLE inheritance strategy is chosen</para> </callout>
<callout "
+"arearefs=\"ab2\">
<para><literal>named-query</literal>: defines named "
+"queries and possibly the hints associated to them. Those definitions are "
+"additive to the one defined in annotations, if two definitions have the same
"
+"name, the XML one has priority.</para> </callout> <callout
arearefs=\"ab3\"> "
+"<para><literal>named-native-query</literal>: defines an named
native query "
+"and its sql result set mapping. Alternatively, you can define the "
+"<literal>result-class</literal>. Those definitions are additive to the
one "
+"defined in annotations, if two definitions have the same name, the XML one "
+"has priority.</para> </callout> <callout
arearefs=\"ab4\"> "
+"<para><literal>sql-result-set-mapping</literal>: describes the
result set "
+"mapping structure. You can define both entity and column mappings. Those "
+"definitions are additive to the one defined in annotations, if two "
+"definitions have the same name, the XML one has priority</para>
</callout> "
+"<callout arearefs=\"ab5\">
<para><literal>attribute-override / association-"
+"override</literal>: defines a column or join column overriding. This "
+"overriding is additive to the one defined in annotations</para>
</callout> </"
+"calloutlist> </programlistingco>"
+msgstr ""
+
+#. Tag: para
+#: xml-overriding.xml:246
+#, no-c-format
+msgid ""
+"Same applies for <literal><embeddable></literal> and
<literal><"
+"mapped-superclass></literal>."
+msgstr ""
+
+#. Tag: title
+#: xml-overriding.xml:251
+#, no-c-format
+msgid "Property level metadata"
+msgstr ""
+
+#. Tag: para
+#: xml-overriding.xml:253
+#, no-c-format
+msgid ""
+"You can of course defines XML overriding for properties. If metadata "
+"complete is defined, then additional properties (ie at the Java level) will "
+"be ignored. Otherwise, once you start overriding a property, all annotations
"
+"on the given property are ignored. All property level metadata behave in "
+"<literal>entity/attributes</literal>,
<literal>mapped-superclass/attributes</"
+"literal> or <literal>embeddable/attributes</literal>."
+msgstr ""
+
+#. Tag: programlisting
+#: xml-overriding.xml:261
+#, no-c-format
+msgid ""
+"<attributes>\n"
+" <id name=\"id\">\n"
+" <column name=\"fld_id\"/>\n"
+" <generated-value generator=\"generator\"
strategy=\"SEQUENCE"
+"\"/>\n"
+" <temporal>DATE</temporal>\n"
+" <sequence-generator name=\"generator\"
sequence-name=\"seq\"/"
+">\n"
+" </id>\n"
+" <version name=\"version\"/>\n"
+" <embedded name=\"embeddedObject\">\n"
+" <attribute-override
name\"subproperty\">\n"
+" <column name=\"my_column\"/>\n"
+" </attribute-override>\n"
+" </embedded>\n"
+" <basic name=\"status\"
optional=\"false\">\n"
+" <enumerated>STRING</enumerated>\n"
+" </basic>\n"
+" <basic name=\"serial\"
optional=\"true\">\n"
+" <column name=\"serialbytes\"/>\n"
+" <lob/>\n"
+" </basic>\n"
+" <basic name=\"terminusTime\"
fetch=\"LAZY\">\n"
+" <temporal>TIMESTAMP</temporal>\n"
+" </basic>\n"
+" </attributes>"
+msgstr ""
+
+#. Tag: para
+#: xml-overriding.xml:263
+#, no-c-format
+msgid ""
+"You can override a property through <literal>id</literal>,
<literal>embedded-"
+"id</literal>, <literal>version</literal>,
<literal>embedded</literal> and "
+"<literal>basic</literal>. Each of these elements can have subelements
"
+"accordingly: <literal>lob</literal>,
<literal>temporal</literal>, "
+"<literal>enumerated</literal>,
<literal>column</literal>."
+msgstr ""
+
+#. Tag: title
+#: xml-overriding.xml:272
+#, no-c-format
+msgid "Association level metadata"
+msgstr ""
+
+#. Tag: para
+#: xml-overriding.xml:274
+#, no-c-format
+msgid ""
+"You can define XML overriding for associations. All association level "
+"metadata behave in <literal>entity/attributes</literal>,
<literal>mapped-"
+"superclass/attributes</literal> or
<literal>embeddable/attributes</literal>."
+msgstr ""
+
+#. Tag: programlisting
+#: xml-overriding.xml:279
+#, no-c-format
+msgid ""
+"<attributes>\n"
+" <one-to-many name=\"players\"
fetch=\"EAGER\">\n"
+" <map-key name=\"name\"/>\n"
+" <join-column name=\"driver\"/>\n"
+" <join-column name=\"number\"/>\n"
+" </one-to-many>\n"
+" <many-to-many name=\"roads\"
target-entity=\"Administration"
+"\">\n"
+" <order-by>maxSpeed</order-by>\n"
+" <join-table name=\"bus_road\">\n"
+" <join-column name=\"driver\"/>\n"
+" <join-column name=\"number\"/>\n"
+" <inverse-join-column
name=\"road_id\"/>\n"
+" <unique-constraint>\n"
+"
<column-name>driver</column-name>\n"
+"
<column-name>number</column-name>\n"
+" </unique-constraint>\n"
+" </join-table>\n"
+" </many-to-many>\n"
+" <many-to-many name=\"allTimeDrivers\"
mapped-by=\"drivenBuses"
+"\">\n"
+" </attributes>"
+msgstr ""
+
+#. Tag: para
+#: xml-overriding.xml:281
+#, no-c-format
+msgid ""
+"You can override an association through <literal>one-to-many</literal>,
"
+"<literal>one-to-one</literal>,
<literal>many-to-one</literal>, and "
+"<literal>many-to-many</literal>. Each of these elements can have
subelements "
+"accordingly: <literal>join-table</literal> (which can have
<literal>join-"
+"column</literal>s and <literal>inverse-join-column</literal>s),
"
+"<literal><literal>join-column</literal>s</literal>,
<literal>map-key</"
+"literal>, and <literal>order-by</literal>.
<literal>mapped-by</literal> and "
+"<literal>target-entity</literal> can be defined as attributes when it
makes "
+"sense. Once again the structure is reflects the annotations structure. You "
+"can find all semantic informations in the chapter describing annotations."
+msgstr ""
+
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/publican.cfg
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/publican.cfg
(rev 0)
+++ annotations/branches/v3_4_0_GA_CP/src/main/docbook/publican.cfg 2009-12-22 06:50:19
UTC (rev 18313)
@@ -0,0 +1,9 @@
+# Config::Simple 4.59
+# Wed Nov 25 14:45:00 2009
+
+debug: 1
+xml_lang: en-US
+brand: jboss-community-hibernate
+show_remarks: 1
+
+
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/zh-CN/Author_Group.po
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/zh-CN/Author_Group.po
(rev 0)
+++ annotations/branches/v3_4_0_GA_CP/src/main/docbook/zh-CN/Author_Group.po 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,5 @@
+#. Tag: author
+#: Author_Group.xml:6
+#, no-c-format
+msgid "<firstname>Red Hat Documentation Group</firstname>
<surname></surname>"
+msgstr ""
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/zh-CN/Book_Info.po
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/zh-CN/Book_Info.po
(rev 0)
+++ annotations/branches/v3_4_0_GA_CP/src/main/docbook/zh-CN/Book_Info.po 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,25 @@
+#. Tag: title
+#: Book_Info.xml:6
+#, no-c-format
+msgid "Hibernate Annotations Reference Guide"
+msgstr ""
+
+#. Tag: subtitle
+#: Book_Info.xml:7
+#, no-c-format
+msgid "for Use with JBoss Enterprise Application Platform 5.0"
+msgstr ""
+
+#. Tag: para
+#: Book_Info.xml:14
+#, no-c-format
+msgid ""
+"The JBoss Enterprise Application Platform Edition of the Hibernate "
+"Annotations Reference Guide"
+msgstr ""
+
+#. Tag: holder
+#: Book_Info.xml:25
+#, no-c-format
+msgid "&HOLDER;"
+msgstr ""
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/zh-CN/Feedback.po
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/zh-CN/Feedback.po
(rev 0)
+++ annotations/branches/v3_4_0_GA_CP/src/main/docbook/zh-CN/Feedback.po 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,19 @@
+#. Tag: title
+#: Feedback.xml:6
+#, no-c-format
+msgid "Feedback"
+msgstr ""
+
+#. Tag: para
+#: Feedback.xml:7
+#, no-c-format
+msgid ""
+"If you spot a typo in this guide, or if you have thought of a way to make "
+"this manual better, we would love to hear from you! Submit a report in "
+"<ulink
url=\"http://jira.jboss.com/jira/browse/JBPAPP\">JIRA</ul... against
"
+"the Product: JBoss Enterprise Application Platform, Version: "
+"<replaceable><version></replaceable>, Component:
<emphasis>Doc</"
+"emphasis>. If you have a suggestion for improving the documentation, try to
"
+"be as specific as possible. If you have found an error, include the section "
+"number and some of the surrounding text so we can find it easily."
+msgstr ""
Added:
annotations/branches/v3_4_0_GA_CP/src/main/docbook/zh-CN/Hibernate_Annotations_Reference_Guide.po
===================================================================
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/zh-CN/Preface.po
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/zh-CN/Preface.po
(rev 0)
+++ annotations/branches/v3_4_0_GA_CP/src/main/docbook/zh-CN/Preface.po 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,45 @@
+#. Tag: title
+#: Preface.xml:2
+#, no-c-format
+msgid "Preface"
+msgstr ""
+
+#. Tag: para
+#: Preface.xml:4
+#, no-c-format
+msgid ""
+"Hibernate, like all other object/relational mapping tools, requires metadata
"
+"that governs the transformation of data from one representation to the "
+"other. In Hibernate 2.x mapping metadata is most of the time declared in XML
"
+"text files. Alternatively XDoclet can be used utilizing Javadoc source code "
+"annotations together with a compile time preprocessor."
+msgstr ""
+
+#. Tag: para
+#: Preface.xml:11
+#, no-c-format
+msgid ""
+"The same kind of annotation support is now available in the standard JDK, "
+"although more powerful and with better tools support. IntelliJ IDEA and "
+"Eclipse for example, support auto-completion and syntax highlighting of JDK "
+"5.0 annotations which are compiled into the bytecode and read at runtime "
+"using reflection. No external XML files are needed."
+msgstr ""
+
+#. Tag: para
+#: Preface.xml:17
+#, no-c-format
+msgid ""
+"The EJB3 specification recognizes the interest and the success of the "
+"transparent object/relational mapping paradigm. It standardizes the basic "
+"APIs and the metadata needed for any object/relational persistence "
+"mechanism. <emphasis>Hibernate EntityManager</emphasis> implements the
"
+"programming interfaces and lifecycle rules as defined by the EJB3 "
+"persistence specification and together with <emphasis>Hibernate
Annotations</"
+"emphasis> offers a complete (and standalone) EJB3 persistence solution on
"
+"top of the mature Hibernate core. You may use a combination of all three "
+"together, annotations without EJB3 programming interfaces and lifecycle, or "
+"even pure native Hibernate, depending on the business and technical needs of
"
+"your project. At all times you cann fall back to Hibernate native APIs, or "
+"if required, even to native JDBC and SQL."
+msgstr ""
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/zh-CN/Revision_History.po
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/zh-CN/Revision_History.po
(rev 0)
+++
annotations/branches/v3_4_0_GA_CP/src/main/docbook/zh-CN/Revision_History.po 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,19 @@
+#. Tag: title
+#: Revision_History.xml:6
+#, no-c-format
+msgid "Revision History"
+msgstr ""
+
+#. Tag: author
+#: Revision_History.xml:12
+#, no-c-format
+msgid ""
+"<firstname>Laura</firstname> <surname>Bailey</surname>
<email>lbailey(a)redhat."
+"com</email>"
+msgstr ""
+
+#. Tag: member
+#: Revision_History.xml:19
+#, no-c-format
+msgid "Initial draft."
+msgstr ""
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/zh-CN/additionalmodules.po
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/zh-CN/additionalmodules.po
(rev 0)
+++
annotations/branches/v3_4_0_GA_CP/src/main/docbook/zh-CN/additionalmodules.po 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,178 @@
+#. Tag: title
+#: additionalmodules.xml:28
+#, no-c-format
+msgid "Additional modules"
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:30
+#, no-c-format
+msgid ""
+"Hibernate Annotations mainly focus on persistence metadata. The project also
"
+"have a nice integration with two Hibernate modules."
+msgstr ""
+
+#. Tag: title
+#: additionalmodules.xml:34
+#, no-c-format
+msgid "Hibernate Validator"
+msgstr ""
+
+#. Tag: title
+#: additionalmodules.xml:37 additionalmodules.xml:117
+#, no-c-format
+msgid "Description"
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:39
+#, no-c-format
+msgid ""
+"Annotations are a very convenient and elegant way to specify invariant "
+"constraints for a domain model. You can, for example, express that a "
+"property should never be null, that the account balance should be strictly "
+"positive, etc. These domain model constraints are declared in the bean "
+"itself by annotating its properties. A validator can then read them and "
+"check for constraint violations. The validation mechanism can be executed in
"
+"different layers in your application without having to duplicate any of "
+"these rules (presentation layer, data access layer). Following the DRY "
+"principle, Hibernate Validator has been designed for that purpose."
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:50
+#, no-c-format
+msgid ""
+"Hibernate Validator works at two levels. First, it is able to check in-"
+"memory instances of a class for constraint violations. Second, it can apply "
+"the constraints to the Hibernate metamodel and incorporate them into the "
+"generated database schema."
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:55
+#, no-c-format
+msgid ""
+"Each constraint annotation is associated to a validator implementation "
+"responsible for checking the constraint on the entity instance. A validator "
+"can also (optionally) apply the constraint to the Hibernate metamodel, "
+"allowing Hibernate to generate DDL that expresses the constraint. With the "
+"appropriate event listener, you can execute the checking operation on "
+"inserts and updates done by Hibernate. Hibernate Validator is not limited to
"
+"use with Hibernate. You can easily use it anywhere in your application."
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:64
+#, no-c-format
+msgid ""
+"When checking instances at runtime, Hibernate Validator returns information "
+"about constraint violations in an array of
<classname>InvalidValue</"
+"classname> s. Among other information, the
<classname>InvalidValue</"
+"classname> contains an error description message that can embed the "
+"parameter values bundle with the annotation (eg. length limit), and message "
+"strings that may be externalized to a
<classname>ResourceBundle</classname> ."
+msgstr ""
+
+#. Tag: title
+#: additionalmodules.xml:74 additionalmodules.xml:132
+#, no-c-format
+msgid "Integration with Hibernate Annotations"
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:76
+#, no-c-format
+msgid ""
+"If Hibernate Validator (<filename>hibernate-validator.jar</filename>)
is "
+"available in the classpath, Hibernate Annotations will integrate in two
ways:"
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:82
+#, no-c-format
+msgid ""
+"Constraints will be applied to the Data Definition Language. In other words,
"
+"the database schema will reflect the constraints (provided that you use the "
+"hbm2ddl tool)."
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:88
+#, no-c-format
+msgid ""
+"Before an entity change is applied to the database (insert or update), the "
+"entity is validated. Validation errors, if any, will be carried over through
"
+"an <classname>InvalidStateException</classname>."
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:95
+#, no-c-format
+msgid ""
+"For entities free of validation rules, the runtime performance cost is null."
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:98
+#, no-c-format
+msgid ""
+"To disable constraint propagation to DDL, set up <literal>hibernate."
+"validator.apply_to_ddl</literal> to false in the configuration file. Such a
"
+"need is very uncommon and not recommended."
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:103
+#, no-c-format
+msgid ""
+"To disable pre-entity change validation, set up
<literal>hibernate.validator."
+"autoregister_listeners</literal> to false in the configuration file. Such a
"
+"need is very uncommon and not recommended."
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:108
+#, no-c-format
+msgid ""
+"Check the Hibernate Validator reference documentation for more information."
+msgstr ""
+
+#. Tag: title
+#: additionalmodules.xml:114
+#, no-c-format
+msgid "Hibernate Search"
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:119
+#, no-c-format
+msgid ""
+"Full text search engines like <productname>Apache Lucene</productname>
are a "
+"very powerful technology to bring free text/efficient queries to "
+"applications. If suffers several mismatches when dealing with a object "
+"domain model (keeping the index up to date, mismatch between the index "
+"structure and the domain model, querying mismatch...) Hibernate Search "
+"indexes your domain model thanks to a few annotations, takes care of the "
+"database / index synchronization and brings you back regular managed objects
"
+"from free text queries. Hibernate Search is using <ulink
url=\"http://lucene."
+"apache.org\">Apache Lucene</ulink> under the cover."
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:134
+#, no-c-format
+msgid ""
+"Hibernate Search integrates with Hibernate Annotations transparently "
+"provided that hibernate-search.jar is present in the classpath. If you do "
+"not wish to automatically register Hibernate Search event listeners, you can
"
+"set <literal>hibernate.search.autoregister_listeners</literal> to
false. "
+"Such a need is very uncommon and not recommended."
+msgstr ""
+
+#. Tag: para
+#: additionalmodules.xml:141
+#, no-c-format
+msgid ""
+"Check the Hibernate Search reference documentation for more information."
+msgstr ""
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/zh-CN/entity.po
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/zh-CN/entity.po
(rev 0)
+++ annotations/branches/v3_4_0_GA_CP/src/main/docbook/zh-CN/entity.po 2009-12-22 06:50:19
UTC (rev 18313)
@@ -0,0 +1,5481 @@
+#. Tag: title
+#: entity.xml:28
+#, no-c-format
+msgid "Entity Beans"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:31
+#, no-c-format
+msgid "Intro"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:33
+#, no-c-format
+msgid ""
+"This section covers EJB 3.0 (aka Java Persistence) entity annotations and "
+"Hibernate-specific extensions."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:38
+#, no-c-format
+msgid "Mapping with EJB3/JPA Annotations"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:40
+#, no-c-format
+msgid ""
+"EJB3 entities are plain POJOs. Actually they represent the exact same "
+"concept as the Hibernate persistent entities. Their mappings are defined "
+"through JDK 5.0 annotations (an XML descriptor syntax for overriding is "
+"defined in the EJB3 specification). Annotations can be split in two "
+"categories, the logical mapping annotations (allowing you to describe the "
+"object model, the class associations, etc.) and the physical mapping "
+"annotations (describing the physical schema, tables, columns, indexes, etc).
"
+"We will mix annotations from both categories in the following code examples."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:50
+#, no-c-format
+msgid ""
+"EJB3 annotations are in the <literal>javax.persistence.*</literal>
package. "
+"Most JDK 5 compliant IDE (like Eclipse, IntelliJ IDEA and Netbeans) can "
+"autocomplete annotation interfaces and attributes for you (even without a "
+"specific \"EJB3\" module, since EJB3 annotations are plain JDK 5 "
+"annotations)."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:56
+#, no-c-format
+msgid ""
+"For more and runnable concrete examples read the JBoss EJB 3.0 tutorial or "
+"review the Hibernate Annotations test suite. Most of the unit tests have "
+"been designed to represent a concrete example and be a inspiration source."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:62
+#, no-c-format
+msgid "Declaring an entity bean"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:64
+#, no-c-format
+msgid ""
+"Every bound persistent POJO class is an entity bean and is declared using "
+"the <literal>@Entity</literal> annotation (at the class level):"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:68
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Flight implements Serializable {\n"
+" Long id;\n"
+"\n"
+" @Id\n"
+" public Long getId() { return id; }\n"
+"\n"
+" public void setId(Long id) { this.id = id; }\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:70
+#, no-c-format
+msgid ""
+"<literal>@Entity</literal> declares the class as an entity bean (i.e. a
"
+"persistent POJO class), <literal>@Id</literal> declares the identifier
"
+"property of this entity bean. The other mapping declarations are implicit. "
+"This configuration by exception concept is central to the new EJB3 "
+"specification and a major improvement. The class Flight is mapped to the "
+"Flight table, using the column id as its primary key column."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:78
+#, no-c-format
+msgid ""
+"Depending on whether you annotate fields or methods, the access type used by
"
+"Hibernate will be <literal>field</literal> or
<literal>property</literal>. "
+"The EJB3 spec requires that you declare annotations on the element type that
"
+"will be accessed, i.e. the getter method if you use
<literal>property</"
+"literal> access, the field if you use <literal>field</literal>
access. "
+"Mixing EJB3 annotations in both fields and methods should be avoided. "
+"Hibernate will guess the access type from the position of
<literal>@Id</"
+"literal> or <literal>(a)EmbeddedId</literal>."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:89
+#, no-c-format
+msgid "Defining the table"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:91
+#, no-c-format
+msgid ""
+"<literal>@Table</literal> is set at the class level; it allows you to
define "
+"the table, catalog, and schema names for your entity bean mapping. If no "
+"<literal>@Table</literal> is defined the default values are used: the
"
+"unqualified class name of the entity."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:96
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Table(name=\"tbl_sky\")\n"
+"public class Sky implements Serializable {\n"
+"..."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:98
+#, no-c-format
+msgid ""
+"The <literal>@Table</literal> element also contains a
<literal>schema</"
+"literal> and a <literal>catalog</literal> attributes, if they need
to be "
+"defined. You can also define unique constraints to the table using the "
+"<literal>@UniqueConstraint</literal> annotation in conjunction with
"
+"<literal>@Table</literal> (for a unique constraint bound to a single
column, "
+"refer to <literal>(a)Column</literal>)."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:105
+#, no-c-format
+msgid ""
+"@Table(name=\"tbl_sky\",\n"
+" <emphasis role=\"bold\">uniqueConstraints =
{@UniqueConstraint"
+"(columnNames={\"month\", \"day\"})}</emphasis>\n"
+")"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:107
+#, no-c-format
+msgid ""
+"A unique constraint is applied to the tuple month, day. Note that the "
+"<literal>columnNames</literal> array refers to the logical column
names."
+msgstr ""
+
+#. Tag: remark
+#: entity.xml:111
+#, no-c-format
+msgid ""
+"The logical column name is defined by the Hibernate NamingStrategy "
+"implementation. The default EJB3 naming strategy use the physical column "
+"name as the logical column name. Note that this may be different than the "
+"property name (if the column name is explicit). Unless you override the "
+"NamingStrategy, you shouldn't worry about that."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:120
+#, no-c-format
+msgid "Versioning for optimistic locking"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:122
+#, no-c-format
+msgid ""
+"You can add optimistic locking capability to an entity bean using the "
+"<literal>@Version</literal> annotation:"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:125
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Flight implements Serializable {\n"
+"...\n"
+" @Version\n"
+" @Column(name=\"OPTLOCK\")\n"
+" public Integer getVersion() { ... }\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:127
+#, no-c-format
+msgid ""
+"The version property will be mapped to the <literal>OPTLOCK</literal>
"
+"column, and the entity manager will use it to detect conflicting updates "
+"(preventing lost updates you might otherwise see with the last-commit-wins "
+"strategy)."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:132
+#, no-c-format
+msgid ""
+"The version column may be a numeric (the recommended solution) or a "
+"timestamp as per the EJB3 spec. Hibernate support any kind of type provided "
+"that you define and implement the appropriate
<classname>UserVersionType</"
+"classname>."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:137
+#, no-c-format
+msgid ""
+"The application must not alter the version number set up by Hibernate in any
"
+"way. To artificially increase the version number, check in Hibernate Entity "
+"Manager's reference documentation
<literal>LockMode.WRITE</literal>"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:145
+#, no-c-format
+msgid "Mapping simple properties"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:148
+#, no-c-format
+msgid "Declaring basic property mappings"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:150
+#, no-c-format
+msgid ""
+"Every non static non transient property (field or method) of an entity bean "
+"is considered persistent, unless you annotate it as
<literal>@Transient</"
+"literal>. Not having an annotation for your property is equivalent to the
"
+"appropriate <literal>@Basic</literal> annotation. The
<literal>@Basic</"
+"literal> annotation allows you to declare the fetching strategy for a "
+"property:"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:157
+#, no-c-format
+msgid ""
+"public transient int counter; //transient property\n"
+"\n"
+"private String firstname; //persistent property\n"
+"\n"
+"@Transient\n"
+"String getLengthInMeter() { ... } //transient property\n"
+"\n"
+"String getName() {... } // persistent property\n"
+"\n"
+"@Basic\n"
+"int getLength() { ... } // persistent property\n"
+"\n"
+"@Basic(fetch = FetchType.LAZY)\n"
+"String getDetailedComment() { ... } // persistent property\n"
+"\n"
+"(a)Temporal(TemporalType.TIME)\n"
+"java.util.Date getDepartureTime() { ... } // persistent property
\n"
+"\n"
+"(a)Enumerated(EnumType.STRING)\n"
+"Starred getNote() { ... } //enum persisted as String in database"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:159
+#, no-c-format
+msgid ""
+"<literal>counter</literal>, a transient field, and
<literal>lengthInMeter</"
+"literal>, a method annotated as <literal>@Transient</literal>, and
will be "
+"ignored by the entity manager. <literal>name</literal>,
<literal>length</"
+"literal>, and <literal>firstname</literal> properties are mapped
persistent "
+"and eagerly fetched (the default for simple properties). The "
+"<literal>detailedComment</literal> property value will be lazily
fetched "
+"from the database once a lazy property of the entity is accessed for the "
+"first time. Usually you don't need to lazy simple properties (not to be "
+"confused with lazy association fetching)."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:171
+#, no-c-format
+msgid ""
+"To enable property level lazy fetching, your classes have to be "
+"instrumented: bytecode is added to the original one to enable such feature, "
+"please refer to the Hibernate reference documentation. If your classes are "
+"not instrumented, property level lazy loading is silently ignored."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:178
+#, no-c-format
+msgid ""
+"The recommended alternative is to use the projection capability of EJB-QL or
"
+"Criteria queries."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:181
+#, no-c-format
+msgid ""
+"EJB3 support property mapping of all basic types supported by Hibernate (all
"
+"basic Java types , their respective wrappers and serializable classes). "
+"Hibernate Annotations support out of the box Enum type mapping either into a
"
+"ordinal column (saving the enum ordinal) or a string based column (saving "
+"the enum string representation): the persistence representation, defaulted "
+"to ordinal, can be overriden through the <literal>@Enumerated</literal>
"
+"annotation as shown in the <literal>note</literal> property
example."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:190
+#, no-c-format
+msgid ""
+"In core Java APIs, the temporal precision is not defined. When dealing with "
+"temporal data you might want to describe the expected precision in database.
"
+"Temporal data can have <literal>DATE</literal>,
<literal>TIME</literal>, or "
+"<literal>TIMESTAMP</literal> precision (ie the actual date, only the
time, "
+"or both). Use the <literal>@Temporal</literal> annotation to fine tune
that."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:197
+#, no-c-format
+msgid ""
+"<literal>@Lob</literal> indicates that the property should be persisted
in a "
+"Blob or a Clob depending on the property type:
<classname>java.sql.Clob</"
+"classname>, <classname>Character[]</classname>,
<classname>char[]</"
+"classname> and java.lang.<classname>String</classname> will be
persisted in "
+"a Clob. <classname>java.sql.Blob</classname>,
<classname>Byte[]</classname>, "
+"<classname>byte[] </classname>and serializable type will be persisted
in a "
+"Blob."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:206
+#, no-c-format
+msgid ""
+"@Lob\n"
+"public String getFullText() {\n"
+" return fullText;\n"
+"}\n"
+"\n"
+"@Lob \n"
+"public byte[] getFullCode() {\n"
+" return fullCode;\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:208
+#, no-c-format
+msgid ""
+"If the property type implements
<classname>java.io.Serializable</classname> "
+"and is not a basic type, and if the property is not annotated with "
+"<literal>@Lob</literal>, then the Hibernate
<literal>serializable</literal> "
+"type is used."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:216
+#, no-c-format
+msgid "Declaring column attributes"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:218
+#, no-c-format
+msgid ""
+"The column(s) used for a property mapping can be defined using the "
+"<literal>@Column</literal> annotation. Use it to override default
values "
+"(see the EJB3 specification for more information on the defaults). You can "
+"use this annotation at the property level for properties that are:"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:226
+#, no-c-format
+msgid "not annotated at all"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:230
+#, no-c-format
+msgid "annotated with <literal>@Basic</literal>"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:234
+#, no-c-format
+msgid "annotated with <literal>@Version</literal>"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:238
+#, no-c-format
+msgid "annotated with <literal>@Lob</literal>"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:242
+#, no-c-format
+msgid "annotated with <literal>@Temporal</literal>"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:246
+#, no-c-format
+msgid ""
+"annotated with
<literal>(a)org.hibernate.annotations.CollectionOfElements</"
+"literal> (for Hibernate only)"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:252
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Flight implements Serializable {\n"
+"...\n"
+"@Column(updatable = false, name = \"flight_name\", nullable = false,
"
+"length=50)\n"
+"public String getName() { ... }"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:254
+#, no-c-format
+msgid ""
+"The <literal>name</literal> property is mapped to the
<literal>flight_name</"
+"literal> column, which is not nullable, has a length of 50 and is not "
+"updatable (making the property immutable)."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:259
+#, no-c-format
+msgid ""
+"This annotation can be applied to regular properties as well as "
+"<literal>@Id</literal> or <literal>@Version</literal>
properties."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:286
+#, no-c-format
+msgid ""
+"@Column(\n"
+" name=\"columnName\";\n"
+" boolean unique() default false;\n"
+" boolean nullable() default true;\n"
+" boolean insertable() default true;\n"
+" boolean updatable() default true;\n"
+" String columnDefinition() default \"\";\n"
+" String table() default \"\";\n"
+" int length() default 255;\n"
+" int precision() default 0; // decimal precision\n"
+" int scale() default 0; // decimal scale"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:290
+#, no-c-format
+msgid ""
+"<literal>name</literal> (optional): the column name (default to the
property "
+"name)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:295
+#, no-c-format
+msgid ""
+"<literal>unique</literal> (optional): set a unique constraint on this
column "
+"or not (default false)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:300
+#, no-c-format
+msgid ""
+"<literal>nullable</literal> (optional): set the column as nullable
(default "
+"true)."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:305
+#, no-c-format
+msgid ""
+"<literal>insertable</literal> (optional): whether or not the column
will be "
+"part of the insert statement (default true)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:311
+#, no-c-format
+msgid ""
+"<literal>updatable</literal> (optional): whether or not the column will
be "
+"part of the update statement (default true)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:317
+#, no-c-format
+msgid ""
+"<literal>columnDefinition</literal> (optional): override the sql DDL
"
+"fragment for this particular column (non portable)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:323
+#, no-c-format
+msgid ""
+"<literal>table</literal> (optional): define the targeted table (default
"
+"primary table)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:328
+#, no-c-format
+msgid ""
+"<literal><literal>length</literal></literal> (optional):
column length "
+"(default 255)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:333
+#, no-c-format
+msgid ""
+"<literal><literal>precision</literal></literal> (optional):
column decimal "
+"precision (default 0)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:338
+#, no-c-format
+msgid ""
+"<literal><literal>scale</literal></literal> (optional):
column decimal scale "
+"if useful (default 0)"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:346
+#, no-c-format
+msgid "Embedded objects (aka components)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:348
+#, no-c-format
+msgid ""
+"It is possible to declare an embedded component inside an entity and even "
+"override its column mapping. Component classes have to be annotated at the "
+"class level with the <literal>@Embeddable</literal> annotation. It is
"
+"possible to override the column mapping of an embedded object for a "
+"particular entity using the <literal>@Embedded</literal> and "
+"<literal>@AttributeOverride</literal> annotation in the associated
property:"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:356
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Person implements Serializable {\n"
+"\n"
+" // Persistent component using defaults\n"
+" Address homeAddress;\n"
+"\n"
+" @Embedded\n"
+" @AttributeOverrides( {\n"
+" @AttributeOverride(name=\"iso2\", column =
@Column(name="
+"\"bornIso2\") ),\n"
+" @AttributeOverride(name=\"name\", column =
@Column(name="
+"\"bornCountryName\") )\n"
+" } )\n"
+" Country bornIn;\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:358
+#, no-c-format
+msgid ""
+"@Embeddable\n"
+"public class Address implements Serializable {\n"
+" String city;\n"
+" Country nationality; //no overriding here\n"
+"}"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:360
+#, no-c-format
+msgid ""
+"@Embeddable\n"
+"public class Country implements Serializable {\n"
+" private String iso2;\n"
+" @Column(name=\"countryName\") private String name;\n"
+"\n"
+" public String getIso2() { return iso2; }\n"
+" public void setIso2(String iso2) { this.iso2 = iso2; }\n"
+"\n"
+" \n"
+" public String getName() { return name; }\n"
+" public void setName(String name) { this.name = name; }\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:362
+#, no-c-format
+msgid ""
+"A embeddable object inherit the access type of its owning entity (note that "
+"you can override that using the Hibernate specific
<literal>@AccessType</"
+"literal> annotations (see <xref
linkend=\"entity-hibspec\"/>)."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:367
+#, no-c-format
+msgid ""
+"The <literal>Person</literal> entity bean has two component properties,
"
+"<literal>homeAddress</literal> and
<literal>bornIn</literal>. "
+"<literal>homeAddress</literal> property has not been annotated, but
"
+"Hibernate will guess that it is a persistent component by looking for the "
+"<literal>@Embeddable</literal> annotation in the Address class. We also
"
+"override the mapping of a column name (to
<literal>bornCountryName</"
+"literal>) with the <literal>@Embedded</literal> and "
+"<literal>@AttributeOverride </literal>annotations for each mapped
attribute "
+"of <literal>Country</literal>. As you can see, <literal>Country
</literal>is "
+"also a nested component of <literal>Address</literal>, again using
auto-"
+"detection by Hibernate and EJB3 defaults. Overriding columns of embedded "
+"objects of embedded objects is currently not supported in the EJB3 spec, "
+"however, Hibernate Annotations supports it through dotted expressions."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:383
+#, no-c-format
+msgid ""
+"@Embedded\n"
+" @AttributeOverrides( {\n"
+" @AttributeOverride(name=\"city\", column =
@Column(name="
+"\"fld_city\") ),\n"
+" @AttributeOverride(name=\"<emphasis
role=\"bold\">nationality."
+"iso2</emphasis>\", column = @Column(name=\"nat_Iso2\")
),\n"
+" @AttributeOverride(name=\"<emphasis
role=\"bold\">nationality."
+"name</emphasis>\", column = @Column(name=\"nat_CountryName\")
)\n"
+" //nationality columns in homeAddress are overridden\n"
+" } )\n"
+" Address homeAddress;"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:383
+#, no-c-format
+msgid ""
+"Hibernate Annotations supports one more feature that is not explicitly "
+"supported by the EJB3 specification. You can annotate a embedded object with
"
+"the <literal>@MappedSuperclass</literal> annotation to make the
superclass "
+"properties persistent (see <literal>@MappedSuperclass</literal> for
more "
+"informations)."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:390
+#, no-c-format
+msgid ""
+"While not supported by the EJB3 specification, Hibernate Annotations allows "
+"you to use association annotations in an embeddable object (ie "
+"<literal>@*ToOne</literal> nor
<literal>@*ToMany</literal>). To override the "
+"association columns you can use
<literal>(a)AssociationOverride</literal>."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:396
+#, no-c-format
+msgid ""
+"If you want to have the same embeddable object type twice in the same "
+"entity, the column name defaulting will not work: at least one of the "
+"columns will have to be explicit. Hibernate goes beyond the EJB3 spec and "
+"allows you to enhance the defaulting mechanism through the "
+"<classname>NamingStrategy</classname>. "
+"<classname>DefaultComponentSafeNamingStrategy</classname> is a small
"
+"improvement over the default EJB3NamingStrategy that allows embedded objects
"
+"to be defaulted even if used twice in the same entity."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:407
+#, no-c-format
+msgid "Non-annotated property defaults"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:409
+#, no-c-format
+msgid "If a property is not annotated, the following rules apply:"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:414
+#, no-c-format
+msgid "If the property is of a single type, it is mapped as @Basic"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:420
+#, no-c-format
+msgid ""
+"Otherwise, if the type of the property is annotated as @Embeddable, it is "
+"mapped as @Embedded"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:426
+#, no-c-format
+msgid ""
+"Otherwise, if the type of the property is Serializable, it is mapped as "
+"@Basic in a column holding the object in its serialized version"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:432
+#, no-c-format
+msgid ""
+"Otherwise, if the type of the property is java.sql.Clob or java.sql.Blob, it
"
+"is mapped as @Lob with the appropriate LobType"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:441
+#, no-c-format
+msgid "Mapping identifier properties"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:443
+#, no-c-format
+msgid ""
+"The <literal>@Id</literal> annotation lets you define which property is
the "
+"identifier of your entity bean. This property can be set by the application "
+"itself or be generated by Hibernate (preferred). You can define the "
+"identifier generation strategy thanks to the
<literal>@GeneratedValue</"
+"literal> annotation:"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:451
+#, no-c-format
+msgid ""
+"AUTO - either identity column, sequence or table depending on the underlying
"
+"DB"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:457
+#, no-c-format
+msgid "TABLE - table holding the id"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:463
+#, no-c-format
+msgid "IDENTITY - identity column"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:469
+#, no-c-format
+msgid "SEQUENCE - sequence"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:475
+#, no-c-format
+msgid ""
+"Hibernate provides more id generators than the basic EJB3 ones. Check <xref
"
+"linkend=\"entity-hibspec\"/> for more informations."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:478
+#, no-c-format
+msgid ""
+"The following example shows a sequence generator using the SEQ_STORE "
+"configuration (see below)"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:481
+#, no-c-format
+msgid ""
+"@Id @GeneratedValue(strategy=GenerationType.SEQUENCE,
generator=\"SEQ_STORE"
+"\")\n"
+"public Integer getId() { ... }"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:483
+#, no-c-format
+msgid "The next example uses the identity generator:"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:485
+#, no-c-format
+msgid ""
+"@Id @GeneratedValue(strategy=GenerationType.IDENTITY)\n"
+"public Long getId() { ... }"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:487
+#, no-c-format
+msgid ""
+"The <literal>AUTO</literal> generator is the preferred type for
portable "
+"applications (across several DB vendors). The identifier generation "
+"configuration can be shared for several <literal>@Id</literal> mappings
with "
+"the generator attribute. There are several configurations available through "
+"<literal>@SequenceGenerator</literal> and
<literal>@TableGenerator</"
+"literal>. The scope of a generator can be the application or the class. "
+"Class-defined generators are not visible outside the class and can override "
+"application level generators. Application level generators are defined at "
+"XML level (see <xref linkend=\"xml-overriding\"/>):"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:499
+#, no-c-format
+msgid ""
+"<table-generator name=\"EMP_GEN\"\n"
+" table=\"GENERATOR_TABLE\"\n"
+" pk-column-name=\"key\"\n"
+" value-column-name=\"hi\"\n"
+" pk-column-value=\"EMP\"\n"
+" allocation-size=\"20\"/>\n"
+"\n"
+"//and the annotation equivalent\n"
+"\n"
+"(a)javax.persistence.TableGenerator(\n"
+" name=\"EMP_GEN\",\n"
+" table=\"GENERATOR_TABLE\",\n"
+" pkColumnName = \"key\",\n"
+" valueColumnName = \"hi\"\n"
+" pkColumnValue=\"EMP\",\n"
+" allocationSize=20\n"
+")\n"
+"\n"
+"<sequence-generator name=\"SEQ_GEN\" \n"
+" sequence-name=\"my_sequence\"\n"
+" allocation-size=\"20\"/>\n"
+"\n"
+"//and the annotation equivalent\n"
+"\n"
+"(a)javax.persistence.SequenceGenerator(\n"
+" name=\"SEQ_GEN\",\n"
+" sequenceName=\"my_sequence\",\n"
+" allocationSize=20\n"
+")"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:501
+#, no-c-format
+msgid ""
+"If JPA XML (like <filename>META-INF/orm.xml</filename>) is used to
define "
+"thegenerators, <literal>EMP_GEN</literal> and
<literal>SEQ_GEN</literal> are "
+"application level generators. <literal>EMP_GEN</literal> defines a
table "
+"based id generator using the hilo algorithm with a
<literal>max_lo</literal> "
+"of 20. The hi value is kept in a <literal>table</literal> "
+"\"<literal>GENERATOR_TABLE</literal>\". The information is
kept in a row "
+"where <literal>pkColumnName</literal> \"key\" is equals to
"
+"<literal>pkColumnValue</literal>
\"<literal>EMP</literal>\" and column "
+"<literal>valueColumnName</literal>
\"<literal>hi</literal>\" contains the "
+"the next high value used."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:512
+#, no-c-format
+msgid ""
+"<literal>SEQ_GEN</literal> defines a sequence generator using a
sequence "
+"named <literal>my_sequence</literal>. The allocation size used for this
"
+"sequence based hilo algorithm is 20. Note that this version of Hibernate "
+"Annotations does not handle <literal>initialValue</literal> in the
sequence "
+"generator. The default allocation size is 50, so if you want to use a "
+"sequence and pickup the value each time, you must set the allocation size to
"
+"1."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:521
+#, no-c-format
+msgid ""
+"Package level definition is no longer supported by the EJB 3.0 "
+"specification. However, you can use the
<literal>@GenericGenerator</literal> "
+"at the package level (see <xref
linkend=\"entity-hibspec-identifier\"/>)."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:527
+#, no-c-format
+msgid ""
+"The next example shows the definition of a sequence generator in a class "
+"scope:"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:530
+#, no-c-format
+msgid ""
+"@Entity\n"
+"(a)javax.persistence.SequenceGenerator(\n"
+" name=\"SEQ_STORE\",\n"
+" sequenceName=\"my_sequence\"\n"
+")\n"
+"public class Store implements Serializable {\n"
+" private Long id;\n"
+"\n"
+" @Id @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="
+"\"SEQ_STORE\")\n"
+" public Long getId() { return id; }\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:532
+#, no-c-format
+msgid ""
+"This class will use a sequence named my_sequence and the SEQ_STORE generator
"
+"is not visible in other classes. Note that you can check the Hibernate "
+"Annotations tests in the
<package>org.hibernate.test.annotations.id</"
+"package> package for more examples."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:538
+#, no-c-format
+msgid "You can define a composite primary key through several syntaxes:"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:543
+#, no-c-format
+msgid ""
+"annotate the component property as @Id and make the component class "
+"@Embeddable"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:549
+#, no-c-format
+msgid "annotate the component property as @EmbeddedId"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:555
+#, no-c-format
+msgid ""
+"annotate the class as @IdClass and annotate each property of the entity "
+"involved in the primary key with @Id"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:561
+#, no-c-format
+msgid ""
+"While quite common to the EJB2 developer, <literal>@IdClass</literal>
is "
+"likely new for Hibernate users. The composite primary key class corresponds "
+"to multiple fields or properties of the entity class, and the names of "
+"primary key fields or properties in the primary key class and those of the "
+"entity class must match and their types must be the same. Let's look at an
"
+"example:"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:568
+#, no-c-format
+msgid ""
+"@Entity\n"
+"<emphasis
role=\"bold\">(a)IdClass(FootballerPk.class)</emphasis>\n"
+"public class Footballer {\n"
+" //part of the id key\n"
+" <emphasis role=\"bold\">@Id</emphasis> public String
getFirstname() {\n"
+" return firstname;\n"
+" }\n"
+"\n"
+" public void setFirstname(String firstname) {\n"
+" this.firstname = firstname;\n"
+" }\n"
+"\n"
+" //part of the id key\n"
+" <emphasis role=\"bold\">@Id</emphasis> public String
getLastname() {\n"
+" return lastname;\n"
+" }\n"
+"\n"
+" public void setLastname(String lastname) {\n"
+" this.lastname = lastname;\n"
+" }\n"
+"\n"
+" public String getClub() {\n"
+" return club;\n"
+" }\n"
+"\n"
+" public void setClub(String club) {\n"
+" this.club = club;\n"
+" }\n"
+"\n"
+" //appropriate equals() and hashCode() implementation\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"public class FootballerPk implements Serializable {\n"
+" //same name and type as in Footballer\n"
+" public String getFirstname() {\n"
+" return firstname;\n"
+" }\n"
+"\n"
+" public void setFirstname(String firstname) {\n"
+" this.firstname = firstname;\n"
+" }\n"
+"\n"
+" //same name and type as in Footballer\n"
+" public String getLastname() {\n"
+" return lastname;\n"
+" }\n"
+"\n"
+" public void setLastname(String lastname) {\n"
+" this.lastname = lastname;\n"
+" }\n"
+"\n"
+" //appropriate equals() and hashCode() implementation\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:570
+#, no-c-format
+msgid ""
+"As you may have seen, <literal>@IdClass</literal> points to the "
+"corresponding primary key class."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:573
+#, no-c-format
+msgid ""
+"While not supported by the EJB3 specification, Hibernate allows you to "
+"define associations inside a composite identifier. Simply use the regular "
+"annotations for that"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:577
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@AssociationOverride( name=\"id.channel\", joinColumns =
@JoinColumn(name="
+"\"chan_id\") )\n"
+"public class TvMagazin {\n"
+" @EmbeddedId public TvMagazinPk id;\n"
+" @Temporal(TemporalType.TIME) Date time;\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"public class TvMagazinPk implements Serializable {\n"
+" @ManyToOne\n"
+" public Channel channel;\n"
+" public String name;\n"
+" @ManyToOne\n"
+" public Presenter presenter;\n"
+"}"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:581
+#, no-c-format
+msgid "Mapping inheritance"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:583
+#, no-c-format
+msgid "EJB3 supports the three types of inheritance:"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:587
+#, no-c-format
+msgid "Table per Class Strategy: the <union-class> element in
Hibernate"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:593
+#, no-c-format
+msgid ""
+"Single Table per Class Hierarchy Strategy: the <subclass> element in
"
+"Hibernate"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:599
+#, no-c-format
+msgid ""
+"Joined Subclass Strategy: the <joined-subclass> element in
Hibernate"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:604
+#, no-c-format
+msgid ""
+"The chosen strategy is declared at the class level of the top level entity "
+"in the hierarchy using the <literal>@Inheritance</literal>
annotation."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:609
+#, no-c-format
+msgid "Annotating interfaces is currently not supported."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:613
+#, no-c-format
+msgid "Table per class"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:615
+#, no-c-format
+msgid ""
+"This strategy has many drawbacks (esp. with polymorphic queries and "
+"associations) explained in the EJB3 spec, the Hibernate reference "
+"documentation, Hibernate in Action, and many other places. Hibernate work "
+"around most of them implementing this strategy using <literal>SQL
UNION</"
+"literal> queries. It is commonly used for the top level of an inheritance
"
+"hierarchy:"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:622
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)\n"
+"public class Flight implements Serializable {"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:624
+#, no-c-format
+msgid ""
+"This strategy support one to many associations provided that they are "
+"bidirectional. This strategy does not support the
<literal>IDENTITY</"
+"literal> generator strategy: the id has to be shared across several tables.
"
+"Consequently, when using this strategy, you should not use <literal>AUTO
</"
+"literal>nor <literal>IDENTITY</literal>."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:633
+#, no-c-format
+msgid "Single table per class hierarchy"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:635
+#, no-c-format
+msgid ""
+"All properties of all super- and subclasses are mapped into the same table, "
+"instances are distinguished by a special discriminator column:"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:639
+#, no-c-format
+msgid ""
+"@Entity\n"
+"(a)Inheritance(strategy=InheritanceType.SINGLE_TABLE)\n"
+"@DiscriminatorColumn(\n"
+" name=\"planetype\",\n"
+" discriminatorType=DiscriminatorType.STRING\n"
+")\n"
+"@DiscriminatorValue(\"Plane\")\n"
+"public class Plane { ... }\n"
+"\n"
+"@Entity\n"
+"@DiscriminatorValue(\"A320\")\n"
+"public class A320 extends Plane { ... }"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:641
+#, no-c-format
+msgid ""
+"<classname>Plane</classname> is the superclass, it defines the
inheritance "
+"strategy <literal>InheritanceType.SINGLE_TABLE</literal>. It also
defines "
+"the discriminator column through the
<literal>@DiscriminatorColumn</literal> "
+"annotation, a discriminator column can also define the discriminator type. "
+"Finally, the <literal>@DiscriminatorValue</literal> annotation defines
the "
+"value used to differentiate a class in the hierarchy. All of these "
+"attributes have sensible default values. The default name of the "
+"discriminator column is <literal>DTYPE</literal>. The default
discriminator "
+"value is the entity name (as defined in
<literal>(a)Entity.name</literal>) for "
+"DiscriminatorType.STRING. <classname>A320</classname> is a subclass;
you "
+"only have to define discriminator value if you don't want to use the default
"
+"value. The strategy and the discriminator type are implicit."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:656
+#, no-c-format
+msgid ""
+"<literal>@Inheritance</literal> and
<literal>@DiscriminatorColumn</literal> "
+"should only be defined at the top of the entity hierarchy."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:662
+#, no-c-format
+msgid "Joined subclasses"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:664
+#, no-c-format
+msgid ""
+"The<literal> @PrimaryKeyJoinColumn</literal> and "
+"<literal>@PrimaryKeyJoinColumns</literal> annotations define the
primary key"
+"(s) of the joined subclass table:"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:668
+#, no-c-format
+msgid ""
+"@Entity\n"
+"(a)Inheritance(strategy=InheritanceType.JOINED)\n"
+"public class Boat implements Serializable { ... }\n"
+"\n"
+"@Entity\n"
+"public class Ferry extends Boat { ... }\n"
+"\n"
+"@Entity\n"
+"@PrimaryKeyJoinColumn(name=\"BOAT_ID\")\n"
+"public class AmericaCupClass extends Boat { ... }"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:670
+#, no-c-format
+msgid ""
+"All of the above entities use the <literal>JOINED</literal> strategy,
the "
+"<literal>Ferry</literal> table is joined with the
<literal>Boat</literal> "
+"table using the same primary key names. The
<literal>AmericaCupClass</"
+"literal> table is joined with <literal>Boat</literal> using the join
"
+"condition <code>Boat.id = AmericaCupClass.BOAT_ID</code>."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:679
+#, no-c-format
+msgid "Inherit properties from superclasses"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:681
+#, no-c-format
+msgid ""
+"This is sometimes useful to share common properties through a technical or a
"
+"business superclass without including it as a regular mapped entity (ie no "
+"specific table for this entity). For that purpose you can map them as "
+"<literal>(a)MappedSuperclass</literal>."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:686
+#, no-c-format
+msgid ""
+"@MappedSuperclass\n"
+"public class BaseEntity {\n"
+" @Basic\n"
+" @Temporal(TemporalType.TIMESTAMP)\n"
+" public Date getLastUpdate() { ... }\n"
+" public String getLastUpdater() { ... }\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity class Order extends BaseEntity {\n"
+" @Id public Integer getId() { ... }\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:688
+#, no-c-format
+msgid ""
+"In database, this hierarchy will be represented as an
<literal>Order</"
+"literal> table having the <literal>id</literal>,
<literal>lastUpdate</"
+"literal> and <literal>lastUpdater</literal> columns. The embedded
superclass "
+"property mappings are copied into their entity subclasses. Remember that the
"
+"embeddable superclass is not the root of the hierarchy though."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:696
+#, no-c-format
+msgid ""
+"Properties from superclasses not mapped as
<literal>@MappedSuperclass</"
+"literal> are ignored."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:701
+#, no-c-format
+msgid ""
+"The access type (field or methods), is inherited from the root entity, "
+"unless you use the Hibernate annotation
<literal>@AccessType</literal>"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:707
+#, no-c-format
+msgid ""
+"The same notion can be applied to <literal>@Embeddable</literal>
objects to "
+"persist properties from their superclasses. You also need to use "
+"<literal>@MappedSuperclass</literal> to do that (this should not be
"
+"considered as a standard EJB3 feature though)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:715
+#, no-c-format
+msgid ""
+"It is allowed to mark a class as <literal>@MappedSuperclass</literal>
in the "
+"middle of the mapped inheritance hierarchy."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:721
+#, no-c-format
+msgid ""
+"Any class in the hierarchy non annotated with
<literal>@MappedSuperclass</"
+"literal> nor <literal>@Entity</literal> will be ignored."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:726
+#, no-c-format
+msgid ""
+"You can override columns defined in entity superclasses at the root entity "
+"level using the <literal>@AttributeOverride</literal>
annotation."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:730
+#, no-c-format
+msgid ""
+"@MappedSuperclass\n"
+"public class FlyingObject implements Serializable {\n"
+"\n"
+" public int getAltitude() {\n"
+" return altitude;\n"
+" }\n"
+"\n"
+" @Transient\n"
+" public int getMetricAltitude() {\n"
+" return metricAltitude;\n"
+" }\n"
+"\n"
+" @ManyToOne\n"
+" public PropulsionType getPropulsion() {\n"
+" return metricAltitude;\n"
+" }\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"@AttributeOverride( name=\"altitude\", column =
@Column(name=\"fld_altitude"
+"\") )\n"
+"@AssociationOverride( name=\"propulsion\", joinColumns =
@JoinColumn(name="
+"\"fld_propulsion_fk\") )\n"
+"public class Plane extends FlyingObject {\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:732
+#, no-c-format
+msgid ""
+"The <literal>altitude</literal> property will be persisted in an
"
+"<literal>fld_altitude</literal> column of table
<literal>Plane</literal> and "
+"the propulsion association will be materialized in a "
+"<literal>fld_propulsion_fk</literal> foreign key column."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:738
+#, no-c-format
+msgid ""
+"You can define <literal>@AttributeOverride</literal>(s) and "
+"<literal>@AssociationOverride</literal>(s) on
<literal>@Entity</literal> "
+"classes, <literal>@MappedSuperclass</literal> classes and properties
"
+"pointing to an <literal>@Embeddable</literal> object."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:747
+#, no-c-format
+msgid "Mapping entity bean associations/relationships"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:750
+#, no-c-format
+msgid "One-to-one"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:752
+#, no-c-format
+msgid ""
+"You can associate entity beans through a one-to-one relationship using "
+"<literal>@OneToOne</literal>. There are three cases for one-to-one
"
+"associations: either the associated entities share the same primary keys "
+"values, a foreign key is held by one of the entities (note that this FK "
+"column in the database should be constrained unique to simulate one-to-one "
+"multiplicity), or a association table is used to store the link between the "
+"2 entities (a unique constraint has to be defined on each fk to ensure the "
+"one to one multiplicity)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:761
+#, no-c-format
+msgid "First, we map a real one-to-one association using shared primary keys:"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:764
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Body {\n"
+" @Id\n"
+" public Long getId() { return id; }\n"
+"\n"
+" @OneToOne(cascade = CascadeType.ALL)\n"
+" @PrimaryKeyJoinColumn\n"
+" public Heart getHeart() {\n"
+" return heart;\n"
+" }\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:766
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Heart {\n"
+" @Id\n"
+" public Long getId() { ...}\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:768
+#, no-c-format
+msgid ""
+"The one to one is marked as true by using the "
+"<literal>@PrimaryKeyJoinColumn</literal> annotation."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:771
+#, no-c-format
+msgid ""
+"In the following example, the associated entities are linked through a "
+"foreign key column:"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:774
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Customer implements Serializable {\n"
+" @OneToOne(cascade = CascadeType.ALL)\n"
+" <emphasis
role=\"bold\">@JoinColumn(name=\"passport_fk\")</emphasis>\n"
+" public Passport getPassport() {\n"
+" ...\n"
+" }\n"
+"\n"
+"@Entity\n"
+"public class Passport implements Serializable {\n"
+" @OneToOne(<emphasis role=\"bold\">mappedBy =
\"passport\"</emphasis>)\n"
+" public Customer getOwner() {\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:776
+#, no-c-format
+msgid ""
+"A <classname>Customer</classname> is linked to a
<classname>Passport</"
+"classname>, with a foreign key column named
<literal>passport_fk</literal> "
+"in the <literal>Customer</literal> table. The join column is declared
with "
+"the <literal>@JoinColumn</literal> annotation which looks like the
"
+"<literal>@Column</literal> annotation. It has one more parameters named
"
+"<literal>referencedColumnName</literal>. This parameter declares the
column "
+"in the targeted entity that will be used to the join. Note that when using "
+"<literal><literal>referencedColumnName</literal></literal>
to a non primary "
+"key column, the associated class has to be
<classname>Serializable</"
+"classname>. Also note that the
<literal><literal>referencedColumnName</"
+"literal></literal> to a non primary key column has to be mapped to a
"
+"property having a single column (other cases might not work)."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:792
+#, no-c-format
+msgid ""
+"The association may be bidirectional. In a bidirectional relationship, one "
+"of the sides (and only one) has to be the owner: the owner is responsible "
+"for the association column(s) update. To declare a side as
<emphasis>not</"
+"emphasis> responsible for the relationship, the attribute
<literal>mappedBy</"
+"literal> is used. <literal>mappedBy</literal> refers to the property
name of "
+"the association on the owner side. In our case, this is
<literal>passport</"
+"literal>. As you can see, you don't have to (must not) declare the join
"
+"column since it has already been declared on the owners side."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:803
+#, no-c-format
+msgid ""
+"If no <literal>@JoinColumn</literal> is declared on the owner side, the
"
+"defaults apply. A join column(s) will be created in the owner table and its "
+"name will be the concatenation of the name of the relationship in the owner "
+"side, <keycap>_</keycap> (underscore), and the name of the primary key
column"
+"(s) in the owned side. In this example <literal>passport_id</literal>
"
+"because the property name is <literal>passport</literal> and the column
id "
+"of <literal>Passport </literal>is
<literal>id</literal>."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:812
+#, no-c-format
+msgid "The third possibility (using an association table) is very exotic."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:815
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Customer implements Serializable {\n"
+" @OneToOne(cascade = CascadeType.ALL)\n"
+" <emphasis role=\"bold\">@JoinTable(name =
\"CustomerPassports\",\n"
+" joinColumns = @JoinColumn(name=\"customer_fk\"),\n"
+" inverseJoinColumns =
@JoinColumn(name=\"passport_fk\")</emphasis>\n"
+" )\n"
+" public Passport getPassport() {\n"
+" ...\n"
+" }\n"
+"\n"
+"@Entity\n"
+"public class Passport implements Serializable {\n"
+" @OneToOne(<emphasis role=\"bold\">mappedBy =
\"passport\"</emphasis>)\n"
+" public Customer getOwner() {\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:817
+#, no-c-format
+msgid ""
+"A <classname>Customer</classname> is linked to a
<classname>Passport</"
+"classname> through a association table named
<literal>CustomerPassports</"
+"literal> ; this association table has a foreign key column named "
+"<literal>passport_fk</literal> pointing to the
<literal>Passport</literal> "
+"table (materialized by the <literal>inverseJoinColumn</literal>, and a
"
+"foreign key column named <literal>customer_fk</literal> pointing to the
"
+"<literal>Customer</literal> table materialized by the
<literal>joinColumns</"
+"literal> attribute."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:827
+#, no-c-format
+msgid ""
+"You must declare the join table name and the join columns explicitly in such
"
+"a mapping."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:832
+#, no-c-format
+msgid "Many-to-one"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:834
+#, no-c-format
+msgid ""
+"Many-to-one associations are declared at the property level with the "
+"annotation <literal>@ManyToOne</literal>:"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:837
+#, no-c-format
+msgid ""
+"@Entity()\n"
+"public class Flight implements Serializable {\n"
+" <emphasis role=\"bold\">@ManyToOne</emphasis>( cascade =
{CascadeType."
+"PERSIST, CascadeType.MERGE} )\n"
+" @JoinColumn(name=\"COMP_ID\")\n"
+" public Company getCompany() {\n"
+" return company;\n"
+" }\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:839
+#, no-c-format
+msgid ""
+"The <literal>@JoinColumn</literal> attribute is optional, the default
value"
+"(s) is like in one to one, the concatenation of the name of the relationship
"
+"in the owner side, <keycap>_</keycap> (underscore), and the name of the
"
+"primary key column in the owned side. In this example
<literal>company_id</"
+"literal> because the property name is <literal>company</literal> and
the "
+"column id of Company is <literal>id</literal>."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:847
+#, no-c-format
+msgid ""
+"<literal>@ManyToOne</literal> has a parameter named
<literal>targetEntity</"
+"literal> which describes the target entity name. You usually don't need this
"
+"parameter since the default value (the type of the property that stores the "
+"association) is good in almost all cases. However this is useful when you "
+"want to use interfaces as the return type instead of the regular entity."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:854
+#, no-c-format
+msgid ""
+"@Entity()\n"
+"public class Flight implements Serializable {\n"
+" @ManyToOne( cascade = {CascadeType.PERSIST, CascadeType.MERGE}, "
+"<emphasis\n"
+"
role=\"bold\">targetEntity=CompanyImpl.class</emphasis> )\n"
+" @JoinColumn(name=\"COMP_ID\")\n"
+" public Company getCompany() {\n"
+" return company;\n"
+" }\n"
+" ...\n"
+"}\n"
+"\n"
+"public interface Company {\n"
+" ..."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:856
+#, no-c-format
+msgid ""
+"You can alse map a many to one association through an association table. "
+"This association table described by the <literal>@JoinTable</literal>
"
+"annotation will contains a foreign key referencing back the entity table "
+"(through <literal>(a)JoinTable.joinColumns</literal>) and a a foreign key
"
+"referencing the target entity table (through <literal>(a)JoinTable."
+"inverseJoinColumns</literal>)."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:864
+#, no-c-format
+msgid ""
+"@Entity()\n"
+"public class Flight implements Serializable {\n"
+" @ManyToOne( cascade = {CascadeType.PERSIST, CascadeType.MERGE} )\n"
+" <emphasis
role=\"bold\">@JoinTable(name=\"Flight_Company\",\n"
+" joinColumns = @JoinColumn(name=\"FLIGHT_ID\"),\n"
+" inverseJoinColumns = @JoinColumn(name=\"COMP_ID\")\n"
+" )</emphasis>\n"
+" public Company getCompany() {\n"
+" return company;\n"
+" }\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:868
+#, no-c-format
+msgid "Collections"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:872
+#, no-c-format
+msgid "Overview"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:874
+#, no-c-format
+msgid ""
+"You can map <classname>Collection</classname>,
<literal>List</literal> (ie "
+"ordered lists, not indexed lists), <literal>Map</literal> and "
+"<classname>Set</classname>. The EJB3 specification describes how to map
an "
+"ordered list (ie a list ordered at load time) using <literal>(a)javax."
+"persistence.OrderBy</literal> annotation: this annotation takes into "
+"parameter a list of comma separated (target entity) properties to order the "
+"collection by (eg <code>firstname asc, age desc</code>), if the string
is "
+"empty, the collection will be ordered by id. For true indexed collections, "
+"please refer to the <xref linkend=\"entity-hibspec\"/>. EJB3 allows
you to "
+"map Maps using as a key one of the target entity property using "
+"<literal>@MapKey(name=\"myProperty\")</literal> (myProperty
is a property "
+"name in the target entity). When using <literal>@MapKey</literal>
(without "
+"property name), the target entity primary key is used. The map key uses the "
+"same column as the property pointed out: there is no additional column "
+"defined to hold the map key, and it does make sense since the map key "
+"actually represent a target property. Be aware that once loaded, the key is "
+"no longer kept in sync with the property, in other words, if you change the "
+"property value, the key will not change automatically in your Java model "
+"(for true map support please refers to <xref
linkend=\"entity-hibspec\"/>). "
+"Many people confuse <literal><map></literal> capabilities
and "
+"<literal>@MapKey</literal> ones. These are two different features.
"
+"<literal>@MapKey</literal> still has some limitations, please check the
"
+"forum or the JIRA tracking system for more informations."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:902
+#, no-c-format
+msgid "Hibernate has several notions of collections."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:907
+#, no-c-format
+msgid "Collections semantics"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:918
+#, no-c-format
+msgid "Semantic"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:920
+#, no-c-format
+msgid "java representation"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:922
+#, no-c-format
+msgid "annotations"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:928
+#, no-c-format
+msgid "Bag semantic"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:930
+#, no-c-format
+msgid "<para>java.util.List</para>"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:930
+#, no-c-format
+msgid "java.util.Collection"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:932
+#, no-c-format
+msgid "(a)org.hibernate.annotations.CollectionOfElements"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:932
+#, no-c-format
+msgid "or @OneToMany"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:932
+#, no-c-format
+msgid "or @ManyToMany"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:936
+#, no-c-format
+msgid ""
+"Bag semantic with primary key (withtout the limitations of Bag semantic)"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:939
+#, no-c-format
+msgid "java.util.List, java.util.Collection"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:941
+#, no-c-format
+msgid ""
+"((a)org.hibernate.annotations.CollectionOfElements or @OneToMany or "
+"@ManyToMany) and @CollectionId"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:946
+#, no-c-format
+msgid "List semantic"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:948
+#, no-c-format
+msgid "<entry>java.util.List</entry>"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:950
+#, no-c-format
+msgid ""
+"((a)org.hibernate.annotations.CollectionOfElements or @OneToMany or "
+"@ManyToMany) and @org.hibernate.annotations.IndexColumn"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:956
+#, no-c-format
+msgid "Set semantic"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:958
+#, no-c-format
+msgid "java.util.Set"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:960
+#, no-c-format
+msgid ""
+"(a)org.hibernate.annotations.CollectionOfElements or @OneToMany or @ManyToMany"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:965
+#, no-c-format
+msgid "Map semantic"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:967
+#, no-c-format
+msgid "java.util.Map"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:969
+#, no-c-format
+msgid ""
+"((a)org.hibernate.annotations.CollectionOfElements or @OneToMany or "
+"@ManyToMany) and (nothing or @org.hibernate.annotations.MapKey/"
+"MapKeyManyToMany for true map support, OR @javax.persistence.MapKey"
+msgstr ""
+
+#. Tag: remark
+#: entity.xml:978
+#, no-c-format
+msgid ""
+"So specifically, java.util.List collections without @org.hibernate."
+"annotations.IndexColumn are going to be considered as bags."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:982
+#, no-c-format
+msgid ""
+"Collection of primitive, core type or embedded objects is not supported by "
+"the EJB3 specification. Hibernate Annotations allows them however (see <xref
"
+"linkend=\"entity-hibspec\"/>)."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:986
+#, no-c-format
+msgid ""
+"@Entity public class City {\n"
+" @OneToMany(mappedBy=\"city\")\n"
+" <emphasis
role=\"bold\">@OrderBy(\"streetName\")</emphasis>\n"
+" public List<Street> getStreets() {\n"
+" return streets;\n"
+" }\n"
+"...\n"
+"}\n"
+"\n"
+"@Entity public class Street {\n"
+" <emphasis role=\"bold\">public String
getStreetName()</emphasis> {\n"
+" return streetName;\n"
+" }\n"
+"\n"
+" @ManyToOne\n"
+" public City getCity() {\n"
+" return city;\n"
+" }\n"
+" ...\n"
+"}\n"
+"\n"
+"\n"
+"@Entity\n"
+"public class Software {\n"
+" @OneToMany(mappedBy=\"software\")\n"
+" <emphasis
role=\"bold\">@MapKey(name=\"codeName\")</emphasis>\n"
+" public Map<String, Version> getVersions() {\n"
+" return versions;\n"
+" }\n"
+"...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"@Table(name=\"tbl_version\")\n"
+"public class Version {\n"
+" <emphasis role=\"bold\">public String
getCodeName()</emphasis> {...}\n"
+"\n"
+" @ManyToOne\n"
+" public Software getSoftware() { ... }\n"
+"...\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:988
+#, no-c-format
+msgid ""
+"So <literal>City</literal> has a collection of
<literal>Street</literal>s "
+"that are ordered by <literal>streetName</literal> (of
<literal>Street</"
+"literal>) when the collection is loaded. <literal>Software</literal>
has a "
+"map of <literal>Version</literal>s which key is the
<literal>Version</"
+"literal> <literal>codeName</literal>."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:995
+#, no-c-format
+msgid ""
+"Unless the collection is a generic, you will have to define "
+"<literal>targetEntity</literal>. This is a annotation attribute that
take "
+"the target entity class as a value."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1002
+#, no-c-format
+msgid "One-to-many"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1004
+#, no-c-format
+msgid ""
+"One-to-many associations are declared at the property level with the "
+"annotation <literal>@OneToMany</literal>. One to many associations may
be "
+"bidirectional."
+msgstr ""
+
+#. Tag: sect4
+#: entity.xml:1006
+#, no-c-format
+msgid ""
+"<sect5> <title>Bidirectional</title> <para>Since many to
one are (almost) "
+"always the owner side of a bidirectional relationship in the EJB3 spec, the "
+"one to many association is annotated by <literal>@OneToMany( mappedBy=...
)</"
+"literal></para> <programlisting>@Entity\n"
+"public class Troop {\n"
+" @OneToMany(mappedBy=\"troop\")\n"
+" public Set<Soldier> getSoldiers() {\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Soldier {\n"
+" @ManyToOne\n"
+" @JoinColumn(name=\"troop_fk\")\n"
+" public Troop getTroop() {\n"
+" ...\n"
+"} </programlisting>
<para><classname>Troop</classname> has a "
+"bidirectional one to many relationship with <literal>Soldier</literal>
"
+"through the <literal>troop</literal> property. You don't have to
(must not) "
+"define any physical mapping in the <literal>mappedBy</literal>
side.</para> "
+"<para>To map a bidirectional one to many, with the one-to-many side as the
"
+"owning side, you have to remove the <literal>mappedBy</literal> element
and "
+"set the many to one <literal>@JoinColumn</literal> as insertable and
"
+"updatable to false. This solution is obviously not optimized and will "
+"produce some additional UPDATE statements.</para>
<programlisting>@Entity\n"
+"public class Troop {\n"
+" @OneToMany\n"
+" @JoinColumn(name=\"troop_fk\") //we need to duplicate the physical
"
+"information\n"
+" public Set<Soldier> getSoldiers() {\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Soldier {\n"
+" @ManyToOne\n"
+" @JoinColumn(name=\"troop_fk\", insertable=false,
updatable=false)\n"
+" public Troop getTroop() {\n"
+" ...\n"
+"}</programlisting> </sect5> <sect5>
<title>Unidirectional</title> <para>A "
+"unidirectional one to many using a foreign key column in the owned entity is
"
+"not that common and not really recommended. We strongly advise you to use a "
+"join table for this kind of association (as explained in the next section). "
+"This kind of association is described through a
<literal>@JoinColumn</"
+"literal></para> <programlisting>\n"
+"@Entity\n"
+"public class Customer implements Serializable {\n"
+" @OneToMany(cascade=CascadeType.ALL, fetch=FetchType.EAGER)\n"
+" @JoinColumn(name=\"CUST_ID\")\n"
+" public Set<Ticket> getTickets() {\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Ticket implements Serializable {\n"
+" ... //no bidir\n"
+"}\n"
+" </programlisting>
<para><literal>Customer</literal> describes "
+"a unidirectional relationship with <literal>Ticket</literal> using the
join "
+"column <literal>CUST_ID</literal>.</para> </sect5>
<sect5> "
+"<title>Unidirectional with join table</title> <para>A
unidirectional one to "
+"many with join table is much preferred. This association is described "
+"through an <literal>(a)JoinTable</literal>.</para>
<programlisting>\n"
+"@Entity\n"
+"public class Trainer {\n"
+" @OneToMany\n"
+" @JoinTable(\n"
+" name=\"TrainedMonkeys\",\n"
+" joinColumns = @JoinColumn( name=\"trainer_id\"),\n"
+" inverseJoinColumns = @JoinColumn(
name=\"monkey_id\")\n"
+" )\n"
+" public Set<Monkey> getTrainedMonkeys() {\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Monkey {\n"
+" ... //no bidir\n"
+"}\n"
+" </programlisting>
<para><literal>Trainer</literal> describes "
+"a unidirectional relationship with <classname>Monkey</classname> using
the "
+"join table <classname>TrainedMonkeys</classname>, with a foreign key
"
+"<literal>trainer_id</literal> to <literal>Trainer</literal>
"
+"(<literal>joinColumns</literal>) and a foreign key
<literal>monkey_id</"
+"literal> to <literal>Monkey</literal>
(<literal>inversejoinColumns</"
+"literal>).</para> </sect5> <sect5
id=\"entity-mapping-association-collection-"
+"manytomany-default\" revision=\"1\">
<title>Defaults</title> <para>Without "
+"describing any physical mapping, a unidirectional one to many with join "
+"table is used. The table name is the concatenation of the owner table name, "
+"<keycap>_</keycap>, and the other side table name. The foreign key
name(s) "
+"referencing the owner table is the concatenation of the owner table, "
+"<keycap>_</keycap>, and the owner primary key column(s) name. The
foreign "
+"key name(s) referencing the other side is the concatenation of the owner "
+"property name, <keycap>_</keycap>, and the other side primary key
column(s) "
+"name. A unique constraint is added to the foreign key referencing the other "
+"side table to reflect the one to many.</para> <programlisting>\n"
+"@Entity\n"
+"public class Trainer {\n"
+" @OneToMany\n"
+" public Set<Tiger> getTrainedTigers() {\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Tiger {\n"
+" ... //no bidir\n"
+"}\n"
+" </programlisting>
<para><classname>Trainer</classname> "
+"describes a unidirectional relationship with
<classname>Tiger</classname> "
+"using the join table <literal>Trainer_Tiger</literal>, with a foreign
key "
+"<literal>trainer_id</literal> to <literal>Trainer</literal>
(table name, "
+"<keycap>_</keycap>, trainer id) and a foreign key
<literal>trainedTigers_id</"
+"literal> to <literal>Monkey</literal> (property name,
<keycap>_</keycap>, "
+"Tiger primary column).</para> </sect5>"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1099
+#, no-c-format
+msgid "Many-to-many"
+msgstr ""
+
+#. Tag: sect4
+#: entity.xml:1099
+#, no-c-format
+msgid ""
+"<sect5> <title>Definition</title> <para>A many-to-many
association is "
+"defined logically using the <literal>@ManyToMany</literal> annotation.
You "
+"also have to describe the association table and the join conditions using "
+"the <literal>@JoinTable</literal> annotation. If the association is
"
+"bidirectional, one side has to be the owner and one side has to be the "
+"inverse end (ie. it will be ignored when updating the relationship values in
"
+"the association table):</para> <programlisting>\n"
+"@Entity\n"
+"public class Employer implements Serializable {\n"
+" @ManyToMany(\n"
+"
targetEntity=org.hibernate.test.metadata.manytomany.Employee.class,\n"
+" cascade={CascadeType.PERSIST, CascadeType.MERGE}\n"
+" )\n"
+" @JoinTable(\n"
+" name=\"EMPLOYER_EMPLOYEE\",\n"
+" joinColumns=@JoinColumn(name=\"EMPER_ID\"),\n"
+" inverseJoinColumns=@JoinColumn(name=\"EMPEE_ID\")\n"
+" )\n"
+" public Collection getEmployees() {\n"
+" return employees;\n"
+" }\n"
+" ...\n"
+"}\n"
+" </programlisting> <programlisting>\n"
+"@Entity\n"
+"public class Employee implements Serializable {\n"
+" @ManyToMany(\n"
+" cascade = {CascadeType.PERSIST, CascadeType.MERGE},\n"
+" mappedBy = \"employees\",\n"
+" targetEntity = Employer.class\n"
+" )\n"
+" public Collection getEmployers() {\n"
+" return employers;\n"
+" }\n"
+"}\n"
+" </programlisting> <para>We've already shown the many
"
+"declarations and the detailed attributes for associations. We'll go deeper
"
+"in the <literal>@JoinTable</literal> description, it defines a "
+"<literal>name</literal>, an array of join columns (an array in
annotation is "
+"defined using { A, B, C }), and an array of inverse join columns. The latter
"
+"ones are the columns of the association table which refer to the "
+"<classname>Employee</classname> primary key (the \"other
side\").</para> "
+"<para>As seen previously, the other side don't have to (must not)
describe "
+"the physical mapping: a simple <literal>mappedBy</literal> argument
"
+"containing the owner side property name bind the two.</para> </sect5>
"
+"<sect5> <title>Default values</title> <para>As any other
annotations, most "
+"values are guessed in a many to many relationship. Without describing any "
+"physical mapping in a unidirectional many to many the following rules "
+"applied. The table name is the concatenation of the owner table name, "
+"<keycap>_</keycap> and the other side table name. The foreign key
name(s) "
+"referencing the owner table is the concatenation of the owner table name, "
+"<keycap>_</keycap> and the owner primary key column(s). The foreign key
name"
+"(s) referencing the other side is the concatenation of the owner property "
+"name, <keycap>_</keycap>, and the other side primary key column(s).
These "
+"are the same rules used for a unidirectional one to many relationship.</"
+"para> <programlisting>\n"
+"@Entity\n"
+"public class Store {\n"
+" @ManyToMany(cascade = CascadeType.PERSIST)\n"
+" public Set<City> getImplantedIn() {\n"
+" ...\n"
+" }\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class City {\n"
+" ... //no bidirectional relationship\n"
+"}\n"
+" </programlisting> <para>A
<literal>Store_City</literal> is "
+"used as the join table. The <literal>Store_id</literal> column is a
foreign "
+"key to the <literal>Store</literal> table. The
<literal>implantedIn_id</"
+"literal> column is a foreign key to the <literal>City</literal>
table.</"
+"para> <para>Without describing any physical mapping in a bidirectional
many "
+"to many the following rules applied. The table name is the concatenation of "
+"the owner table name, <keycap>_</keycap> and the other side table name.
The "
+"foreign key name(s) referencing the owner table is the concatenation of the "
+"other side property name, <keycap>_</keycap>, and the owner primary key
"
+"column(s). The foreign key name(s) referencing the other side is the "
+"concatenation of the owner property name, <keycap>_</keycap>, and the
other "
+"side primary key column(s). These are the same rules used for a "
+"unidirectional one to many relationship.</para>
<programlisting>\n"
+"@Entity\n"
+"public class Store {\n"
+" @ManyToMany(cascade = {CascadeType.PERSIST, CascadeType.MERGE})\n"
+" public Set<Customer> getCustomers() {\n"
+" ...\n"
+" }\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Customer {\n"
+" @ManyToMany(mappedBy=\"customers\")\n"
+" public Set<Store> getStores() {\n"
+" ...\n"
+" }\n"
+"}\n"
+" </programlisting> <para>A
<literal>Store_Customer</literal> "
+"is used as the join table. The <literal>stores_id</literal> column is a
"
+"foreign key to the <literal>Store</literal> table. The "
+"<literal>customers_id</literal> column is a foreign key to the "
+"<literal>Customer</literal> table.</para> </sect5>"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1177
+#, no-c-format
+msgid "Transitive persistence with cascading"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1179
+#, no-c-format
+msgid ""
+"You probably have noticed the <literal>cascade</literal> attribute
taking an "
+"array of <classname>CascadeType</classname> as a value. The cascade
concept "
+"in EJB3 is very is similar to the transitive persistence and cascading of "
+"operations in Hibernate, but with slightly different semantics and cascading
"
+"types:"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1187
+#, no-c-format
+msgid ""
+"CascadeType.PERSIST: cascades the persist (create) operation to associated "
+"entities persist() is called or if the entity is managed"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1192
+#, no-c-format
+msgid ""
+"CascadeType.MERGE: cascades the merge operation to associated entities if "
+"merge() is called or if the entity is managed"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1197
+#, no-c-format
+msgid ""
+"CascadeType.REMOVE: cascades the remove operation to associated entities if "
+"delete() is called"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1202
+#, no-c-format
+msgid ""
+"CascadeType.REFRESH: cascades the refresh operation to associated entities "
+"if refresh() is called"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1207
+#, no-c-format
+msgid "CascadeType.ALL: all of the above"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1213
+#, no-c-format
+msgid ""
+"CascadeType.ALL also covers Hibernate specific operations like save-update, "
+"lock etc... Check <xref linkend=\"entity-hibspec-cascade\"/> for
more "
+"information"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1218
+#, no-c-format
+msgid ""
+"Please refer to the chapter 6.3 of the EJB3 specification for more "
+"information on cascading and create/merge semantics."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1223
+#, no-c-format
+msgid "Association fetching"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1225
+#, no-c-format
+msgid ""
+"You have the ability to either eagerly or lazily fetch associated entities. "
+"The <literal>fetch</literal> parameter can be set to
<literal>FetchType."
+"LAZY</literal> or <literal>FetchType.EAGER</literal>.
<literal>EAGER</"
+"literal> will try to use an outer join select to retrieve the associated "
+"object, while <literal>LAZY</literal> will only trigger a select when
the "
+"associated object is accessed for the first time.
<literal>@OneToMany</"
+"literal> and <literal>@ManyToMany</literal> associations are
defaulted to "
+"<literal>LAZY</literal> and <literal>@OneToOne</literal>
and "
+"<literal>@ManyToOne</literal> are defaulted to
<literal>EAGER</literal>. For "
+"more information about static fetching, check <xref
linkend=\"entity-hibspec-"
+"singleassoc-fetching\"/>."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1238
+#, no-c-format
+msgid ""
+"The recommanded approach is to use <literal>LAZY</literal> onn all
static "
+"fetching definitions and override this choice dynamically through JPA-QL. "
+"JPA-QL has a <literal>fetch</literal> keyword that allows you to
override "
+"laziness when doing a particular query. This is very useful to improve "
+"performance and is decided on a use case to use case basis."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1248
+#, no-c-format
+msgid "Mapping composite primary and foreign keys"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1250
+#, no-c-format
+msgid ""
+"Composite primary keys use a embedded class as the primary key "
+"representation, so you'd use the <literal>@Id</literal> and "
+"<literal>@Embeddable</literal> annotations. Alternatively, you can use
the "
+"<literal>@EmbeddedId</literal> annotation. Note that the dependent
class has "
+"to be serializable and implements
<methodname>equals()</methodname>/"
+"<methodname>hashCode()</methodname>. You can also use
<literal>@IdClass</"
+"literal> as described in <xref
linkend=\"entity-mapping-identifier\"/>."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1259
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class RegionalArticle implements Serializable {\n"
+"\n"
+" @Id\n"
+" public RegionalArticlePk getPk() { ... }\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"public class RegionalArticlePk implements Serializable { ... }"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1261
+#, no-c-format
+msgid "or alternatively"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1263
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class RegionalArticle implements Serializable {\n"
+"\n"
+" @EmbeddedId\n"
+" public RegionalArticlePk getPk() { ... }\n"
+"}\n"
+"\n"
+"public class RegionalArticlePk implements Serializable { ... }"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1265
+#, no-c-format
+msgid ""
+"<literal>@Embeddable</literal> inherit the access type of its owning
entity "
+"unless the Hibernate specific annotation <literal>@AccessType</literal>
is "
+"used. Composite foreign keys (if not using the default sensitive values) are
"
+"defined on associations using the <literal>@JoinColumns</literal>
element, "
+"which is basically an array of <literal>@JoinColumn</literal>. It is
"
+"considered a good practice to express
<literal>referencedColumnNames</"
+"literal> explicitly. Otherwise, Hibernate will suppose that you use the same
"
+"order of columns as in the primary key declaration."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1275
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Parent implements Serializable {\n"
+" @Id\n"
+" public ParentPk id;\n"
+" public int age;\n"
+"\n"
+" @OneToMany(cascade=CascadeType.ALL)\n"
+" @JoinColumns ({\n"
+" @JoinColumn(name=\"parentCivility\", referencedColumnName =
\"isMale"
+"\"),\n"
+" @JoinColumn(name=\"parentLastName\", referencedColumnName =
"
+"\"lastName\"),\n"
+" @JoinColumn(name=\"parentFirstName\", referencedColumnName =
"
+"\"firstName\")\n"
+" })\n"
+" public Set<Child> children; //unidirectional\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1277
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Child implements Serializable {\n"
+" @Id @GeneratedValue\n"
+" public Integer id;\n"
+"\n"
+" @ManyToOne\n"
+" @JoinColumns ({\n"
+" @JoinColumn(name=\"parentCivility\", referencedColumnName =
\"isMale"
+"\"),\n"
+" @JoinColumn(name=\"parentLastName\", referencedColumnName =
"
+"\"lastName\"),\n"
+" @JoinColumn(name=\"parentFirstName\", referencedColumnName =
"
+"\"firstName\")\n"
+" })\n"
+" public Parent parent; //unidirectional\n"
+"}"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1279
+#, no-c-format
+msgid ""
+"@Embeddable\n"
+"public class ParentPk implements Serializable {\n"
+" String firstName;\n"
+" String lastName;\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1281
+#, no-c-format
+msgid "Note the explicit usage of the
<literal>referencedColumnName</literal>."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1286
+#, no-c-format
+msgid "Mapping secondary tables"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1288
+#, no-c-format
+msgid ""
+"You can map a single entity bean to several tables using the "
+"<literal>@SecondaryTable</literal> or
<literal>@SecondaryTables</literal> "
+"class level annotations. To express that a column is in a particular table, "
+"use the <literal>table</literal> parameter of
<literal>@Column</literal> or "
+"<literal>(a)JoinColumn</literal>."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1295
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Table(name=\"MainCat\")\n"
+"<emphasis role=\"bold\">@SecondaryTables({\n"
+" @SecondaryTable(name=\"Cat1\", pkJoinColumns={\n"
+" @PrimaryKeyJoinColumn(name=\"cat_id\",
referencedColumnName=\"id\")\n"
+" ),\n"
+" @SecondaryTable(name=\"Cat2\",
uniqueConstraints={@UniqueConstraint"
+"(columnNames={\"storyPart2\"})})\n"
+"})</emphasis>\n"
+"public class Cat implements Serializable {\n"
+"\n"
+" private Integer id;\n"
+" private String name;\n"
+" private String storyPart1;\n"
+" private String storyPart2;\n"
+"\n"
+" @Id @GeneratedValue\n"
+" public Integer getId() {\n"
+" return id;\n"
+" }\n"
+"\n"
+" public String getName() {\n"
+" return name;\n"
+" }\n"
+" \n"
+" <emphasis
role=\"bold\">@Column(table=\"Cat1\")</emphasis>\n"
+" public String getStoryPart1() {\n"
+" return storyPart1;\n"
+" }\n"
+"\n"
+" <emphasis
role=\"bold\">@Column(table=\"Cat2\")</emphasis>\n"
+" public String getStoryPart2() {\n"
+" return storyPart2;\n"
+" }"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1297
+#, no-c-format
+msgid ""
+"In this example, <literal>name</literal> will be in
<literal>MainCat</"
+"literal>. <literal>storyPart1</literal> will be in
<literal>Cat1</literal> "
+"and <literal>storyPart2</literal> will be in
<literal>Cat2</literal>. "
+"<literal>Cat1</literal> will be joined to
<literal>MainCat</literal> using "
+"the <literal>cat_id</literal> as a foreign key, and
<literal>Cat2</literal> "
+"using <literal>id</literal> (ie the same column name, the
<literal>MainCat</"
+"literal> id column has). Plus a unique constraint on
<literal>storyPart2</"
+"literal> has been set."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1307
+#, no-c-format
+msgid ""
+"Check out the JBoss EJB 3 tutorial or the Hibernate Annotations unit test "
+"suite for more examples."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1313
+#, no-c-format
+msgid "Mapping Queries"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1317
+#, no-c-format
+msgid "Mapping JPAQL/HQL queries"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1319
+#, no-c-format
+msgid ""
+"You can map EJBQL/HQL queries using annotations.
<literal>@NamedQuery</"
+"literal> and <literal>@NamedQueries</literal> can be defined at the
class "
+"level or in a JPA XML file. However their definitions are global to the "
+"session factory/entity manager factory scope. A named query is defined by "
+"its name and the actual query string."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1326
+#, no-c-format
+msgid ""
+"<entity-mappings>\n"
+" <named-query name=\"plane.getAll\">\n"
+" <query>select p from Plane p</query>\n"
+" </named-query>\n"
+" ...\n"
+"</entity-mappings>\n"
+"...\n"
+"\n"
+"@Entity\n"
+"(a)NamedQuery(name=\"night.moreRecentThan\", query=\"select n from
Night n "
+"where n.date >= :date\")\n"
+"public class Night {\n"
+" ...\n"
+"}\n"
+"\n"
+"public class MyDao {\n"
+" doStuff() {\n"
+" Query q = s.getNamedQuery(\"night.moreRecentThan\");\n"
+" q.setDate( \"date\", aMonthAgo );\n"
+" List results = q.list();\n"
+" ...\n"
+" }\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1328
+#, no-c-format
+msgid ""
+"You can also provide some hints to a query through an array of "
+"<literal>QueryHint</literal> through a
<literal>hints</literal> attribute."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1332
+#, no-c-format
+msgid "The availabe Hibernate hints are"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1337
+#, no-c-format
+msgid "Query hints"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1346
+#, no-c-format
+msgid "hint"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1348
+#, no-c-format
+msgid "description"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1354
+#, no-c-format
+msgid "org.hibernate.cacheable"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1356
+#, no-c-format
+msgid ""
+"Whether the query should interact with the second level cache (defualt to "
+"false)"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1361
+#, no-c-format
+msgid "org.hibernate.cacheRegion"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1363
+#, no-c-format
+msgid "Cache region name (default used otherwise)"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1367
+#, no-c-format
+msgid "org.hibernate.timeout"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1369
+#, no-c-format
+msgid "Query timeout"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1373
+#, no-c-format
+msgid "org.hibernate.fetchSize"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1375
+#, no-c-format
+msgid "resultset fetch size"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1379
+#, no-c-format
+msgid "org.hibernate.flushMode"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1381
+#, no-c-format
+msgid "Flush mode used for this query"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1385
+#, no-c-format
+msgid "org.hibernate.cacheMode"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1387
+#, no-c-format
+msgid "Cache mode used for this query"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1391
+#, no-c-format
+msgid "org.hibernate.readOnly"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1393
+#, no-c-format
+msgid ""
+"Entities loaded by this query should be in read only mode or not (default to
"
+"false)"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1398
+#, no-c-format
+msgid "org.hibernate.comment"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1400
+#, no-c-format
+msgid "Query comment added to the generated SQL"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1408
+#, no-c-format
+msgid "Mapping native queries"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1410
+#, no-c-format
+msgid ""
+"You can also map a native query (ie a plain SQL query). To achieve that, you
"
+"need to describe the SQL resultset structure using "
+"<literal>@SqlResultSetMapping</literal> (or
<literal>@SqlResultSetMappings</"
+"literal> if you plan to define several resulset mappings). Like "
+"<literal>@NamedQuery</literal>, a
<literal>@SqlResultSetMapping</literal> "
+"can be defined at class level or in a JPA XML file. However its scope is "
+"global to the application."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1419
+#, no-c-format
+msgid ""
+"As we will see, a <literal>resultSetMapping</literal> parameter is
defined "
+"in <literal>@NamedNativeQuery</literal>, it represents the name of a
defined "
+"<literal>@SqlResultSetMapping</literal>. The resultset mapping declares
the "
+"entities retrieved by this native query. Each field of the entity is bound "
+"to an SQL alias (or column name). All fields of the entity including the "
+"ones of subclasses and the foreign key columns of related entities have to "
+"be present in the SQL query. Field definitions are optional provided that "
+"they map to the same column name as the one declared on the class property."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1429
+#, no-c-format
+msgid ""
+"@NamedNativeQuery(name=\"night&area\", query=\"select
night.id nid, "
+"night.night_duration, \"\n"
+" + \" night.night_date, area.id aid, night.area_id, area.name
\"\n"
+" + \"from Night night, Area area where night.area_id = area.id\",
"
+"<emphasis\n"
+"
role=\"bold\">resultSetMapping=\"joinMapping\"</emphasis>)\n"
+"@SqlResultSetMapping(name=\"joinMapping\", entities={\n"
+" @EntityResult(entityClass=org.hibernate.test.annotations.query.Night."
+"class, fields = {\n"
+" @FieldResult(name=\"id\", column=\"nid\"),\n"
+" @FieldResult(name=\"duration\",
column=\"night_duration\"),\n"
+" @FieldResult(name=\"date\",
column=\"night_date\"),\n"
+" @FieldResult(name=\"area\",
column=\"area_id\"),\n"
+" discriminatorColumn=\"disc\"\n"
+" }),\n"
+" @EntityResult(entityClass=org.hibernate.test.annotations.query.Area."
+"class, fields = {\n"
+" @FieldResult(name=\"id\", column=\"aid\"),\n"
+" @FieldResult(name=\"name\", column=\"name\")\n"
+" })\n"
+" }\n"
+")"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1431
+#, no-c-format
+msgid ""
+"In the above example, the <literal>night&area</literal> named
query use "
+"the <literal>joinMapping</literal> result set mapping. This mapping
returns "
+"2 entities, <literal>Night</literal> and
<literal>Area</literal>, each "
+"property is declared and associated to a column name, actually the column "
+"name retrieved by the query. Let's now see an implicit declaration of the
"
+"property / column."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1438
+#, no-c-format
+msgid ""
+"@Entity\n"
+"<emphasis
role=\"bold\">@SqlResultSetMapping(name=\"implicit\", "
+"entities=(a)EntityResult(entityClass=org.hibernate.test.annotations.query."
+"SpaceShip.class))\n"
+"@NamedNativeQuery(name=\"implicitSample\", query=\"select * from
SpaceShip"
+"\", resultSetMapping=\"implicit\")</emphasis>\n"
+"public class SpaceShip {\n"
+" private String name;\n"
+" private String model;\n"
+" private double speed;\n"
+"\n"
+" @Id\n"
+" public String getName() {\n"
+" return name;\n"
+" }\n"
+"\n"
+" public void setName(String name) {\n"
+" this.name = name;\n"
+" }\n"
+"\n"
+" @Column(name=\"model_txt\")\n"
+" public String getModel() {\n"
+" return model;\n"
+" }\n"
+"\n"
+" public void setModel(String model) {\n"
+" this.model = model;\n"
+" }\n"
+"\n"
+" public double getSpeed() {\n"
+" return speed;\n"
+" }\n"
+"\n"
+" public void setSpeed(double speed) {\n"
+" this.speed = speed;\n"
+" }\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1440
+#, no-c-format
+msgid ""
+"In this example, we only describe the entity member of the result set "
+"mapping. The property / column mappings is done using the entity mapping "
+"values. In this case the <literal>model</literal> property is bound to
the "
+"<literal>model_txt </literal>column. If the association to a related
entity "
+"involve a composite primary key, a <literal>@FieldResult</literal>
element "
+"should be used for each foreign key column. The
<literal>@FieldResult</"
+"literal> name is composed of the property name for the relationship, "
+"followed by a dot (\".\"), followed by the name or the field or property
of "
+"the primary key."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1450
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@SqlResultSetMapping(name=\"compositekey\",\n"
+" entities=(a)EntityResult(entityClass=org.hibernate.test.annotations."
+"query.SpaceShip.class,\n"
+" fields = {\n"
+" @FieldResult(name=\"name\", column =
\"name\"),\n"
+" @FieldResult(name=\"model\", column =
\"model\"),\n"
+" @FieldResult(name=\"speed\", column =
\"speed\"),\n"
+"<emphasis role=\"bold\">
@FieldResult(name=\"captain."
+"firstname\", column = \"firstn\"),\n"
+" @FieldResult(name=\"captain.lastname\", column =
\"lastn"
+"\"),</emphasis>\n"
+" @FieldResult(name=\"dimensions.length\", column =
"
+"\"length\"),\n"
+" @FieldResult(name=\"dimensions.width\", column =
\"width"
+"\")\n"
+" }),\n"
+" columns = { @ColumnResult(name = \"surface\"),\n"
+" @ColumnResult(name = \"volume\") } )\n"
+"\n"
+"@NamedNativeQuery(name=\"compositekey\",\n"
+" query=\"select name, model, speed, lname as lastn, fname as firstn,
"
+"length, width, length * width as surface from SpaceShip\", \n"
+" resultSetMapping=\"compositekey\")\n"
+"} )\n"
+"public class SpaceShip {\n"
+" private String name;\n"
+" private String model;\n"
+" private double speed;\n"
+" private Captain captain;\n"
+" private Dimensions dimensions;\n"
+"\n"
+" @Id\n"
+" public String getName() {\n"
+" return name;\n"
+" }\n"
+"\n"
+" public void setName(String name) {\n"
+" this.name = name;\n"
+" }\n"
+"\n"
+" @ManyToOne(fetch= FetchType.LAZY)\n"
+" @JoinColumns( {\n"
+" @JoinColumn(name=\"fname\", referencedColumnName =
\"firstname"
+"\"),\n"
+" @JoinColumn(name=\"lname\", referencedColumnName =
\"lastname"
+"\")\n"
+" } )\n"
+" public Captain getCaptain() {\n"
+" return captain;\n"
+" }\n"
+"\n"
+" public void setCaptain(Captain captain) {\n"
+" this.captain = captain;\n"
+" }\n"
+"\n"
+" public String getModel() {\n"
+" return model;\n"
+" }\n"
+"\n"
+" public void setModel(String model) {\n"
+" this.model = model;\n"
+" }\n"
+"\n"
+" public double getSpeed() {\n"
+" return speed;\n"
+" }\n"
+"\n"
+" public void setSpeed(double speed) {\n"
+" this.speed = speed;\n"
+" }\n"
+"\n"
+" public Dimensions getDimensions() {\n"
+" return dimensions;\n"
+" }\n"
+"\n"
+" public void setDimensions(Dimensions dimensions) {\n"
+" this.dimensions = dimensions;\n"
+" }\n"
+"}\n"
+"\n"
+"@Entity\n"
+"(a)IdClass(Identity.class)\n"
+"public class Captain implements Serializable {\n"
+" private String firstname;\n"
+" private String lastname;\n"
+"\n"
+" @Id\n"
+" public String getFirstname() {\n"
+" return firstname;\n"
+" }\n"
+"\n"
+" public void setFirstname(String firstname) {\n"
+" this.firstname = firstname;\n"
+" }\n"
+"\n"
+" @Id\n"
+" public String getLastname() {\n"
+" return lastname;\n"
+" }\n"
+"\n"
+" public void setLastname(String lastname) {\n"
+" this.lastname = lastname;\n"
+" }\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1453
+#, no-c-format
+msgid ""
+"If you look at the dimension property, you'll see that Hibernate supports
"
+"the dotted notation for embedded objects (you can even have nested embedded "
+"objects). EJB3 implementations do not have to support this feature, we do
:-)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1459
+#, no-c-format
+msgid ""
+"If you retrieve a single entity and if you use the default mapping, you can "
+"use the <literal>resultClass</literal> attribute instead of "
+"<literal>resultSetMapping</literal>:"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1463
+#, no-c-format
+msgid ""
+"<emphasis
role=\"bold\">@NamedNativeQuery(name=\"implicitSample\",
query="
+"\"select * from SpaceShip\", \n"
+" resultClass=SpaceShip.class)</emphasis>\n"
+"public class SpaceShip {"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1465
+#, no-c-format
+msgid ""
+"In some of your native queries, you'll have to return scalar values, for
"
+"example when building report queries. You can map them in the "
+"<literal>@SqlResultsetMapping</literal> through
<literal>@ColumnResult</"
+"literal>. You actually can even mix, entities and scalar returns in the same
"
+"native query (this is probably not that common though)."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1472
+#, no-c-format
+msgid ""
+"<emphasis
role=\"bold\">@SqlResultSetMapping(name=\"scalar\", "
+"columns=@ColumnResult(name=\"dimension\"))\n"
+"@NamedNativeQuery(name=\"scalar\", query=\"select length*width as
dimension "
+"from SpaceShip\",
resultSetMapping=\"scalar\")</emphasis>"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1474
+#, no-c-format
+msgid ""
+"An other query hint specific to native queries has been introduced: "
+"<literal>org.hibernate.callable</literal> which can be true or false
"
+"depending on whether the query is a stored procedure or not."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1482
+#, no-c-format
+msgid "Hibernate Annotation Extensions"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1484
+#, no-c-format
+msgid ""
+"Hibernate 3.1 offers a variety of additional annotations that you can mix/"
+"match with your EJB 3 entities. They have been designed as a natural "
+"extension of EJB3 annotations."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1488
+#, no-c-format
+msgid ""
+"To empower the EJB3 capabilities, hibernate provides specific annotations "
+"that match hibernate features. The
<classname>org.hibernate.annotations</"
+"classname> package contains all these annotations extensions."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1494
+#, no-c-format
+msgid "Entity"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1496
+#, no-c-format
+msgid ""
+"You can fine tune some of the actions done by Hibernate on entities beyond "
+"what the EJB3 spec offers."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1499
+#, no-c-format
+msgid ""
+"<classname>(a)org.hibernate.annotations.Entity</classname> adds
additional "
+"metadata that may be needed beyond what is defined in the standard "
+"<literal>@Entity</literal>"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1503
+#, no-c-format
+msgid "mutable: whether this entity is mutable or not"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1508
+#, no-c-format
+msgid "dynamicInsert: allow dynamic SQL for inserts"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1513
+#, no-c-format
+msgid "dynamicUpdate: allow dynamic SQL for updates"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1518
+#, no-c-format
+msgid ""
+"selectBeforeUpdate: Specifies that Hibernate should never perform an SQL "
+"UPDATE unless it is certain that an object is actually modified."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1523
+#, no-c-format
+msgid ""
+"polymorphism: whether the entity polymorphism is of PolymorphismType."
+"IMPLICIT (default) or PolymorphismType.EXPLICIT"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1528
+#, no-c-format
+msgid ""
+"optimisticLock: optimistic locking strategy (OptimisticLockType.VERSION, "
+"OptimisticLockType.NONE, OptimisticLockType.DIRTY or OptimisticLockType.ALL)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1534
+#, no-c-format
+msgid ""
+"(a)javax.persistence.Entity is still mandatory, @org.hibernate.annotations."
+"Entity is not a replacement."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1538
+#, no-c-format
+msgid "Here are some additional Hibernate annotation extensions"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1540
+#, no-c-format
+msgid ""
+"<literal>(a)org.hibernate.annotations.BatchSize</literal> allows you to
define "
+"the batch size when fetching instances of this entity ( eg. "
+"<literal>@BatchSize(size=4)</literal> ). When loading a given entity,
"
+"Hibernate will then load all the uninitialized entities of the same type in "
+"the persistence context up to the batch size."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1546
+#, no-c-format
+msgid ""
+"<literal>(a)org.hibernate.annotations.Proxy</literal> defines the
laziness "
+"attributes of the entity. lazy (default to true) define whether the class is
"
+"lazy or not. proxyClassName is the interface used to generate the proxy "
+"(default is the class itself)."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1551
+#, no-c-format
+msgid ""
+"<literal>(a)org.hibernate.annotations.Where</literal> defines an optional
SQL "
+"WHERE clause used when instances of this class is retrieved."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1555
+#, no-c-format
+msgid ""
+"<literal>(a)org.hibernate.annotations.Check</literal> defines an optional
"
+"check constraints defined in the DDL statetement."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1558
+#, no-c-format
+msgid ""
+"<literal>(a)OnDelete(action=OnDeleteAction.CASCADE)</literal> on joined
"
+"subclasses: use a SQL cascade delete on deletion instead of the regular "
+"Hibernate mechanism."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1562
+#, no-c-format
+msgid ""
+"<literal>@Table(appliesTo=\"tableName\", indexes = {
@Index(name=\"index1\", "
+"columnNames={\"column1\", \"column2\"} ) } )</literal>
creates the defined "
+"indexes on the columns of table <literal>tableName</literal>. This can
be "
+"applied on the primary table or any secondary table. The
<literal>@Tables</"
+"literal> annotation allows your to apply indexes on different tables. This
"
+"annotation is expected where
<literal>(a)javax.persistence.Table</literal> or "
+"<literal>(a)javax.persistence.SecondaryTable</literal>(s) occurs."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1572
+#, no-c-format
+msgid ""
+"<literal>(a)org.hibernate.annotations.Table</literal> is a complement,
not a "
+"replacement to <literal>(a)javax.persistence.Table</literal>. Especially,
if "
+"you want to change the default name of a table, you must use
<literal>(a)javax."
+"persistence.Table</literal>, not
<literal>(a)org.hibernate.annotations.Table</"
+"literal>."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1580
+#, no-c-format
+msgid ""
+"<literal>(a)org.hibernate.annotations.Table</literal> can also be used to
"
+"define the following elements of secondary tables:"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1585
+#, no-c-format
+msgid ""
+"<literal>fetch</literal>: If set to JOIN, the default, Hibernate will
use an "
+"inner join to retrieve a secondary table defined by a class or its "
+"superclasses and an outer join for a secondary table defined by a subclass. "
+"If set to select then Hibernate will use a sequential select for a secondary
"
+"table defined on a subclass, which will be issued only if a row turns out to
"
+"represent an instance of the subclass. Inner joins will still be used to "
+"retrieve a secondary defined by the class and its superclasses."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1597
+#, no-c-format
+msgid ""
+"<literal>inverse</literal>: If true, Hibernate will not try to insert
or "
+"update the properties defined by this join. Default to false."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1603
+#, no-c-format
+msgid ""
+"<literal>optional</literal>: If enabled (the default), Hibernate will
insert "
+"a row only if the properties defined by this join are non-null and will "
+"always use an outer join to retrieve the properties."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1610
+#, no-c-format
+msgid ""
+"<literal>foreignKey</literal>: defines the Foreign Key name of a
secondary "
+"table pointing back to the primary table."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1615
+#, no-c-format
+msgid ""
+"<literal>@Immutable</literal> marks an entity or collection as
immutable. An "
+"immutable entity may not be updated by the application. This allows "
+"Hibernate to make some minor performance optimizations. Updates to an "
+"immutable entity will be ignored, but no exception is thrown. "
+"<literal>@Immutable</literal> must be used on root entities only.
"
+"<literal>@Immutable</literal> placed on a collection makes the
collection "
+"immutable, meaning additions and deletions to and from the collection are "
+"not allowed. A <literal>HibernateException</literal> is thrown in this
case."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1625
+#, no-c-format
+msgid ""
+"<literal>@Persister</literal> lets you define your own custom
persistence "
+"strategy. You may, for example, specify your own subclass of
<classname>org."
+"hibernate.persister.EntityPersister</classname> or you might even provide a
"
+"completely new implementation of the interface <literal>org.hibernate."
+"persister.ClassPersister</literal> that implements persistence via, for
"
+"example, stored procedure calls, serialization to flat files or LDAP."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1633
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@BatchSize(size=5)\n"
+"(a)org.hibernate.annotations.Entity(\n"
+" selectBeforeUpdate = true,\n"
+" dynamicInsert = true, dynamicUpdate = true,\n"
+" optimisticLock = OptimisticLockType.ALL,\n"
+" polymorphism = PolymorphismType.EXPLICIT)\n"
+"@Where(clause=\"1=1\")\n"
+"(a)org.hibernate.annotations.Table(name=\"Forest\", indexes = {
@Index(name="
+"\"idx\", columnNames = { \"name\", \"length\" } ) }
)\n"
+"(a)Persister(impl=MyEntityPersister.class)\n"
+"public class Forest { ... }"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1633
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Inheritance(\n"
+" strategy=InheritanceType.JOINED\n"
+")\n"
+"public class Vegetable { ... }\n"
+"\n"
+"@Entity\n"
+"(a)OnDelete(action=OnDeleteAction.CASCADE)\n"
+"public class Carrot extends Vegetable { ... }"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1637
+#, no-c-format
+msgid "Identifier"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1639
+#, no-c-format
+msgid ""
+"Hibernate Annotations goes beyond the Java Persistence specification when "
+"defining identifiers."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1643
+#, no-c-format
+msgid "Generators"
+msgstr ""
+
+#. Tag: literal
+#: entity.xml:1645
+#, no-c-format
+msgid ""
+"<literal>(a)org.hibernate.annotations.GenericGenerator</literal> and
"
+"<literal>(a)org.hibernate.annotations.GenericGenerators</literal> allows
you "
+"to define an Hibernate specific id generator."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1650
+#, no-c-format
+msgid ""
+"@Id @GeneratedValue(generator=\"system-uuid\")\n"
+"@GenericGenerator(name=\"system-uuid\", strategy =
\"uuid\")\n"
+"public String getId() {\n"
+"\n"
+"@Id @GeneratedValue(generator=\"hibseq\")\n"
+"@GenericGenerator(name=\"hibseq\", strategy =
\"seqhilo\",\n"
+" parameters = {\n"
+" @Parameter(name=\"max_lo\", value = \"5\"),\n"
+" @Parameter(name=\"sequence\",
value=\"heybabyhey\")\n"
+" }\n"
+")\n"
+"public Integer getId() {"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1652
+#, no-c-format
+msgid ""
+"<literal>strategy</literal> is the short name of an Hibernate3
generator "
+"strategy or the fully qualified class name of an "
+"<classname>IdentifierGenerator</classname> implementation. You can add
some "
+"parameters through the <literal>parameters</literal> attribute."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1658
+#, no-c-format
+msgid ""
+"Contrary to their standard counterpart,
<literal>@GenericGenerator</literal> "
+"and <literal>@GenericGenerators</literal> can be used in package level
"
+"annotations, making them application level generators (just like if they "
+"were in a JPA XML file)."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1664
+#, no-c-format
+msgid ""
+"@GenericGenerators(\n"
+" {\n"
+" @GenericGenerator(\n"
+" name=\"hibseq\",\n"
+" strategy = \"seqhilo\",\n"
+" parameters = {\n"
+" @Parameter(name=\"max_lo\", value =
\"5\"),\n"
+" @Parameter(name=\"sequence\",
value=\"heybabyhey\")\n"
+" }\n"
+" ),\n"
+" @GenericGenerator(...)\n"
+" }\n"
+")\n"
+"package org.hibernate.test.model"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1668
+#, no-c-format
+msgid "@NaturalId"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1670
+#, no-c-format
+msgid ""
+"While not used as identifier property, some (group of) properties represent "
+"natural identifier of an entity. This is especially true when the schema "
+"uses the recommended approach of using surrogate primary key even if a "
+"natural business key exists. Hibernate allows to map such natural properties
"
+"and reuse them in a <classname>Criteria</classname> query. The natural
"
+"identifier is composed of all the properties marked
<classname>@NaturalId</"
+"classname>."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1679
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Citizen {\n"
+" @Id\n"
+" @GeneratedValue\n"
+" private Integer id;\n"
+" private String firstname;\n"
+" private String lastname;\n"
+" \n"
+" @NaturalId\n"
+" @ManyToOne\n"
+" private State state;\n"
+"\n"
+" @NaturalId\n"
+" private String ssn;\n"
+" ...\n"
+"}\n"
+"\n"
+"\n"
+"\n"
+"//and later on query\n"
+"List results = s.createCriteria( Citizen.class )\n"
+" .add( Restrictions.naturalId().set( \"ssn\",
\"1234\" ).set"
+"( \"state\", ste ) )\n"
+" .list();"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1681
+#, no-c-format
+msgid ""
+"Note that the group of properties representing the natural identifier have "
+"to be unique (Hibernate will generate a unique constraint if the database "
+"schema is generated)."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1688
+#, no-c-format
+msgid "Property"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1691
+#, no-c-format
+msgid "Access type"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1693
+#, no-c-format
+msgid ""
+"The access type is guessed from the position of <literal>@Id</literal>
or "
+"<literal>@EmbeddedId</literal> in the entity hierarchy. Sub-entities,
"
+"embedded objects and mapped superclass inherit the access type from the root
"
+"entity."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1698
+#, no-c-format
+msgid "In Hibernate, you can override the access type to:"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1702
+#, no-c-format
+msgid "use a custom access type strategy"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1706
+#, no-c-format
+msgid "fine tune the access type at the class level or at the property level"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1711
+#, no-c-format
+msgid ""
+"An @AccessType annotation has been introduced to support this behavior. You "
+"can define the access type on"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1716
+#, no-c-format
+msgid "an entity"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1720
+#, no-c-format
+msgid "a superclass"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1724
+#, no-c-format
+msgid "an embeddable object"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1728
+#, no-c-format
+msgid "a property"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1732
+#, no-c-format
+msgid ""
+"The access type is overriden for the annotated element, if overriden on a "
+"class, all the properties of the given class inherit the access type. For "
+"root entities, the access type is considered to be the default one for the "
+"whole hierarchy (overridable at class or property level)."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1738
+#, no-c-format
+msgid ""
+"If the access type is marked as \"property\", the getters are scanned for
"
+"annotations, if the access type is marked as \"field\", the fields are
"
+"scanned for annotations. Otherwise the elements marked with @Id or "
+"@embeddedId are scanned."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1743
+#, no-c-format
+msgid ""
+"You can override an access type for a property, but the element to annotate "
+"will not be influenced: for example an entity having access type "
+"<literal>field</literal>, can annotate a field with
<literal>@AccessType"
+"(\"property\")</literal>, the access type will then be property for
this "
+"attribute, the the annotations still have to be carried on the field."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1750
+#, no-c-format
+msgid ""
+"If a superclass or an embeddable object is not annotated, the root entity "
+"access type is used (even if an access type has been define on an "
+"intermediate superclass or embeddable object). The russian doll principle "
+"does not apply."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1755
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Person implements Serializable {\n"
+" @Id @GeneratedValue //access type field\n"
+" Integer id;\n"
+"\n"
+" @Embedded\n"
+" @AttributeOverrides({\n"
+" @AttributeOverride(name = \"iso2\", column = @Column(name =
\"bornIso2"
+"\")),\n"
+" @AttributeOverride(name = \"name\", column = @Column(name = "
+"\"bornCountryName\"))\n"
+" })\n"
+" Country bornIn;\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"<emphasis
role=\"bold\">@AccessType(\"property\")</emphasis> //override
"
+"access type for all properties in Country\n"
+"public class Country implements Serializable {\n"
+" private String iso2;\n"
+" private String name;\n"
+"\n"
+" public String getIso2() {\n"
+" return iso2;\n"
+" }\n"
+"\n"
+" public void setIso2(String iso2) {\n"
+" this.iso2 = iso2;\n"
+" }\n"
+"\n"
+" @Column(name = \"countryName\")\n"
+" public String getName() {\n"
+" return name;\n"
+" }\n"
+"\n"
+" public void setName(String name) {\n"
+" this.name = name;\n"
+" }\n"
+"}"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1759
+#, no-c-format
+msgid "Formula"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1761
+#, no-c-format
+msgid ""
+"Sometimes, you want the Database to do some computation for you rather than "
+"in the JVM, you might also create some kind of virtual column. You can use a
"
+"SQL fragment (aka formula) instead of mapping a property into a column. This
"
+"kind of property is read only (its value is calculated by your formula "
+"fragment)."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1767
+#, no-c-format
+msgid ""
+"@Formula(\"obj_length * obj_height * obj_width\")\n"
+"public long getObjectVolume()"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1769
+#, no-c-format
+msgid ""
+"The SQL fragment can be as complex as you want and even include subselects."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1774
+#, no-c-format
+msgid "Type"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1776
+#, no-c-format
+msgid ""
+"<literal>(a)org.hibernate.annotations.Type</literal> overrides the
default "
+"hibernate type used: this is generally not necessary since the type is "
+"correctly inferred by Hibernate. Please refer to the Hibernate reference "
+"guide for more informations on the Hibernate types."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1781
+#, no-c-format
+msgid ""
+"<literal>(a)org.hibernate.annotations.TypeDef</literal> and
<literal>(a)org."
+"hibernate.annotations.TypeDefs</literal> allows you to declare type "
+"definitions. These annotations can be placed at the class or package level. "
+"Note that these definitions are be global for the session factory (even when
"
+"defined at the class level). Type definitions have to be defined before any "
+"usage. If the type is used on a single entity, you can plance the definition
"
+"on the entity itself. Otherwise, it is recommended to place the definition a
"
+"the package level since the entity processing order is not guaranteed."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1790
+#, no-c-format
+msgid ""
+"Package level annotations are placed in a file named
<filename>package-info."
+"java</filename> in the appropriate package. Place your annotations before
"
+"the package declaration."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1793
+#, no-c-format
+msgid ""
+"//in org/hibernate/test/annotations/entity/package-info.java\n"
+"@TypeDefs(\n"
+" {\n"
+" @TypeDef(\n"
+" name=\"caster\",\n"
+" typeClass = CasterStringType.class,\n"
+" parameters = {\n"
+" @Parameter(name=\"cast\", value=\"lower\")\n"
+" }\n"
+" )\n"
+" }\n"
+")\n"
+"package org.hibernate.test.annotations.entity;\n"
+"\n"
+"//in org/hibernate/test/annotations/entity/Forest.java\n"
+"public class Forest {\n"
+" @Type(type=\"caster\")\n"
+" public String getSmallText() {\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1795
+#, no-c-format
+msgid ""
+"When using composite user type, you will have to express column definitions.
"
+"The <literal>@Columns</literal> has been introduced for that
purpose."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1799
+#, no-c-format
+msgid ""
+"(a)Type(type=\"org.hibernate.test.annotations.entity.MonetaryAmountUserType"
+"\")\n"
+"@Columns(columns = {\n"
+" @Column(name=\"r_amount\"),\n"
+" @Column(name=\"r_currency\")\n"
+"})\n"
+"public MonetaryAmount getAmount() {\n"
+" return amount;\n"
+"}\n"
+"\n"
+"\n"
+"public class MonetaryAmount implements Serializable {\n"
+" private BigDecimal amount;\n"
+" private Currency currency;\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1803
+#, no-c-format
+msgid "Index"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1805
+#, no-c-format
+msgid ""
+"You can define an index on a particular column using the
<literal>@Index</"
+"literal> annotation on a one column property, the columnNames attribute will
"
+"then be ignored"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1809
+#, no-c-format
+msgid ""
+"@Column(secondaryTable=\"Cat1\")\n"
+"@Index(name=\"story1index\")\n"
+"public String getStoryPart1() {\n"
+" return storyPart1;\n"
+"}"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1813
+#, no-c-format
+msgid "@Parent"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1815
+#, no-c-format
+msgid ""
+"When inside an embeddable object, you can define one of the properties as a "
+"pointer back to the owner element."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1818
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Person {\n"
+" @Embeddable public Address address;\n"
+" ...\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"public class Address {\n"
+" @Parent public Person owner;\n"
+" ...\n"
+"}\n"
+"\n"
+"\n"
+"person == person.address.owner"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1822
+#, no-c-format
+msgid "Generated properties"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1824
+#, no-c-format
+msgid ""
+"Some properties are generated at insert or update time by your database. "
+"Hibernate can deal with such properties and triggers a subsequent select to "
+"read these properties."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1828
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Antenna {\n"
+" @Id public Integer id;\n"
+" @Generated(GenerationTime.ALWAYS) @Column(insertable = false, updatable "
+"= false)\n"
+" public String longitude;\n"
+"\n"
+" @Generated(GenerationTime.INSERT) @Column(insertable = false)\n"
+" public String latitude;\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1830
+#, no-c-format
+msgid ""
+"Annotate your property as <literal>@Generated</literal> You have to
make "
+"sure your insertability or updatability does not conflict with the "
+"generation strategy you have chosen. When GenerationTime.INSERT is chosen, "
+"the property must not contains insertable columns, when GenerationTime."
+"ALWAYS is chosen, the property must not contains insertable nor updatable "
+"columns."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1837
+#, no-c-format
+msgid ""
+"<literal>@Version</literal> properties cannot be
<literal>@Generated(INSERT)"
+"</literal> by design, it has to be either
<literal>NEVER</literal> or "
+"<literal>ALWAYS</literal>."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1843
+#, no-c-format
+msgid "@Target"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1845
+#, no-c-format
+msgid ""
+"Sometimes, the type guessed by reflection is not the one you want Hibernate "
+"to use. This is especially true on components when an interface is used. You
"
+"can use <literal>@Target</literal> to by pass the reflection guessing
"
+"mechanism (very much like the <literal>targetEntity</literal> attribute
"
+"available on associations."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1852
+#, no-c-format
+msgid ""
+"@Embedded\n"
+" <emphasis
role=\"bold\">(a)Target(OwnerImpl.class)</emphasis>\n"
+" public Owner getOwner() {\n"
+" return owner;\n"
+" }"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1858
+#, no-c-format
+msgid "Optimistic lock"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1860
+#, no-c-format
+msgid ""
+"It is sometimes useful to avoid increasing the version number even if a "
+"given property is dirty (particularly collections). You can do that by "
+"annotating the property (or collection) with <literal>@OptimisticLock"
+"(excluded=true)</literal>."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1865
+#, no-c-format
+msgid ""
+"More formally, specifies that updates to this property do not require "
+"acquisition of the optimistic lock."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1871
+#, no-c-format
+msgid "Inheritance"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1873
+#, no-c-format
+msgid ""
+"SINGLE_TABLE is a very powerful strategy but sometimes, and especially for "
+"legacy systems, you cannot add an additional discriminator column. For that "
+"purpose Hibernate has introduced the notion of discriminator formula: "
+"<literal>@DiscriminatorFormula</literal> is a replacement of "
+"<literal>@DiscriminatorColumn</literal> and use a SQL fragment as a
formula "
+"for discriminator resolution (no need to have a dedicated column)."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1882
+#, no-c-format
+msgid ""
+"@Entity\n"
+"<emphasis role=\"bold\">@DiscriminatorFormula(\"case when
forest_type is "
+"null then 0 else forest_type end\")</emphasis>\n"
+"public class Forest { ... }"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1884
+#, no-c-format
+msgid ""
+"By default, when querying the top entities, Hibernate does not put a "
+"restriction clause on the discriminator column. This can be inconvenient if "
+"this column contains values not mapped in your hierarchy (through "
+"<literal>@DiscriminatorValue</literal>). To work around that you can
use "
+"<literal>@ForceDiscriminator</literal> (at the class level, next to
"
+"<literal>@DiscriminatorColumn</literal>). Hibernate will then list the
"
+"available values when loading the entities."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1892
+#, no-c-format
+msgid ""
+"You can define the foreign key name generated by Hibernate for subclass "
+"tables in the JOINED inheritance strategy."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1895
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Inheritance(strategy = InheritanceType.JOINED)\n"
+"public abstract class File { ... }\n"
+"\n"
+"@Entity\n"
+"@ForeignKey(name = \"FK_DOCU_FILE\")\n"
+"public class Document extends File {"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1897
+#, no-c-format
+msgid ""
+"The foreign key from the <literal>Document</literal> table to the
"
+"<literal>File</literal> table will be named
<literal>FK_DOCU_FILE</literal>."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1903
+#, no-c-format
+msgid "Single Association related annotations"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1905
+#, no-c-format
+msgid ""
+"By default, when Hibernate cannot resolve the association because the "
+"expected associated element is not in database (wrong id on the association "
+"column), an exception is raised by Hibernate. This might be inconvenient for
"
+"legacy and badly maintained schemas. You can ask Hibernate to ignore such "
+"elements instead of raising an exception using the
<literal>@NotFound</"
+"literal> annotation. This annotation can be used on a
<literal>@OneToOne</"
+"literal> (with FK), <literal>@ManyToOne</literal>,
<literal>@OneToMany</"
+"literal> or <literal>@ManyToMany</literal> association."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1915
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Child {\n"
+" ...\n"
+" @ManyToOne\n"
+" @NotFound(action=NotFoundAction.IGNORE)\n"
+" public Parent getParent() { ... }\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1917
+#, no-c-format
+msgid ""
+"Sometimes you want to delegate to your database the deletion of cascade when
"
+"a given entity is deleted."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1920
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Child {\n"
+" ...\n"
+" @ManyToOne\n"
+" @OnDelete(action=OnDeleteAction.CASCADE)\n"
+" public Parent getParent() { ... }\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1922
+#, no-c-format
+msgid ""
+"In this case Hibernate generates a cascade delete constraint at the database
"
+"level."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1925
+#, no-c-format
+msgid ""
+"Foreign key constraints, while generated by Hibernate, have a fairly "
+"unreadable name. You can override the constraint name by use "
+"<literal>(a)ForeignKey</literal>."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:1929
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Child {\n"
+" ...\n"
+" @ManyToOne\n"
+" <emphasis
role=\"bold\">@ForeignKey(name=\"FK_PARENT\")</emphasis>\n"
+" public Parent getParent() { ... }\n"
+" ...\n"
+"}\n"
+"\n"
+"alter table Child add constraint FK_PARENT foreign key (parent_id) "
+"references Parent"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1932
+#, no-c-format
+msgid "Lazy options and fetching modes"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1934
+#, no-c-format
+msgid ""
+"EJB3 comes with the <literal>fetch</literal> option to define lazy
loading "
+"and fetching modes, however Hibernate has a much more option set in this "
+"area. To fine tune the lazy loading and fetching strategies, some additional
"
+"annotations have been introduced:"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1941
+#, no-c-format
+msgid ""
+"<literal>@LazyToOne</literal>: defines the lazyness option on "
+"<literal>@ManyToOne</literal> and
<literal>@OneToOne</literal> associations. "
+"<literal>LazyToOneOption</literal> can be
<literal>PROXY</literal> (ie use a "
+"proxy based lazy loading), <literal>NO_PROXY</literal> (use a bytecode
"
+"enhancement based lazy loading - note that build time bytecode processing is
"
+"necessary) and <literal>FALSE</literal> (association not lazy)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1951
+#, no-c-format
+msgid ""
+"<literal>@LazyCollection</literal>: defines the lazyness option on
"
+"<literal>@ManyTo</literal>Many and
<literal>@OneToMany</literal> "
+"associations. LazyCollectionOption can be <literal>TRUE</literal> (the
"
+"collection is lazy and will be loaded when its state is accessed), "
+"<literal>EXTRA</literal> (the collection is lazy and all operations
will try "
+"to avoid the collection loading, this is especially useful for huge "
+"collections when loading all the elements is not necessary) and FALSE "
+"(association not lazy)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1963
+#, no-c-format
+msgid ""
+"<literal>@Fetch</literal>: defines the fetching strategy used to load
the "
+"association. <literal>FetchMode</literal> can be
<literal>SELECT</literal> "
+"(a select is triggered when the association needs to be loaded), "
+"<literal>SUBSELECT</literal> (only available for collections, use a
"
+"subselect strategy - please refers to the Hibernate Reference Documentation "
+"for more information) or <literal>JOIN</literal> (use a SQL JOIN to
load the "
+"association while loading the owner entity). <literal>JOIN</literal>
"
+"overrides any lazy attribute (an association loaded through a
<literal>JOIN</"
+"literal> strategy cannot be lazy)."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:1977
+#, no-c-format
+msgid "The Hibernate annotations overrides the EJB3 fetching options."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:1981
+#, no-c-format
+msgid "Lazy and fetch options equivalent"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1986
+#, no-c-format
+msgid "Annotations"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1988
+#, no-c-format
+msgid "Lazy"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1990
+#, no-c-format
+msgid "Fetch"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1996
+#, no-c-format
+msgid "(a)[One|Many]ToOne](fetch=FetchType.LAZY)"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:1998
+#, no-c-format
+msgid "@LazyToOne(PROXY)"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:2000 entity.xml:2016
+#, no-c-format
+msgid "@Fetch(SELECT)"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:2004
+#, no-c-format
+msgid "(a)[One|Many]ToOne](fetch=FetchType.EAGER)"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:2006
+#, no-c-format
+msgid "@LazyToOne(FALSE)"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:2008 entity.xml:2024
+#, no-c-format
+msgid "@Fetch(JOIN)"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:2012
+#, no-c-format
+msgid "(a)ManyTo[One|Many](fetch=FetchType.LAZY)"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:2014
+#, no-c-format
+msgid "@LazyCollection(TRUE)"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:2020
+#, no-c-format
+msgid "(a)ManyTo[One|Many](fetch=FetchType.EAGER)"
+msgstr ""
+
+#. Tag: entry
+#: entity.xml:2022
+#, no-c-format
+msgid "@LazyCollection(FALSE)"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:2032
+#, no-c-format
+msgid "@Any"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2034
+#, no-c-format
+msgid ""
+"The <classname>@Any</classname> annotation defines a polymorphic
association "
+"to classes from multiple tables. This type of mapping always requires more "
+"than one column. The first column holds the type of the associated entity. "
+"The remaining columns hold the identifier. It is impossible to specify a "
+"foreign key constraint for this kind of association, so this is most "
+"certainly not meant as the usual way of mapping (polymorphic) associations. "
+"You should use this only in very special cases (eg. audit logs, user session
"
+"data, etc)."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2043
+#, no-c-format
+msgid ""
+"The @Any annotation describes the column holding the metadata information. "
+"To link the value of the metadata information and an actual entity type, The
"
+"<classname>@AnyDef</classname> and
<classname>@AnyDefs</classname> "
+"annotations are used."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2048
+#, no-c-format
+msgid ""
+"@Any( metaColumn = @Column( name = \"property_type\" ),
fetch=FetchType."
+"EAGER )\n"
+" @AnyMetaDef( \n"
+" idType = \"integer\", \n"
+" metaType = \"string\", \n"
+" metaValues = {\n"
+" @MetaValue( value = \"S\", targetEntity =
StringProperty."
+"class ),\n"
+" @MetaValue( value = \"I\", targetEntity =
IntegerProperty."
+"class )\n"
+" } )\n"
+" @JoinColumn( name = \"property_id\" )\n"
+" public Property getMainProperty() {\n"
+" return mainProperty;\n"
+" }"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2050
+#, no-c-format
+msgid ""
+"<methodname>idType</methodname> represents the target entities
identifier "
+"property type and <methodname>metaType</methodname> the metadata type
"
+"(usually String)."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2054
+#, no-c-format
+msgid ""
+"Note that <classname>@AnyDef</classname> can be mutualized and reused.
It is "
+"recommended to place it as a package metadata in this case."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2058
+#, no-c-format
+msgid ""
+"//on a package\n"
+"@AnyMetaDef( name=\"property\" \n"
+" idType = \"integer\", \n"
+" metaType = \"string\", \n"
+" metaValues = {\n"
+" @MetaValue( value = \"S\", targetEntity = StringProperty.class
),\n"
+" @MetaValue( value = \"I\", targetEntity = IntegerProperty.class
)\n"
+" } )\n"
+"package org.hibernate.test.annotations.any;\n"
+"\n"
+"\n"
+"//in a class\n"
+" @Any( metaDef=\"property\", metaColumn = @Column( name =
\"property_type"
+"\" ), fetch=FetchType.EAGER )\n"
+" @JoinColumn( name = \"property_id\" )\n"
+" public Property getMainProperty() {\n"
+" return mainProperty;\n"
+" }"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:2063
+#, no-c-format
+msgid "Collection related annotations"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:2066
+#, no-c-format
+msgid "Enhance collection settings"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2068
+#, no-c-format
+msgid "It is possible to set"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2070
+#, no-c-format
+msgid "the batch size for collections using @BatchSize"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2075
+#, no-c-format
+msgid ""
+"the where clause, using @Where (applied on the target entity) or "
+"@WhereJoinTable (applied on the association table)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2080
+#, no-c-format
+msgid "the check clause, using @Check"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2085
+#, no-c-format
+msgid "the SQL order by clause, using @OrderBy"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2090
+#, no-c-format
+msgid ""
+"the delete cascade strategy through @OnDelete(action=OnDeleteAction.CASCADE)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2095
+#, no-c-format
+msgid ""
+"the collection immutability using @Immutable: if set specifies that the "
+"elements of the collection never change (a minor performance optimization in
"
+"some cases)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2100
+#, no-c-format
+msgid ""
+"a custom collection persister (ie the persistence strategy used) using "
+"<literal>@Persister</literal>: the class must implement
<classname>org."
+"hibernate.persister.collectionCollectionPersister</classname>"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2107
+#, no-c-format
+msgid ""
+"You can also declare a sort comparator. Use the
<literal>@Sort</literal> "
+"annotation. Expressing the comparator type you want between unsorted, "
+"natural or custom comparator. If you want to use your own comparator "
+"implementation, you'll also have to express the implementation class using
"
+"the <literal>comparator</literal> attribute. Note that you need to use
"
+"either a <classname>SortedSet</classname> or a
<classname>SortedMap</"
+"classname> interface."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2116
+#, no-c-format
+msgid ""
+"(a)OneToMany(cascade=CascadeType.ALL, fetch=FetchType.EAGER)\n"
+" @JoinColumn(name=\"CUST_ID\")\n"
+" @Sort(type = SortType.COMPARATOR, comparator = TicketComparator.class)\n"
+" @Where(clause=\"1=1\")\n"
+" @OnDelete(action=OnDeleteAction.CASCADE)\n"
+" public SortedSet<Ticket> getTickets() {\n"
+" return tickets;\n"
+" }"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2118
+#, no-c-format
+msgid ""
+"Please refer to the previous descriptions of these annotations for more "
+"informations."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2121
+#, no-c-format
+msgid ""
+"Foreign key constraints, while generated by Hibernate, have a fairly "
+"unreadable name. You can override the constraint name by use "
+"<literal>@ForeignKey</literal>. Note that this annotation has to be
placed "
+"on the owning side of the relationship, <literal>inverseName</literal>
"
+"referencing to the other side constraint."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2128
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Woman {\n"
+" ...\n"
+" @ManyToMany(cascade = {CascadeType.ALL})\n"
+" <emphasis role=\"bold\">@ForeignKey(name =
\"TO_WOMAN_FK\", inverseName "
+"= \"TO_MAN_FK\")</emphasis>\n"
+" public Set<Man> getMens() {\n"
+" return mens;\n"
+" }\n"
+"}\n"
+"\n"
+"alter table Man_Woman add constraint TO_WOMAN_FK foreign key (woman_id) "
+"references Woman\n"
+"alter table Man_Woman add constraint TO_MAN_FK foreign key (man_id) "
+"references Man"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:2132
+#, no-c-format
+msgid "Extra collection types"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:2135
+#, no-c-format
+msgid "List"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2137
+#, no-c-format
+msgid ""
+"Beyond EJB3, Hibernate Annotations supports true
<classname>List</classname> "
+"and <classname>Array</classname>. Map your collection the same way as
usual "
+"and add the @<literal>IndexColumn</literal>. This annotation allows you
to "
+"describe the column that will hold the index. You can also declare the index
"
+"value in DB that represent the first element (aka as base index). The usual "
+"value is <literal>0</literal> or
<literal>1</literal>."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2146
+#, no-c-format
+msgid ""
+"@OneToMany(cascade = CascadeType.ALL)\n"
+"@IndexColumn(name = \"drawer_position\", base=1)\n"
+"public List<Drawer> getDrawers() {\n"
+" return drawers;\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2149
+#, no-c-format
+msgid ""
+"If you forgot to set <literal>@IndexColumn</literal>, the bag semantic
is "
+"applied. If you want the bag semantic without the limitations of it, "
+"consider using <literal>(a)CollectionId</literal>."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:2157
+#, no-c-format
+msgid "<title>Map</title>"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2159
+#, no-c-format
+msgid ""
+"Hibernate Annotations also supports true Map mappings, if
<literal>(a)javax."
+"persistence.MapKey</literal> is not set, hibernate will map the key element
"
+"or embeddable object in its/their own columns. To override the default "
+"columns, you can use
<literal>(a)org.hibernate.annotations.MapKey</literal> if "
+"your key is a basic type (defaulted to <literal>mapkey</literal>) or an
"
+"embeddable object, or you can use <literal>(a)org.hibernate.annotations."
+"MapKeyManyToMany</literal> if your key is an entity."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2169
+#, no-c-format
+msgid ""
+"Both <literal>(a)org.hibernate.annotations.MapKey</literal> and
<literal>(a)org."
+"hibernate.annotations.MapKeyManyToMany</literal> allows you to override the
"
+"target element to be used. This is especially useful if your collection does
"
+"not use generics (or if you use interfaces)."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2175
+#, no-c-format
+msgid ""
+"@CollectionOfElements(targetElement = SizeImpl.class)\n"
+" @MapKeyManyToMany(<emphasis role=\"bold\">targetEntity =
LuggageImpl."
+"class</emphasis>)\n"
+" private Map<Luggage, Size> sizePerLuggage = new
HashMap<"
+"Luggage, Size>();"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:2182
+#, no-c-format
+msgid "Bidirectional association with indexed collections"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2184
+#, no-c-format
+msgid ""
+"A bidirectional association where one end is an indexed collection (ie. "
+"represented as a <literal>@IndexColumn</literal>,
<literal>(a)org.hibernate."
+"annotations.MapKey</literal> or
<classname>(a)org.hibernate.annotations."
+"MapKeyManyToMany</classname>) requires special consideration. If a property
"
+"on the associated class explicitly maps the indexed value, the use of "
+"<methodname>mappedBy</methodname> is permitted:"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2192
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Parent {\n"
+" @OneToMany(mappedBy=\"parent\")\n"
+" @org.hibernate.annotations.IndexColumn(name=\"order\")\n"
+" private List<Child> children;\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Child {\n"
+" ...\n"
+" //the index column is mapped as a property in the associated entity\n"
+" @Column(name=\"order\")\n"
+" private int order;\n"
+"\n"
+" @ManyToOne\n"
+" @JoinColumn(name=\"parent_id\", nullable=false)\n"
+" private Parent parent;\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2194
+#, no-c-format
+msgid ""
+"But, if there is no such property on the child class, we can't think of the
"
+"association as truly bidirectional (there is information available at one "
+"end of the association that is not available at the other end: the index). "
+"In this case, we can't map the collection as
<literal>mappedBy</literal>. "
+"Instead, we could use the following mapping:"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2201
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Parent {\n"
+" @OneToMany\n"
+" @org.hibernate.annotations.IndexColumn(name=\"order\")\n"
+" @JoinColumn(name=\"parent_id\", nullable=false)\n"
+" private List<Child> children;\n"
+" ...\n"
+"}\n"
+"\n"
+"@Entity\n"
+"public class Child {\n"
+" ...\n"
+" @ManyToOne\n"
+" @JoinColumn(name=\"parent_id\", insertable=false, updatable=false,
"
+"nullable=false)\n"
+" private Parent parent;\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2203
+#, no-c-format
+msgid ""
+"Note that in this mapping, the collection-valued end of the association is "
+"responsible for updating the foreign key."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:2208
+#, no-c-format
+msgid "Bag with primary key"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2210
+#, no-c-format
+msgid ""
+"Another interesting feature is the ability to define a surrogate primary key
"
+"to a bag collection. This remove pretty much all of the drawbacks of bags: "
+"update and removal are efficient, more than one
<literal>EAGER</literal> bag "
+"per query or per entity. This primary key will be contained in a additional "
+"column of your collection table but will not be visible to the Java "
+"application. @CollectionId is used to mark a collection as id bag, it also "
+"allow to override the primary key column(s), the primary key type and the "
+"generator strategy. The strategy can be <literal>identity</literal>, or
any "
+"defined generator name of your application."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2221
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@TableGenerator(name=\"ids_generator\", table=\"IDS\")\n"
+"public class Passport {\n"
+" ...\n"
+"\n"
+" @ManyToMany(cascade = CascadeType.ALL)\n"
+" @JoinTable(name=\"PASSPORT_VISASTAMP\")\n"
+" <emphasis role=\"bold\">@CollectionId(\n"
+" columns = @Column(name=\"COLLECTION_ID\"), \n"
+" type=@Type(type=\"long\"), \n"
+" generator = \"ids_generator\"\n"
+" )</emphasis>\n"
+" private Collection<Stamp> visaStamp = new ArrayList();\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:2225
+#, no-c-format
+msgid "Collection of element or composite elements"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2227
+#, no-c-format
+msgid ""
+"Hibernate Annotations also supports collections of core types (Integer, "
+"String, Enums, ...), collections of embeddable objects and even arrays of "
+"primitive types. This is known as collection of elements."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2232
+#, no-c-format
+msgid ""
+"A collection of elements has to be annotated as "
+"<literal>@CollectionOfElements</literal> (as a replacement of "
+"<literal>@OneToMany</literal>) To define the collection table, the
"
+"<literal>@JoinTable</literal> annotation is used on the association
"
+"property, <literal>joinColumns</literal> defines the join columns
between "
+"the entity primary table and the collection table (inverseJoincolumn is "
+"useless and should be left empty). For collection of core types or array of "
+"primitive types, you can override the element column definition using a "
+"<literal>@Column</literal> on the association property. You can also
"
+"override the columns of a collection of embeddable object using "
+"<literal>@AttributeOverride</literal>. To reach the collection element,
you "
+"need to append \"element\" to the attribute override name (eg
\"element\" "
+"for core types, or \"element.serial\" for the serial property of an
"
+"embeddable element). To reach the index/key of a collection, append
\"key\" "
+"instead."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2249
+#, no-c-format
+msgid ""
+"@Entity\n"
+"public class Boy {\n"
+" private Integer id;\n"
+" private Set<String> nickNames = new
HashSet<String>();\n"
+" private int[] favoriteNumbers;\n"
+" private Set<Toy> favoriteToys = new
HashSet<Toy>();\n"
+" private Set<Character> characters = new
HashSet<Character>"
+"();\n"
+"\n"
+" @Id @GeneratedValue\n"
+" public Integer getId() {\n"
+" return id;\n"
+" }\n"
+"\n"
+" <emphasis role=\"bold\">@CollectionOfElements\n"
+" public Set<String></emphasis> getNickNames() {\n"
+" return nickNames;\n"
+" }\n"
+"\n"
+" <emphasis role=\"bold\">@CollectionOfElements\n"
+" @JoinTable(\n"
+" table=@Table(name=\"BoyFavoriteNumbers\"),\n"
+" joinColumns = @JoinColumn(name=\"BoyId\")\n"
+" )\n"
+" @Column(name=\"favoriteNumber\",
nullable=false)</emphasis>\n"
+" @IndexColumn(name=\"nbr_index\")\n"
+" public int[] getFavoriteNumbers() {\n"
+" return favoriteNumbers;\n"
+" }\n"
+"\n"
+" <emphasis role=\"bold\">@CollectionOfElements\n"
+" @AttributeOverride( name=\"element.serial\",
column=@Column(name="
+"\"serial_nbr\") )</emphasis>\n"
+" public Set<Toy> getFavoriteToys() {\n"
+" return favoriteToys;\n"
+" }\n"
+"\n"
+" <emphasis role=\"bold\">@CollectionOfElements\n"
+" public Set<Character></emphasis> getCharacters() {\n"
+" return characters;\n"
+" }\n"
+" ...\n"
+"}\n"
+"\n"
+"public enum Character {\n"
+" GENTLE,\n"
+" NORMAL,\n"
+" AGGRESSIVE,\n"
+" ATTENTIVE,\n"
+" VIOLENT,\n"
+" CRAFTY\n"
+"}\n"
+"\n"
+"@Embeddable\n"
+"public class Toy {\n"
+" public String name;\n"
+" public String serial;\n"
+" public Boy owner;\n"
+"\n"
+" public String getName() {\n"
+" return name;\n"
+" }\n"
+"\n"
+" public void setName(String name) {\n"
+" this.name = name;\n"
+" }\n"
+"\n"
+" public String getSerial() {\n"
+" return serial;\n"
+" }\n"
+"\n"
+" public void setSerial(String serial) {\n"
+" this.serial = serial;\n"
+" }\n"
+"\n"
+" <emphasis role=\"bold\">@Parent</emphasis>\n"
+" public Boy getOwner() {\n"
+" return owner;\n"
+" }\n"
+"\n"
+" public void setOwner(Boy owner) {\n"
+" this.owner = owner;\n"
+" }\n"
+"\n"
+" public boolean equals(Object o) {\n"
+" if ( this == o ) return true;\n"
+" if ( o == null || getClass() != o.getClass() ) return false;\n"
+"\n"
+" final Toy toy = (Toy) o;\n"
+"\n"
+" if ( !name.equals( toy.name ) ) return false;\n"
+" if ( !serial.equals( toy.serial ) ) return false;\n"
+"\n"
+" return true;\n"
+" }\n"
+"\n"
+" public int hashCode() {\n"
+" int result;\n"
+" result = name.hashCode();\n"
+" result = 29 * result + serial.hashCode();\n"
+" return result;\n"
+" }\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2251
+#, no-c-format
+msgid ""
+"On a collection of embeddable objects, the embeddable object can have a "
+"property annotated with <literal>@Parent</literal>. This property will
then "
+"point back to the entity containing the collection."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2257
+#, no-c-format
+msgid ""
+"Previous versions of Hibernate Annotations used the
<literal>@OneToMany</"
+"literal> to mark a collection of elements. Due to semantic inconsistencies,
"
+"we've introduced the annotation
<literal>@CollectionOfElements</literal>. "
+"Marking collections of elements the old way still work but is considered "
+"deprecated and is going to be unsupported in future releases"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:2267
+#, no-c-format
+msgid "@ManyToAny"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2269
+#, no-c-format
+msgid ""
+"<classname>@ManyToAny</classname> allows polymorphic associations to
classes "
+"from multiple tables. This type of mapping always requires more than one "
+"column. The first column holds the type of the associated entity. The "
+"remaining columns hold the identifier. It is impossible to specify a foreign
"
+"key constraint for this kind of association, so this is most certainly not "
+"meant as the usual way of mapping (polymorphic) associations. You should use
"
+"this only in very special cases (eg. audit logs, user session data, etc)."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2279
+#, no-c-format
+msgid ""
+"@ManyToAny(\n"
+" metaColumn = @Column( name = \"property_type\" ) )\n"
+" @AnyMetaDef( \n"
+" idType = \"integer\", \n"
+" metaType = \"string\",\n"
+" metaValues = {\n"
+" @MetaValue( value = \"S\", targetEntity =
StringProperty."
+"class ),\n"
+" @MetaValue( value = \"I\", targetEntity =
IntegerProperty."
+"class ) } )\n"
+" @Cascade( { org.hibernate.annotations.CascadeType.ALL } )\n"
+" @JoinTable( name = \"obj_properties\", joinColumns = @JoinColumn(
name = "
+"\"obj_id\" ),\n"
+" inverseJoinColumns = @JoinColumn( name = \"property_id\" )
)\n"
+" public List<Property> getGeneralProperties() {"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2281
+#, no-c-format
+msgid ""
+"Like <classname>@Any</classname>,
<classname>@ManyToAny</classname> can use "
+"named <classname>@AnyDef</classname>s, see <xref
linkend=\"entity-hibspec-"
+"singleassoc-any\"/> for more info."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:2290
+#, no-c-format
+msgid "Cascade"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2292
+#, no-c-format
+msgid ""
+"Hibernate offers more operations than the Java Persistence specification. "
+"You can use the <literal>@Cascade</literal> annotation to cascade the
"
+"following operations:"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2298
+#, no-c-format
+msgid "PERSIST"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2302
+#, no-c-format
+msgid "MERGE"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2306
+#, no-c-format
+msgid "REMOVE"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2310
+#, no-c-format
+msgid "REFRESH"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2314
+#, no-c-format
+msgid "DELETE"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2318
+#, no-c-format
+msgid "SAVE_UPDATE"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2322
+#, no-c-format
+msgid "REPLICATE"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2326
+#, no-c-format
+msgid "DELETE_ORPHAN"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2330
+#, no-c-format
+msgid "LOCK"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2334
+#, no-c-format
+msgid "EVICT"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2338
+#, no-c-format
+msgid ""
+"This is especially useful for <literal>SAVE_UPDATE</literal> (which is
the "
+"operation cascaded at flush time if you use plain Hibernate Annotations - "
+"Hibernate EntityManager cascade <literal>PERSIST</literal> at flush
time as "
+"per the specification). DELETE_ORPHAN applies only to
<literal>@OneToMany</"
+"literal> associations, and indicates that the
<methodname>delete()/remove()</"
+"methodname> operation should be applied to any child object that is removed
"
+"from the association. In other words, if a child is dereferenced by a "
+"persistent parent and if <literal>DELETE_ORPHAN</literal> is used, the
"
+"\"orphaned\" child is deleted."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2350
+#, no-c-format
+msgid ""
+"@OneToMany( cascade = {CascadeType.PERSIST, CascadeType.MERGE}
<emphasis\n"
+" role=\"bold\">)\n"
+"(a)Cascade({org.hibernate.annotations.CascadeType.SAVE_UPDATE,\n"
+"
org.hibernate.annotations.CascadeType.DELETE_ORPHAN})</emphasis>\n"
+"public Collection<Employer> getEmployers()"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2352
+#, no-c-format
+msgid ""
+"It is recommended to use @Cascade to compliment @*To*(cascade=...) as shown "
+"in the previous example."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:2357
+#, no-c-format
+msgid "Cache"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2359
+#, no-c-format
+msgid ""
+"In order to optimize your database accesses, you can activate the so called "
+"second level cache of Hibernate. This cache is configurable on a per entity "
+"and per collection basis."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2363
+#, no-c-format
+msgid ""
+"<literal>(a)org.hibernate.annotations.Cache</literal> defines the caching
"
+"strategy and region of a given second level cache. This annotation can be "
+"applied on the root entity (not the sub entities), and on the collections."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2368
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)\n"
+"public class Forest { ... }"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2370
+#, no-c-format
+msgid ""
+"(a)OneToMany(cascade=CascadeType.ALL, fetch=FetchType.EAGER)\n"
+" @JoinColumn(name=\"CUST_ID\")\n"
+" @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)\n"
+" public SortedSet<Ticket> getTickets() {\n"
+" return tickets;\n"
+" }"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2383
+#, no-c-format
+msgid ""
+"@Cache(\n"
+" CacheConcurrencyStrategy usage();\n"
+" String region() default \"\";\n"
+" String include() default \"all\";\n"
+")"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2387
+#, no-c-format
+msgid ""
+"usage: the given cache concurrency strategy (NONE, READ_ONLY, "
+"NONSTRICT_READ_WRITE, READ_WRITE, TRANSACTIONAL)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2392
+#, no-c-format
+msgid ""
+"region (optional): the cache region (default to the fqcn of the class or the
"
+"fq role name of the collection)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2397
+#, no-c-format
+msgid ""
+"<literal>include</literal> (optional): all to include all properties,
non-"
+"lazy to only include non lazy properties (default all)."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:2406
+#, no-c-format
+msgid "Filters"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2408
+#, no-c-format
+msgid ""
+"Hibernate has the ability to apply arbitrary filters on top of your data. "
+"Those filters are applied at runtime on a given session. First, you need to "
+"define them."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2412
+#, no-c-format
+msgid ""
+"<literal>(a)org.hibernate.annotations.FilterDef</literal> or "
+"<literal>@FilterDefs</literal> define filter definition(s) used by
filter(s) "
+"using the same name. A filter definition has a name() and an array of "
+"parameters(). A parameter will allow you to adjust the behavior of the "
+"filter at runtime. Each parameter is defined by a
<literal>@ParamDef</"
+"literal> which has a name and a type. You can also define a
defaultCondition"
+"() parameter for a given <literal>@FilterDef</literal> to set the
default "
+"condition to use when none are defined in each individual
<literal>@Filter</"
+"literal>. A <literal>@FilterDef</literal>(s) can be defined at the
class or "
+"package level."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2424
+#, no-c-format
+msgid ""
+"We now need to define the SQL filter clause applied to either the entity "
+"load or the collection load. <literal>@Filter</literal> is used and
placed "
+"either on the entity or the collection element"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2428
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@FilterDef(name=\"minLength\", parameters=@ParamDef(
name=\"minLength\", "
+"type=\"integer\" ) )\n"
+"@Filters( {\n"
+" @Filter(name=\"betweenLength\", condition=\":minLength <=
length and :"
+"maxLength >= length\"),\n"
+" @Filter(name=\"minLength\", condition=\":minLength <=
length\")\n"
+"} )\n"
+"public class Forest { ... }"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2430
+#, no-c-format
+msgid ""
+"When the collection use an association table as a relational representation,
"
+"you might want to apply the filter condition to the association table itself
"
+"or to the target entity table. To apply the constraint on the target entity,
"
+"use the regular <literal>@Filter</literal> annotation. However, if you
wan "
+"to target the association table, use the
<literal>@FilterJoinTable</literal> "
+"annotation."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2438
+#, no-c-format
+msgid ""
+"@OneToMany\n"
+" @JoinTable\n"
+" //filter on the target entity table\n"
+" @Filter(name=\"betweenLength\", condition=\":minLength <=
length and :"
+"maxLength >= length\")\n"
+" //filter on the association table\n"
+" @FilterJoinTable(name=\"security\", condition=\":userlevel
>= "
+"requredLevel\")\n"
+" public Set<Forest> getForests() { ... }"
+msgstr ""
+
+#. Tag: title
+#: entity.xml:2442
+#, no-c-format
+msgid "Queries"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2444
+#, no-c-format
+msgid ""
+"Since Hibernate has more features on named queries than the one defined in "
+"the EJB3 specification,
<literal>(a)org.hibernate.annotations.NamedQuery</"
+"literal>,
<literal>(a)org.hibernate.annotations.NamedQueries</literal>, "
+"<literal>(a)org.hibernate.annotations.NamedNativeQuery</literal> and
"
+"<literal>(a)org.hibernate.annotations.NamedNativeQueries</literal> have
been "
+"introduced. They add some attributes to the standard version and can be used
"
+"as a replacement:"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2455
+#, no-c-format
+msgid "flushMode: define the query flush mode (Always, Auto, Commit or
Manual)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2460
+#, no-c-format
+msgid "cacheable: whether the query should be cached or not"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2464
+#, no-c-format
+msgid "cacheRegion: cache region used if the query is cached"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2468
+#, no-c-format
+msgid "fetchSize: JDBC statement fetch size for this query"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2472
+#, no-c-format
+msgid "timeout: query time out"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2476
+#, no-c-format
+msgid ""
+"callable: for native queries only, to be set to true for stored procedures"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2481
+#, no-c-format
+msgid ""
+"comment: if comments are activated, the comment seen when the query is sent "
+"to the database."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2486
+#, no-c-format
+msgid "cacheMode: Cache interaction mode (get, ignore, normal, put or
refresh)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2491
+#, no-c-format
+msgid ""
+"readOnly: whether or not the elements retrievent from the query are in read "
+"only mode."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2496
+#, no-c-format
+msgid ""
+"Those hints can be set in a standard
<literal>(a)javax.persistence.NamedQuery</"
+"literal> annotations through the detyped
<literal>@QueryHint</literal>. "
+"Another key advantage is the ability to set those annotations at a package "
+"level."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:2503
+#, no-c-format
+msgid "Custom SQL for CRUD operations"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2505
+#, no-c-format
+msgid ""
+"Hibernate gives you the ability to override every single SQL statement "
+"generated. We have seen native SQL query usage already, but you can also "
+"override the SQL statement used to load or change the state of entities."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2510
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Table(name=\"CHAOS\")\n"
+"<emphasis role=\"bold\">@SQLInsert( sql=\"INSERT INTO
CHAOS(size, name, "
+"nickname, id) VALUES(?,upper(?),?,?)\")\n"
+"@SQLUpdate( sql=\"UPDATE CHAOS SET size = ?, name = upper(?), nickname = ?
"
+"WHERE id = ?\")\n"
+"@SQLDelete( sql=\"DELETE CHAOS WHERE id = ?\")\n"
+"@SQLDeleteAll( sql=\"DELETE CHAOS\")\n"
+"</emphasis><emphasis role=\"bold\">@Loader(namedQuery =
\"chaos\")</"
+"emphasis>\n"
+"@NamedNativeQuery(name=\"chaos\", query=\"select id, size, name,
lower"
+"( nickname ) as nickname from CHAOS where id= ?\", resultClass = Chaos."
+"class)\n"
+"public class Chaos {\n"
+" @Id\n"
+" private Long id;\n"
+" private Long size;\n"
+" private String name;\n"
+" private String nickname;"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2512
+#, no-c-format
+msgid ""
+"<literal>@SQLInsert</literal>,
<literal>@SQLUpdate</literal>, "
+"<literal>@SQLDelete</literal>,
<literal>@SQLDeleteAll</literal> respectively "
+"override the INSERT statement, UPDATE statement, DELETE statement, DELETE "
+"statement to remove all entities."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2517
+#, no-c-format
+msgid ""
+"If you expect to call a store procedure, be sure to set the "
+"<literal>callable</literal> attribute to true
(<literal>@SQLInsert"
+"(callable=true, ...)</literal>)."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2521
+#, no-c-format
+msgid ""
+"To check that the execution happens correctly, Hibernate allows you to "
+"define one of those three strategies:"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2526
+#, no-c-format
+msgid ""
+"NONE: no check is performed: the store procedure is expected to fail upon "
+"issues"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2531
+#, no-c-format
+msgid "COUNT: use of rowcount to check that the update is successful"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2536
+#, no-c-format
+msgid ""
+"PARAM: like COUNT but using an output parameter rather that the standard "
+"mechanism"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2541
+#, no-c-format
+msgid ""
+"To define the result check style, use the <literal>check</literal>
parameter "
+"(<literal>(a)SQLUpdate(check=ResultCheckStyle.COUNT,
...)</literal>)."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2545
+#, no-c-format
+msgid ""
+"You can also override the SQL load statement by a native SQL query or a HQL "
+"query. You just have to refer to a named query with the "
+"<literal><literal>@Loader</literal></literal>
annotation."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2549
+#, no-c-format
+msgid ""
+"You can use the exact same set of annotations to override the collection "
+"related statements."
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2552
+#, no-c-format
+msgid ""
+"@OneToMany\n"
+"@JoinColumn(name=\"chaos_fk\")\n"
+"<emphasis role=\"bold\">@SQLInsert( sql=\"UPDATE
CASIMIR_PARTICULE SET "
+"chaos_fk = ? where id = ?\")\n"
+"@SQLDelete( sql=\"UPDATE CASIMIR_PARTICULE SET chaos_fk = null where id =
?"
+"\")</emphasis>\n"
+"private Set<CasimirParticle> particles = new HashSet<"
+"CasimirParticle>();"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2554
+#, no-c-format
+msgid ""
+"The parameters order is important and is defined by the order Hibernate "
+"handle properties. You can see the expected order by enabling debug logging "
+"for the <literal>org.hibernate.persister.entity</literal> level. With
this "
+"level enabled Hibernate will print out the static SQL that is used to "
+"create, update, delete etc. entities. (To see the expected sequence, "
+"remember to not include your custom SQL through annotations as that will "
+"override the Hibernate generated static sql.)"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2563
+#, no-c-format
+msgid ""
+"Overriding SQL statements for secondary tables is also possible using "
+"<literal>(a)org.hibernate.annotations.Table</literal> and either (or all)
"
+"attributes <literal>sqlInsert</literal>,
<literal>sqlUpdate</literal>, "
+"<literal>sqlDelete</literal>:"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2568
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@SecondaryTables({\n"
+" @SecondaryTable(name = \"`Cat nbr1`\"),\n"
+" @SecondaryTable(name = \"Cat2\"})\n"
+"(a)org.hibernate.annotations.Tables( {\n"
+" @Table(appliesTo = \"Cat\", comment = \"My cat table\"
),\n"
+" @Table(appliesTo = \"Cat2\", foreignKey =
@ForeignKey(name=\"FK_CAT2_CAT"
+"\"), fetch = FetchMode.SELECT,\n"
+" <emphasis
role=\"bold\">sqlInsert=@SQLInsert(sql=\"insert into Cat2"
+"(storyPart2, id) values(upper(?), ?)\") )</emphasis>\n"
+"} )\n"
+"public class Cat implements Serializable {"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2570
+#, no-c-format
+msgid ""
+"The previous example also show that you can give a comment to a given table "
+"(promary or secondary): This comment will be used for DDL generation."
+msgstr ""
+
+#. Tag: title
+#: entity.xml:2576
+#, no-c-format
+msgid "Tuplizer"
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2578
+#, no-c-format
+msgid ""
+"<classname>org.hibernate.tuple.Tuplizer</classname>, and its
sub-interfaces, "
+"are responsible for managing a particular representation of a piece of data,
"
+"given that representation's
<literal>org.hibernate.EntityMode</literal>. If "
+"a given piece of data is thought of as a data structure, then a tuplizer is "
+"the thing which knows how to create such a data structure and how to extract
"
+"values from and inject values into such a data structure. For example, for "
+"the POJO entity mode, the correpsonding tuplizer knows how create the POJO "
+"through its constructor and how to access the POJO properties using the "
+"defined property accessors. There are two high-level types of Tuplizers, "
+"represented by the
<classname>org.hibernate.tuple.EntityTuplizer</classname> "
+"and <classname>org.hibernate.tuple.ComponentTuplizer</classname>
interfaces. "
+"EntityTuplizers are responsible for managing the above mentioned contracts "
+"in regards to entities, while <classname>ComponentTuplizers</classname>
do "
+"the same for components. Check the Hibernate reference documentation for "
+"more information."
+msgstr ""
+
+#. Tag: para
+#: entity.xml:2596
+#, no-c-format
+msgid ""
+"To define tuplixer in annotations, simply use the
<literal>@Tuplizer</"
+"literal> annotation on the according element"
+msgstr ""
+
+#. Tag: programlisting
+#: entity.xml:2599
+#, no-c-format
+msgid ""
+"@Entity\n"
+"<emphasis role=\"bold\">@Tuplizer(impl =
DynamicEntityTuplizer.class)</"
+"emphasis>\n"
+"public interface Cuisine {\n"
+" @Id\n"
+" @GeneratedValue\n"
+" public Long getId();\n"
+" public void setId(Long id);\n"
+"\n"
+" public String getName();\n"
+" public void setName(String name);\n"
+"\n"
+" <emphasis role=\"bold\">@Tuplizer(impl =
DynamicComponentTuplizer.class)"
+"</emphasis>\n"
+" public Country getCountry();\n"
+" public void setCountry(Country country);\n"
+"\n"
+"\n"
+"}"
+msgstr ""
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/zh-CN/setup.po
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/zh-CN/setup.po
(rev 0)
+++ annotations/branches/v3_4_0_GA_CP/src/main/docbook/zh-CN/setup.po 2009-12-22 06:50:19
UTC (rev 18313)
@@ -0,0 +1,319 @@
+#. Tag: title
+#: setup.xml:28
+#, no-c-format
+msgid "Setting up an annotations project"
+msgstr ""
+
+#. Tag: title
+#: setup.xml:31
+#, no-c-format
+msgid "Requirements"
+msgstr ""
+
+#. Tag: para
+#: setup.xml:35
+#, no-c-format
+msgid ""
+"<ulink
url=\"http://www.hibernate.org/6.html\">Download</ulink> and unpack
"
+"the Hibernate Annotations distribution from the Hibernate website."
+msgstr ""
+
+#. Tag: emphasis
+#: setup.xml:41
+#, no-c-format
+msgid "This release requires Hibernate Core 3.3 and above."
+msgstr ""
+
+#. Tag: para
+#: setup.xml:46
+#, no-c-format
+msgid "This release is known to work on Hibernate Core 3.3.0.SP1"
+msgstr ""
+
+#. Tag: para
+#: setup.xml:50
+#, no-c-format
+msgid ""
+"Make sure you have JDK 5.0 installed or above. You can of course continue "
+"using XDoclet and get some of the benefits of annotation-based metadata with
"
+"older JDK versions. Note that this document only describes JDK 5.0 "
+"annotations and you have to refer to the XDoclet documentation for more "
+"information."
+msgstr ""
+
+#. Tag: title
+#: setup.xml:60
+#, no-c-format
+msgid "Configuration"
+msgstr ""
+
+#. Tag: para
+#: setup.xml:62
+#, no-c-format
+msgid ""
+"First, set up your classpath (after you have created a new project in your "
+"favorite IDE):"
+msgstr ""
+
+#. Tag: para
+#: setup.xml:65
+#, no-c-format
+msgid ""
+"Copy all Hibernate3 core and required 3rd party library files (see lib/"
+"README.txt in Hibernate)."
+msgstr ""
+
+#. Tag: para
+#: setup.xml:70
+#, no-c-format
+msgid ""
+"Copy <filename>hibernate-annotations.jar</filename>,
<filename>lib/hibernate-"
+"comons-annotations.jar</filename> and
<filename>lib/ejb3-persistence.jar</"
+"filename> from the Hibernate Annotations distribution to your classpath as
"
+"well."
+msgstr ""
+
+#. Tag: para
+#: setup.xml:77
+#, no-c-format
+msgid ""
+"If you wish to use <ulink
url=\"http://validator.hibernate.org\">Hibernate "
+"Validator</ulink>, download it from the Hibernate website and add "
+"<filename>hibernate-validator.jar</filename> in your classpath."
+msgstr ""
+
+#. Tag: para
+#: setup.xml:82
+#, no-c-format
+msgid ""
+"If you wish to use <ulink
url=\"http://search.hibernate.org\">Hibernate "
+"Search</ulink>, download it from the Hibernate website and add "
+"<filename>hibernate-search.jar</filename> and
<filename>lucene-core-x.y.z."
+"jar</filename> in your classpath."
+msgstr ""
+
+#. Tag: para
+#: setup.xml:88
+#, no-c-format
+msgid ""
+"We also recommend a small wrapper class to startup Hibernate in a static "
+"initializer block, known as <classname>HibernateUtil</classname>. You
might "
+"have seen this class in various forms in other areas of the Hibernate "
+"documentation. For Annotation support you have to enhance this helper class "
+"as follows:"
+msgstr ""
+
+#. Tag: programlisting
+#: setup.xml:92
+#, no-c-format
+msgid ""
+"package hello;\n"
+"\n"
+"import org.hibernate.*;\n"
+"import org.hibernate.cfg.*;\n"
+"import test.*;\n"
+"import test.animals.Dog;\n"
+"\n"
+"public class HibernateUtil {\n"
+"\n"
+"private static final SessionFactory sessionFactory;\n"
+"\n"
+" static {\n"
+" try {\n"
+"\n"
+" sessionFactory = new <emphasis role=\"bold"
+"\">AnnotationConfiguration()</emphasis>\n"
+" configure().buildSessionFactory();\n"
+" } catch (Throwable ex) {\n"
+" // Log exception!\n"
+" throw new ExceptionInInitializerError(ex);\n"
+" }\n"
+" }\n"
+"\n"
+" public static Session getSession()\n"
+" throws HibernateException {\n"
+" return sessionFactory.openSession();\n"
+" }\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: setup.xml:94
+#, no-c-format
+msgid ""
+"Interesting here is the use of <classname>AnnotationConfiguration</"
+"classname>. The packages and annotated classes are declared in your regular
"
+"XML configuration file (usually
<filename>hibernate.cfg.xml</filename>). "
+"Here is the equivalent of the above declaration:"
+msgstr ""
+
+#. Tag: programlisting
+#: setup.xml:100
+#, no-c-format
+msgid ""
+"<!DOCTYPE hibernate-configuration PUBLIC\n"
+" \"-//Hibernate/Hibernate Configuration DTD 3.0//EN\"\n"
+" \"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"
+"\">\n"
+"\n"
+" <hibernate-configuration>\n"
+" <session-factory>\n"
+" <emphasis role=\"bold\"><mapping
package=\"test.animals\"/"
+">\n"
+" <mapping class=\"test.Flight\"/>\n"
+" <mapping class=\"test.Sky\"/>\n"
+" <mapping class=\"test.Person\"/>\n"
+" <mapping
class=\"test.animals.Dog\"/></emphasis>\n"
+"<emphasis role=\"bold\"> <mapping
resource=\"test/animals/orm."
+"xml\"/></emphasis>\n"
+" </session-factory>\n"
+" </hibernate-configuration>"
+msgstr ""
+
+#. Tag: para
+#: setup.xml:102
+#, no-c-format
+msgid ""
+"Note that you can mix the hbm.xml use and the new annotation one. The "
+"resource element can be either an hbm file or an EJB3 XML deployment "
+"descriptor. The distinction is transparent for your configuration process."
+msgstr ""
+
+#. Tag: para
+#: setup.xml:107
+#, no-c-format
+msgid ""
+"Alternatively, you can define the annotated classes and packages using the "
+"programmatic API"
+msgstr ""
+
+#. Tag: programlisting
+#: setup.xml:110
+#, no-c-format
+msgid ""
+"sessionFactory = new <emphasis
role=\"bold\">AnnotationConfiguration()\n"
+" .addPackage(\"test.animals\") //the fully qualified package
name\n"
+" .addAnnotatedClass(Flight.class)\n"
+" .addAnnotatedClass(Sky.class)\n"
+" .addAnnotatedClass(Person.class)\n"
+" .addAnnotatedClass(Dog.class)</emphasis>\n"
+"<emphasis
role=\"bold\">.addResource(\"test/animals/orm.xml\")</emphasis>\n"
+" configure()..buildSessionFactory();"
+msgstr ""
+
+#. Tag: para
+#: setup.xml:112
+#, no-c-format
+msgid ""
+"You can also use the Hibernate EntityManager which has its own configuration
"
+"mechanism. Please refer to this project documentation for more details."
+msgstr ""
+
+#. Tag: para
+#: setup.xml:116
+#, no-c-format
+msgid ""
+"There is no other difference in the way you use Hibernate APIs with "
+"annotations, except for this startup routine change or in the configuration "
+"file. You can use your favorite configuration method for other properties "
+"( <filename>hibernate.properties</filename>,
<filename>hibernate.cfg.xml</"
+"filename>, programmatic APIs, etc). You can even mix annotated persistent
"
+"classes and classic <filename>hbm.cfg.xml</filename> declarations with
the "
+"same <classname>SessionFactory</classname>. You can however not declare
a "
+"class several times (whether annotated or through hbm.xml). You cannot mix "
+"configuration strategies (hbm vs annotations) in a mapped entity hierarchy "
+"either."
+msgstr ""
+
+#. Tag: para
+#: setup.xml:128
+#, no-c-format
+msgid ""
+"To ease the migration process from hbm files to annotations, the "
+"configuration mechanism detects the mapping duplication between annotations "
+"and hbm files. HBM files are then prioritized over annotated metadata on a "
+"class to class basis. You can change the priority using
<literal>hibernate."
+"mapping.precedence</literal> property. The default is <literal>hbm,
class</"
+"literal>, changing it to <literal>class, hbm</literal> will
prioritize the "
+"annotated classes over hbm files when a conflict occurs."
+msgstr ""
+
+#. Tag: title
+#: setup.xml:139
+#, no-c-format
+msgid "Properties"
+msgstr ""
+
+#. Tag: para
+#: setup.xml:141
+#, no-c-format
+msgid ""
+"Asides from the Hibernate core properties, Hibernate Annotations reacts to "
+"the following one"
+msgstr ""
+
+#. Tag: title
+#: setup.xml:146
+#, no-c-format
+msgid "Logging"
+msgstr ""
+
+#. Tag: para
+#: setup.xml:148
+#, no-c-format
+msgid ""
+"Hibernate Annotations utilizes <ulink
url=\"http://www.slf4j.org/\">Simple "
+"Logging Facade for Java</ulink> (SLF4J) in order to log various system
"
+"events. SLF4J can direct your logging output to several logging frameworks "
+"(NOP, Simple, log4j version 1.2, JDK 1.4 logging, JCL or logback) depending "
+"on your chosen binding. In order to setup logging properly you will need "
+"<filename>slf4j-api.jar</filename> in your classpath together with the
jar "
+"file for your preferred binding -
<filename>slf4j-log4j12.jar</filename> in "
+"the case of Log4J. See the SLF4J <ulink type=\"\"
url=\"http://www.slf4j.org/"
+"manual.html\">documentation</ulink> for more detail."
+msgstr ""
+
+#. Tag: para
+#: setup.xml:160
+#, no-c-format
+msgid "The logging categories interesting for Hibernate Annotations are:"
+msgstr ""
+
+#. Tag: title
+#: setup.xml:164
+#, no-c-format
+msgid "Hibernate Annotations Log Categories"
+msgstr ""
+
+#. Tag: entry
+#: setup.xml:169
+#, no-c-format
+msgid "Category"
+msgstr ""
+
+#. Tag: entry
+#: setup.xml:171
+#, no-c-format
+msgid "Function"
+msgstr ""
+
+#. Tag: emphasis
+#: setup.xml:177
+#, no-c-format
+msgid "org.hibernate.cfg"
+msgstr ""
+
+#. Tag: entry
+#: setup.xml:179
+#, no-c-format
+msgid "Log all configuration related events (not only annotations)."
+msgstr ""
+
+#. Tag: para
+#: setup.xml:186
+#, no-c-format
+msgid ""
+"For further category configuration refer to the <ulink
url=\"http://www."
+"hibernate.org/hib_docs/v3/reference/en/html_single/#configuration-logging"
+"\">Logging</ulink> in the Hibernate Core documentation."
+msgstr ""
Added: annotations/branches/v3_4_0_GA_CP/src/main/docbook/zh-CN/xml-overriding.po
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/main/docbook/zh-CN/xml-overriding.po
(rev 0)
+++ annotations/branches/v3_4_0_GA_CP/src/main/docbook/zh-CN/xml-overriding.po 2009-12-22
06:50:19 UTC (rev 18313)
@@ -0,0 +1,415 @@
+#. Tag: title
+#: xml-overriding.xml:28
+#, no-c-format
+msgid "Overriding metadata through XML"
+msgstr ""
+
+#. Tag: para
+#: xml-overriding.xml:30
+#, no-c-format
+msgid ""
+"The primary target for metadata in EJB3 is annotations, but the EJB3 "
+"specification provides a way to override or replace the annotation defined "
+"metadata through an XML deployment descriptor. In the current release only "
+"pure EJB3 annotations overriding are supported. If you wish to use Hibernate
"
+"specific features in some entities, you'll have to either use annotations or
"
+"fallback to hbm files. You can of course mix and match annotated entities "
+"and entities describes in hbm files."
+msgstr ""
+
+#. Tag: para
+#: xml-overriding.xml:38
+#, no-c-format
+msgid "The unit test suite shows some additional XML file samples."
+msgstr ""
+
+#. Tag: title
+#: xml-overriding.xml:41
+#, no-c-format
+msgid "Principles"
+msgstr ""
+
+#. Tag: para
+#: xml-overriding.xml:43
+#, no-c-format
+msgid ""
+"The XML deployment descriptor structure has been designed to reflect the "
+"annotations one. So if you know the annotations structure, using the XML "
+"schema will be straightforward for you."
+msgstr ""
+
+#. Tag: para
+#: xml-overriding.xml:47
+#, no-c-format
+msgid ""
+"You can define one ot more XML files describing your metadata, these files "
+"will be merged by the overriding engine."
+msgstr ""
+
+#. Tag: title
+#: xml-overriding.xml:51
+#, no-c-format
+msgid "Global level metadata"
+msgstr ""
+
+#. Tag: para
+#: xml-overriding.xml:53
+#, no-c-format
+msgid ""
+"You can define global level metadata available for all XML files. You must "
+"not define these metadata more than once per deployment."
+msgstr ""
+
+#. Tag: programlisting
+#: xml-overriding.xml:56
+#, no-c-format
+msgid ""
+"<?xml version=\"1.0\"
encoding=\"UTF-8\"?>\n"
+"\n"
+"<entity-mappings \n"
+"
xmlns=\"http://java.sun.com/xml/ns/persistence/orm\"\n"
+"
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
+"
xsi:schemaLocation=\"http://java.sun.com/xml/ns/persistence/orm
orm_1_0.xsd"
+"\"\n"
+" version=\"1.0\">\n"
+"\n"
+" <persistence-unit-metadata>\n"
+" <xml-mapping-metadata-complete/>\n"
+" <persistence-unit-defaults>\n"
+" <schema>myschema</schema>\n"
+" <catalog>mycatalog</catalog>\n"
+" <cascade-persist/>\n"
+" </persistence-unit-defaults>\n"
+" </persistence-unit-metadata>"
+msgstr ""
+
+#. Tag: para
+#: xml-overriding.xml:58
+#, no-c-format
+msgid ""
+"<literal>xml-mapping-metadata-complete</literal> means that all entity,
"
+"mapped-superclasses and embeddable metadata should be picked up from XML (ie
"
+"ignore annotations)."
+msgstr ""
+
+#. Tag: para
+#: xml-overriding.xml:62
+#, no-c-format
+msgid ""
+"<literal>schema / catalog</literal> will override all default
definitions of "
+"schema and catalog in the metadata (both XML and annotations)."
+msgstr ""
+
+#. Tag: para
+#: xml-overriding.xml:66
+#, no-c-format
+msgid ""
+"<literal>cascade-persist</literal> means that all associations have
PERSIST "
+"as a cascade type. We recommend you to not use this feature."
+msgstr ""
+
+#. Tag: title
+#: xml-overriding.xml:72
+#, no-c-format
+msgid "Entity level metadata"
+msgstr ""
+
+#. Tag: para
+#: xml-overriding.xml:74
+#, no-c-format
+msgid ""
+"You can either define or override metadata informations on a given entity."
+msgstr ""
+
+#. Tag: section
+#: xml-overriding.xml:75
+#, no-c-format
+msgid ""
+"<programlistingco> <areaspec> <area coords=\"3 85\"
id=\"aa1\"/> <area "
+"coords=\"9 85\" id=\"aa2\"/> <area coords=\"10
85\" id=\"aa3\"/> <area "
+"coords=\"11 85\" id=\"aa4\"/> <area coords=\"17
85\" id=\"aa5\"/> <area "
+"coords=\"23 85\" id=\"aa6\"/> <area coords=\"24
85\" id=\"aa7\"/> <area "
+"coords=\"25 85\" id=\"aa8\"/> <area coords=\"26
85\" id=\"aa9\"/> <area "
+"coords=\"31 85\" id=\"aa10\"/> </areaspec>
<programlisting><?xml version="
+"\"1.0\" encoding=\"UTF-8\"?>\n"
+"\n"
+"<entity-mappings \n"
+"
xmlns=\"http://java.sun.com/xml/ns/persistence/orm\"\n"
+"
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
+"
xsi:schemaLocation=\"http://java.sun.com/xml/ns/persistence/orm
orm_1_0.xsd"
+"\"\n"
+" version=\"1.0\">\n"
+"\n"
+"
<package>org.hibernate.test.annotations.reflection</"
+"package>\n"
+" <entity class=\"Administration\" access=\"PROPERTY\"
metadata-"
+"complete=\"true\">\n"
+" <table name=\"tbl_admin\">\n"
+" <unique-constraint>\n"
+"
<column-name>firstname</column-name>\n"
+"
<column-name>lastname</column-name>\n"
+" </unique-constraint>\n"
+" </table>\n"
+" <secondary-table name=\"admin2\">\n"
+" <primary-key-join-column name=\"admin_id\"
referenced-column-"
+"name=\"id\"/>\n"
+" <unique-constraint>\n"
+"
<column-name>address</column-name>\n"
+" </unique-constraint>\n"
+" </secondary-table>\n"
+" <id-class class=\"SocialSecurityNumber\"/>\n"
+" <inheritance strategy=\"JOINED\"/>\n"
+" <sequence-generator name=\"seqhilo\"
sequence-name=\"seqhilo\"/"
+">\n"
+" <table-generator name=\"table\"
table=\"tablehilo\"/>\n"
+" ...\n"
+" </entity>\n"
+"\n"
+" <entity class=\"PostalAdministration\">\n"
+" <primary-key-join-column name=\"id\"/>\n"
+" ...\n"
+" </entity>\n"
+"</entity-mappings></programlisting> <calloutlist>
<callout arearefs="
+"\"aa1\"> <para><literal>entity-mappings</literal>:
entity-mappings is the "
+"root element for all XML files. You must declare the xml schema, the schema "
+"file is included in the hibernate-annotations.jar file, no internet access "
+"will be processed by Hibernate Annotations.</para> </callout>
<callout "
+"arearefs=\"aa2\"> <para><literal>package</literal>
(optional): default "
+"package used for all non qualified class names in the given deployment "
+"descriptor file.</para> </callout> <callout
arearefs=\"aa3\"> "
+"<para><literal>entity</literal>: desribes an entity.</para>
"
+"<para><literal>metadata-complete</literal> defines whether the
metadata "
+"description for this element is complete or not (in other words, if "
+"annotations present at the class level should be considered or not).</para>
"
+"<para>An entity has to have a <literal>class</literal> attribute
refering "
+"the java class the metadata applies on.</para> <para>You can overrides
"
+"entity name through the <literal>name</literal> attribute, if none is
"
+"defined and if an <literal>(a)Entity.name</literal> is present, then it
is "
+"used (provided that metadata complete is not set).</para> <para>For
metadata "
+"complete (see below) element, you can define an
<literal>access</literal> "
+"(either <literal>FIELD</literal> or
<literal>PROPERTY</literal> (default)). "
+"For non medatada complete element, if <literal>access</literal> is not
"
+"defined, the @Id position will lead position, if
<literal>access</literal> "
+"is defined, the value is used.</para> </callout> <callout
arearefs=\"aa4\"> "
+"<para><literal>table</literal>: you can declare table properties
(name, "
+"schema, catalog), if none is defined, the java annotation is used.</para>
"
+"<para>You can define one or several unique constraints as seen in the "
+"example</para> </callout> <callout arearefs=\"aa5\">
"
+"<para><literal>secondary-table</literal>: defines a secondary
table very "
+"much like a regular table except that you can define the primary key / "
+"foreign key column(s) through the
<literal>primary-key-join-column</literal> "
+"element. On non metadata complete, annotation secondary tables are used only
"
+"if there is no <literal>secondary-table</literal> definition,
annotations "
+"are ignored otherwise.</para> </callout> <callout
arearefs=\"aa6\"> "
+"<para><literal>id-class</literal>: defines the id class in a
similar way "
+"<literal>@IdClass</literal> does</para> </callout>
<callout arearefs=\"aa7"
+"\"> <para><literal>inheritance</literal>: defines the
inheritance strategy "
+"(<literal>JOINED</literal>,
<literal>TABLE_PER_CLASS</literal>, "
+"<literal>SINGLE_TABLE</literal>), Available only at the root entity
level</"
+"para> </callout> <callout arearefs=\"aa8\">
<para><literal>sequence-"
+"generator</literal>: defines a sequence generator</para>
</callout> <callout "
+"arearefs=\"aa9\">
<para><literal>table-generator</literal>: defines a table "
+"generator</para> </callout> <callout arearefs=\"aa10\">
"
+"<para><literal><literal>primary-key-join-column</literal></literal>:
defines "
+"the primary key join column for sub entities when JOINED inheritance "
+"strategy is used</para> </callout> </calloutlist>
</programlistingco> "
+"<programlistingco> <areaspec> <area coords=\"11 85\"
id=\"ab1\"/> <area "
+"coords=\"18 85\" id=\"ab2\"/> <area coords=\"22
85\" id=\"ab3\"/> <area "
+"coords=\"28 85\" id=\"ab4\"/> <area coords=\"34
85\" id=\"ab5\"/> </"
+"areaspec> <programlisting><?xml version=\"1.0\"
encoding=\"UTF-8\"?>\n"
+"\n"
+"<entity-mappings \n"
+"
xmlns=\"http://java.sun.com/xml/ns/persistence/orm\"\n"
+"
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
+"
xsi:schemaLocation=\"http://java.sun.com/xml/ns/persistence/orm
orm_1_0.xsd"
+"\"\n"
+" version=\"1.0\">\n"
+"\n"
+"
<package>org.hibernate.test.annotations.reflection</"
+"package>\n"
+" <entity class=\"Music\" access=\"PROPERTY\"
metadata-complete=\"true"
+"\">\n"
+"
<discriminator-value>Generic</discriminator-value>\n"
+" <discriminator-column length=\"34\"/>\n"
+" ...\n"
+" </entity>\n"
+"\n"
+" <entity class=\"PostalAdministration\">\n"
+" <primary-key-join-column name=\"id\"/>\n"
+" <named-query name=\"adminById\">\n"
+" <query>select m from Administration m where m.id =
:id</"
+"query>\n"
+" <hint name=\"org.hibernate.timeout\"
value=\"200\"/>\n"
+" </named-query>\n"
+" <named-native-query name=\"allAdmin\"
result-set-mapping=\"adminrs"
+"\">\n"
+" <query>select *, count(taxpayer_id) as taxPayerNumber
\n"
+" from Administration, TaxPayer\n"
+" where taxpayer_admin_id = admin_id group by
...</query>\n"
+" <hint name=\"org.hibernate.timeout\"
value=\"200\"/>\n"
+" </named-native-query>\n"
+" <sql-result-set-mapping name=\"adminrs\">\n"
+" <entity-result
entity-class=\"Administration\">\n"
+" <field-result name=\"name\"
column=\"fld_name\"/>\n"
+" </entity-result>\n"
+" <column-result
name=\"taxPayerNumber\"/>\n"
+" </sql-result-set-mapping>\n"
+" <attribute-override name=\"ground\">\n"
+" <column name=\"fld_ground\" unique=\"true\"
scale=\"2\"/>\n"
+" </attribute-override>\n"
+" <association-override name=\"referer\">\n"
+" <join-column name=\"referer_id\"
referenced-column-name=\"id"
+"\"/>\n"
+" </association-override>\n"
+" ...\n"
+" </entity>\n"
+"</entity-mappings></programlisting> <calloutlist>
<callout arearefs="
+"\"ab1\"> <para><literal>discriminator-value /
discriminator-column</"
+"literal>: defines the discriminator value and the column holding it when the
"
+"SINGLE_TABLE inheritance strategy is chosen</para> </callout>
<callout "
+"arearefs=\"ab2\">
<para><literal>named-query</literal>: defines named "
+"queries and possibly the hints associated to them. Those definitions are "
+"additive to the one defined in annotations, if two definitions have the same
"
+"name, the XML one has priority.</para> </callout> <callout
arearefs=\"ab3\"> "
+"<para><literal>named-native-query</literal>: defines an named
native query "
+"and its sql result set mapping. Alternatively, you can define the "
+"<literal>result-class</literal>. Those definitions are additive to the
one "
+"defined in annotations, if two definitions have the same name, the XML one "
+"has priority.</para> </callout> <callout
arearefs=\"ab4\"> "
+"<para><literal>sql-result-set-mapping</literal>: describes the
result set "
+"mapping structure. You can define both entity and column mappings. Those "
+"definitions are additive to the one defined in annotations, if two "
+"definitions have the same name, the XML one has priority</para>
</callout> "
+"<callout arearefs=\"ab5\">
<para><literal>attribute-override / association-"
+"override</literal>: defines a column or join column overriding. This "
+"overriding is additive to the one defined in annotations</para>
</callout> </"
+"calloutlist> </programlistingco>"
+msgstr ""
+
+#. Tag: para
+#: xml-overriding.xml:246
+#, no-c-format
+msgid ""
+"Same applies for <literal><embeddable></literal> and
<literal><"
+"mapped-superclass></literal>."
+msgstr ""
+
+#. Tag: title
+#: xml-overriding.xml:251
+#, no-c-format
+msgid "Property level metadata"
+msgstr ""
+
+#. Tag: para
+#: xml-overriding.xml:253
+#, no-c-format
+msgid ""
+"You can of course defines XML overriding for properties. If metadata "
+"complete is defined, then additional properties (ie at the Java level) will "
+"be ignored. Otherwise, once you start overriding a property, all annotations
"
+"on the given property are ignored. All property level metadata behave in "
+"<literal>entity/attributes</literal>,
<literal>mapped-superclass/attributes</"
+"literal> or <literal>embeddable/attributes</literal>."
+msgstr ""
+
+#. Tag: programlisting
+#: xml-overriding.xml:261
+#, no-c-format
+msgid ""
+"<attributes>\n"
+" <id name=\"id\">\n"
+" <column name=\"fld_id\"/>\n"
+" <generated-value generator=\"generator\"
strategy=\"SEQUENCE"
+"\"/>\n"
+" <temporal>DATE</temporal>\n"
+" <sequence-generator name=\"generator\"
sequence-name=\"seq\"/"
+">\n"
+" </id>\n"
+" <version name=\"version\"/>\n"
+" <embedded name=\"embeddedObject\">\n"
+" <attribute-override
name\"subproperty\">\n"
+" <column name=\"my_column\"/>\n"
+" </attribute-override>\n"
+" </embedded>\n"
+" <basic name=\"status\"
optional=\"false\">\n"
+" <enumerated>STRING</enumerated>\n"
+" </basic>\n"
+" <basic name=\"serial\"
optional=\"true\">\n"
+" <column name=\"serialbytes\"/>\n"
+" <lob/>\n"
+" </basic>\n"
+" <basic name=\"terminusTime\"
fetch=\"LAZY\">\n"
+" <temporal>TIMESTAMP</temporal>\n"
+" </basic>\n"
+" </attributes>"
+msgstr ""
+
+#. Tag: para
+#: xml-overriding.xml:263
+#, no-c-format
+msgid ""
+"You can override a property through <literal>id</literal>,
<literal>embedded-"
+"id</literal>, <literal>version</literal>,
<literal>embedded</literal> and "
+"<literal>basic</literal>. Each of these elements can have subelements
"
+"accordingly: <literal>lob</literal>,
<literal>temporal</literal>, "
+"<literal>enumerated</literal>,
<literal>column</literal>."
+msgstr ""
+
+#. Tag: title
+#: xml-overriding.xml:272
+#, no-c-format
+msgid "Association level metadata"
+msgstr ""
+
+#. Tag: para
+#: xml-overriding.xml:274
+#, no-c-format
+msgid ""
+"You can define XML overriding for associations. All association level "
+"metadata behave in <literal>entity/attributes</literal>,
<literal>mapped-"
+"superclass/attributes</literal> or
<literal>embeddable/attributes</literal>."
+msgstr ""
+
+#. Tag: programlisting
+#: xml-overriding.xml:279
+#, no-c-format
+msgid ""
+"<attributes>\n"
+" <one-to-many name=\"players\"
fetch=\"EAGER\">\n"
+" <map-key name=\"name\"/>\n"
+" <join-column name=\"driver\"/>\n"
+" <join-column name=\"number\"/>\n"
+" </one-to-many>\n"
+" <many-to-many name=\"roads\"
target-entity=\"Administration"
+"\">\n"
+" <order-by>maxSpeed</order-by>\n"
+" <join-table name=\"bus_road\">\n"
+" <join-column name=\"driver\"/>\n"
+" <join-column name=\"number\"/>\n"
+" <inverse-join-column
name=\"road_id\"/>\n"
+" <unique-constraint>\n"
+"
<column-name>driver</column-name>\n"
+"
<column-name>number</column-name>\n"
+" </unique-constraint>\n"
+" </join-table>\n"
+" </many-to-many>\n"
+" <many-to-many name=\"allTimeDrivers\"
mapped-by=\"drivenBuses"
+"\">\n"
+" </attributes>"
+msgstr ""
+
+#. Tag: para
+#: xml-overriding.xml:281
+#, no-c-format
+msgid ""
+"You can override an association through <literal>one-to-many</literal>,
"
+"<literal>one-to-one</literal>,
<literal>many-to-one</literal>, and "
+"<literal>many-to-many</literal>. Each of these elements can have
subelements "
+"accordingly: <literal>join-table</literal> (which can have
<literal>join-"
+"column</literal>s and <literal>inverse-join-column</literal>s),
"
+"<literal><literal>join-column</literal>s</literal>,
<literal>map-key</"
+"literal>, and <literal>order-by</literal>.
<literal>mapped-by</literal> and "
+"<literal>target-entity</literal> can be defined as attributes when it
makes "
+"sense. Once again the structure is reflects the annotations structure. You "
+"can find all semantic informations in the chapter describing annotations."
+msgstr ""